-
Notifications
You must be signed in to change notification settings - Fork 8
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add default fractions to graphical_component_analysis #103
Add default fractions to graphical_component_analysis #103
Conversation
… `components` module.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The description of the fractions
parameter need to be updated:
fractions: array_like or int, optional
Number of equidistant fractions, or 1D array of fraction values.
Fraction values must be in range [0.0, 1.0].
If an integer, ``numpy.linspace(0.0, 1.0, fractions)`` fraction values
are used.
If None (default), the number of fractions is determined from the
longest distance between any pair of components and the radius of
the cursor (see Notes below).
src/phasorpy/components.py
Outdated
If no `fractions` are provided, the number of fractions (N) used is | ||
determined by the longest distance between any pair of components (D) | ||
and by the radius of the cursor (R): | ||
|
||
.. math:: | ||
N = \frac{2*D}{R} + 1 | ||
|
||
The fractions can be retrieved by: | ||
|
||
``fractions = numpy.linspace(0.0, 1.0, len(counts[0]))`` | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If no `fractions` are provided, the number of fractions (:math:`N`) used
is determined from the longest distance between any pair of components
(:math:`D`) and the radius of the cursor (:math:`R`):
.. math::
N = \frac{2 \cdot D}{R} + 1
The fractions can be retrieved by:
.. code-block:: python
fractions = numpy.linspace(0.0, 1.0, len(counts[0]))
src/phasorpy/components.py
Outdated
) | ||
longest_distance = max(longest_distance, length) | ||
fractions = numpy.linspace( | ||
0.0, 1.0, int(longest_distance / (radius / 2) + 1) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
int(round(...))
?
…ns` default calculation and description. Round number of default fractions calculation.
Description
This PR proposes the addition of default values for
fractions
in thegraphical_component_analysis
function in thecomponents
module. This was further discussed in #83, where the reasons for the proposed changes are stated.Release note
Summarize the changes in the code block below to be included in the
release notes:
Checklist