Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
madarrays
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Container Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
skmad-suite
madarrays
Commits
9d8a1729
Commit
9d8a1729
authored
Jun 13, 2018
by
Florent Jaillet
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Improve documentation of properties
parent
690dfa66
Pipeline
#558
passed with stages
in 50 seconds
Changes
3
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
49 additions
and
82 deletions
+49
-82
doc/conf.py
doc/conf.py
+3
-0
madarrays/mad_array.py
madarrays/mad_array.py
+45
-77
madarrays/waveform.py
madarrays/waveform.py
+1
-5
No files found.
doc/conf.py
View file @
9d8a1729
...
...
@@ -286,3 +286,6 @@ numpydoc_show_class_members = False
# Include todos
todo_include_todos
=
True
# Keep the order of members as in the source code
autodoc_member_order
=
'bysource'
madarrays/mad_array.py
View file @
9d8a1729
...
...
@@ -137,11 +137,11 @@ class MadArray(np.ndarray):
implemented:
* a :class:`MadArray` object with shape corresponding to the indices is
returned, with both the data matrix and the mask properly indexed. This
is the default mode;
returned, with both the data matrix and the mask properly indexed. This
is the default mode;
* a :class:`MadArray` object with unchanged shape is returned,
where non-indexed entries are set as masked. This mode is selected by
setting the parameter :paramref:`masked_indexing` to True.
where non-indexed entries are set as masked. This mode is selected by
setting the parameter :paramref:`masked_indexing` to True.
.. _numpy_behaviour_madarray:
...
...
@@ -388,14 +388,11 @@ class MadArray(np.ndarray):
@
property
def
known_mask
(
self
):
"""Boolean mask for known coefficients.
"""Boolean mask for known coefficients
(boolean nd-array)
.
Returns
-------
boolean nd-array
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.
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
:
return
self
.
_mask
==
0
...
...
@@ -404,14 +401,11 @@ class MadArray(np.ndarray):
@
property
def
unknown_mask
(
self
):
"""Boolean mask for unknown coefficients.
"""Boolean mask for unknown coefficients
(boolean nd-array)
.
Returns
-------
boolean nd-array
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.
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
:
return
self
.
any_unknown_mask
...
...
@@ -420,15 +414,13 @@ class MadArray(np.ndarray):
@
property
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.
Returns
-------
boolean nd-array
Boolean array with entries set to True if magnitude and/or phase
are unknown.
Boolean array with entries set to True if magnitude and/or phase
are unknown.
Raises
------
...
...
@@ -440,15 +432,13 @@ class MadArray(np.ndarray):
@
property
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.
Returns
-------
boolean nd-array
Boolean array with entries set to True if both magnitude and phase
are unknown.
Boolean array with entries set to True if both magnitude and phase
are unknown.
Raises
------
...
...
@@ -460,14 +450,11 @@ class MadArray(np.ndarray):
@
property
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.
Returns
-------
boolean nd-array
Boolean array with entries set to True if phase is known.
Boolean array with entries set to True if phase is known.
Raises
------
...
...
@@ -479,14 +466,11 @@ class MadArray(np.ndarray):
@
property
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.
Returns
-------
boolean nd-array
Boolean array with entries set to True if phase is unknown
Boolean array with entries set to True if phase is unknown.
Raises
------
...
...
@@ -498,14 +482,12 @@ class MadArray(np.ndarray):
@
property
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.
Returns
-------
boolean nd-array
Boolean array with entries set to True if magnitude is known.
Boolean array with entries set to True if magnitude is known.
Raises
------
...
...
@@ -518,13 +500,11 @@ class MadArray(np.ndarray):
@
property
def
unknown_magnitude_mask
(
self
):
"""Boolean mask for coefficients with unknown magnitude
(boolean nd-array).
Not defined for int or float entries.
Returns
-------
boolean nd-array
Boolean array with entries set to True if magnitude is unknown.
Boolean array with entries set to True if magnitude is unknown.
Raises
------
...
...
@@ -536,15 +516,13 @@ class MadArray(np.ndarray):
@
property
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.
Returns
-------
boolean nd-array
Boolean array with entries set to True if phase is unknown and
magnitude is known.
Boolean array with entries set to True if phase is unknown and
magnitude is known.
Raises
------
...
...
@@ -556,15 +534,13 @@ class MadArray(np.ndarray):
@
property
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.
Returns
-------
boolean nd-array
Boolean array with entries set to True if magnitude is unknown and
phase is known.
Boolean array with entries set to True if magnitude is unknown and
phase is known.
Raises
------
...
...
@@ -576,15 +552,11 @@ class MadArray(np.ndarray):
@
property
def
n_missing_data
(
self
):
"""Number of missing data.
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 missing data (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.
"""
if
self
.
_complex_masking
:
return
(
np
.
sum
(
self
.
unknown_magnitude_mask
),
...
...
@@ -594,15 +566,11 @@ class MadArray(np.ndarray):
@
property
def
ratio_missing_data
(
self
):
"""Ratio of missing data.
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 missing data (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.
"""
if
self
.
_complex_masking
:
return
(
np
.
average
(
self
.
unknown_magnitude_mask
),
...
...
madarrays/waveform.py
View file @
9d8a1729
...
...
@@ -217,11 +217,7 @@ class Waveform(MadArray):
@
property
def
rms
(
self
):
"""Root mean square error of the masked signal.
Returns
-------
float
"""Root mean square error of the masked signal (float).
Raises
------
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment