Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
madarrays
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
skmad-suite
madarrays
Commits
9d8a1729
There was a problem fetching the pipeline summary.
Commit
9d8a1729
authored
6 years ago
by
Florent Jaillet
Browse files
Options
Downloads
Patches
Plain Diff
Improve documentation of properties
parent
690dfa66
No related branches found
No related tags found
No related merge requests found
Pipeline
#
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
doc/conf.py
+3
-0
3 additions, 0 deletions
doc/conf.py
madarrays/mad_array.py
+45
-77
45 additions, 77 deletions
madarrays/mad_array.py
madarrays/waveform.py
+1
-5
1 addition, 5 deletions
madarrays/waveform.py
with
49 additions
and
82 deletions
doc/conf.py
+
3
−
0
View file @
9d8a1729
...
@@ -286,3 +286,6 @@ numpydoc_show_class_members = False
...
@@ -286,3 +286,6 @@ numpydoc_show_class_members = False
# Include todos
# Include todos
todo_include_todos
=
True
todo_include_todos
=
True
# Keep the order of members as in the source code
autodoc_member_order
=
'
bysource
'
This diff is collapsed.
Click to expand it.
madarrays/mad_array.py
+
45
−
77
View file @
9d8a1729
...
@@ -137,11 +137,11 @@ class MadArray(np.ndarray):
...
@@ -137,11 +137,11 @@ class MadArray(np.ndarray):
implemented:
implemented:
* a :class:`MadArray` object with shape corresponding to the indices is
* a :class:`MadArray` object with shape corresponding to the indices is
returned, with both the data matrix and the mask properly indexed. This
returned, with both the data matrix and the mask properly indexed. This
is the default mode;
is the default mode;
* a :class:`MadArray` object with unchanged shape is returned,
* a :class:`MadArray` object with unchanged shape is returned,
where non-indexed entries are set as masked. This mode is selected by
where non-indexed entries are set as masked. This mode is selected by
setting the parameter :paramref:`masked_indexing` to True.
setting the parameter :paramref:`masked_indexing` to True.
.. _numpy_behaviour_madarray:
.. _numpy_behaviour_madarray:
...
@@ -388,14 +388,11 @@ class MadArray(np.ndarray):
...
@@ -388,14 +388,11 @@ class MadArray(np.ndarray):
@property
@property
def
known_mask
(
self
):
def
known_mask
(
self
):
"""
Boolean mask for known coefficients.
"""
Boolean mask for known coefficients
(boolean nd-array)
.
Returns
Boolean array with entries set to True if the corresponding value
-------
in the object is known. If complex masking, entries set to True if
boolean nd-array
both magnitude and phase are known.
Boolean array with entries set to True if the corresponding value
in the object is known. If complex masking, entries set to True if
both magnitude and phase are known.
"""
"""
if
self
.
_complex_masking
:
if
self
.
_complex_masking
:
return
self
.
_mask
==
0
return
self
.
_mask
==
0
...
@@ -404,14 +401,11 @@ class MadArray(np.ndarray):
...
@@ -404,14 +401,11 @@ class MadArray(np.ndarray):
@property
@property
def
unknown_mask
(
self
):
def
unknown_mask
(
self
):
"""
Boolean mask for unknown coefficients.
"""
Boolean mask for unknown coefficients
(boolean nd-array)
.
Returns
Boolean array with values set to True if the corresponding value in
-------
the object is unknown. If complex masking, entries set to True if
boolean nd-array
magnitude and/or phase are unknown.
Boolean array with values set to True if the corresponding value in
the object is unknown. If complex masking, entries set to True if
magnitude and/or phase are unknown.
"""
"""
if
self
.
_complex_masking
:
if
self
.
_complex_masking
:
return
self
.
any_unknown_mask
return
self
.
any_unknown_mask
...
@@ -420,15 +414,13 @@ class MadArray(np.ndarray):
...
@@ -420,15 +414,13 @@ class MadArray(np.ndarray):
@property
@property
def
any_unknown_mask
(
self
):
def
any_unknown_mask
(
self
):
"""
Boolean mask for coefficients with unknown magnitude and/or phase.
"""
Boolean mask for coefficients with unknown magnitude and/or phase
(boolean nd-array).
Not defined if non complex masking.
Not defined if non complex masking.
Returns
Boolean array with entries set to True if magnitude and/or phase
-------
are unknown.
boolean nd-array
Boolean array with entries set to True if magnitude and/or phase
are unknown.
Raises
Raises
------
------
...
@@ -440,15 +432,13 @@ class MadArray(np.ndarray):
...
@@ -440,15 +432,13 @@ class MadArray(np.ndarray):
@property
@property
def
all_unknown_mask
(
self
):
def
all_unknown_mask
(
self
):
"""
Boolean mask for coefficients with both unknown magnitude and phase.
"""
Boolean mask for coefficients with both unknown magnitude and phase
(boolean nd-array).
Not defined if non complex masking.
Not defined if non complex masking.
Returns
Boolean array with entries set to True if both magnitude and phase
-------
are unknown.
boolean nd-array
Boolean array with entries set to True if both magnitude and phase
are unknown.
Raises
Raises
------
------
...
@@ -460,14 +450,11 @@ class MadArray(np.ndarray):
...
@@ -460,14 +450,11 @@ class MadArray(np.ndarray):
@property
@property
def
known_phase_mask
(
self
):
def
known_phase_mask
(
self
):
"""
Boolean mask for coefficients with known phase.
"""
Boolean mask for coefficients with known phase
(boolean nd-array)
.
Not defined for int or float entries.
Not defined for int or float entries.
Returns
Boolean array with entries set to True if phase is known.
-------
boolean nd-array
Boolean array with entries set to True if phase is known.
Raises
Raises
------
------
...
@@ -479,14 +466,11 @@ class MadArray(np.ndarray):
...
@@ -479,14 +466,11 @@ class MadArray(np.ndarray):
@property
@property
def
unknown_phase_mask
(
self
):
def
unknown_phase_mask
(
self
):
"""
Boolean mask for coefficients with unknown phase.
"""
Boolean mask for coefficients with unknown phase
(boolean nd-array)
.
Not defined for int or float entries.
Not defined for int or float entries.
Returns
Boolean array with entries set to True if phase is unknown.
-------
boolean nd-array
Boolean array with entries set to True if phase is unknown
Raises
Raises
------
------
...
@@ -498,14 +482,12 @@ class MadArray(np.ndarray):
...
@@ -498,14 +482,12 @@ class MadArray(np.ndarray):
@property
@property
def
known_magnitude_mask
(
self
):
def
known_magnitude_mask
(
self
):
"""
Boolean mask for coefficients with known magnitude.
"""
Boolean mask for coefficients with known magnitude
(boolean nd-array).
Not defined for int or float entries.
Not defined for int or float entries.
Returns
Boolean array with entries set to True if magnitude is known.
-------
boolean nd-array
Boolean array with entries set to True if magnitude is known.
Raises
Raises
------
------
...
@@ -518,13 +500,11 @@ class MadArray(np.ndarray):
...
@@ -518,13 +500,11 @@ class MadArray(np.ndarray):
@property
@property
def
unknown_magnitude_mask
(
self
):
def
unknown_magnitude_mask
(
self
):
"""
Boolean mask for coefficients with unknown magnitude
"""
Boolean mask for coefficients with unknown magnitude
(boolean nd-array).
Not defined for int or float entries.
Not defined for int or float entries.
Returns
Boolean array with entries set to True if magnitude is unknown.
-------
boolean nd-array
Boolean array with entries set to True if magnitude is unknown.
Raises
Raises
------
------
...
@@ -536,15 +516,13 @@ class MadArray(np.ndarray):
...
@@ -536,15 +516,13 @@ class MadArray(np.ndarray):
@property
@property
def
unknown_phase_only_mask
(
self
):
def
unknown_phase_only_mask
(
self
):
"""
Boolean mask for coefficients with unknown phase and known magnitude.
"""
Boolean mask for coefficients with unknown phase and known magnitude
(boolean nd-array).
Not defined for int or float entries.
Not defined for int or float entries.
Returns
Boolean array with entries set to True if phase is unknown and
-------
magnitude is known.
boolean nd-array
Boolean array with entries set to True if phase is unknown and
magnitude is known.
Raises
Raises
------
------
...
@@ -556,15 +534,13 @@ class MadArray(np.ndarray):
...
@@ -556,15 +534,13 @@ class MadArray(np.ndarray):
@property
@property
def
unknown_magnitude_only_mask
(
self
):
def
unknown_magnitude_only_mask
(
self
):
"""
Boolean mask for coefficients with unknown magnitude and known phase.
"""
Boolean mask for coefficients with unknown magnitude and known phase
(boolean nd-array).
Not defined for int or float entries.
Not defined for int or float entries.
Returns
Boolean array with entries set to True if magnitude is unknown and
-------
phase is known.
boolean nd-array
Boolean array with entries set to True if magnitude is unknown and
phase is known.
Raises
Raises
------
------
...
@@ -576,15 +552,11 @@ class MadArray(np.ndarray):
...
@@ -576,15 +552,11 @@ class MadArray(np.ndarray):
@property
@property
def
n_missing_data
(
self
):
def
n_missing_data
(
self
):
"""
Number of missing data.
"""
Number of missing data (double or tuple).
Returns
-------
double or tuple
Number of masked coefficients if dtype is int or float. Number of
masked coefficients in phase and magnitude masks if dtype is
complex.
Number of masked coefficients if dtype is int or float. Number of
masked coefficients in phase and magnitude masks if dtype is
complex.
"""
"""
if
self
.
_complex_masking
:
if
self
.
_complex_masking
:
return
(
np
.
sum
(
self
.
unknown_magnitude_mask
),
return
(
np
.
sum
(
self
.
unknown_magnitude_mask
),
...
@@ -594,15 +566,11 @@ class MadArray(np.ndarray):
...
@@ -594,15 +566,11 @@ class MadArray(np.ndarray):
@property
@property
def
ratio_missing_data
(
self
):
def
ratio_missing_data
(
self
):
"""
Ratio of missing data.
"""
Ratio of missing data (double or tuple).
Returns
-------
double or tuple
Ratio of masked coefficients if dtype is int or float. Ratio of
masked coefficients in phase and magnitude masks if dtype is
complex.
Ratio of masked coefficients if dtype is int or float. Ratio of
masked coefficients in phase and magnitude masks if dtype is
complex.
"""
"""
if
self
.
_complex_masking
:
if
self
.
_complex_masking
:
return
(
np
.
average
(
self
.
unknown_magnitude_mask
),
return
(
np
.
average
(
self
.
unknown_magnitude_mask
),
...
...
This diff is collapsed.
Click to expand it.
madarrays/waveform.py
+
1
−
5
View file @
9d8a1729
...
@@ -217,11 +217,7 @@ class Waveform(MadArray):
...
@@ -217,11 +217,7 @@ class Waveform(MadArray):
@property
@property
def
rms
(
self
):
def
rms
(
self
):
"""
Root mean square error of the masked signal.
"""
Root mean square error of the masked signal (float).
Returns
-------
float
Raises
Raises
------
------
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment