Commit a896393b authored by Florent Jaillet's avatar Florent Jaillet

Unify mask computation with get_known_mask() and get_unknown_mask()

parent 8d8c7866
Pipeline #609 passed with stage
in 19 seconds
......@@ -199,9 +199,9 @@
}
},
"source": [
"## Properties\n",
"## Methods and properties\n",
"\n",
"A *MadArray* has attributes that give information about the masking."
"A *MadArray* has methods and properties that give information about the masking."
]
},
{
......@@ -219,7 +219,7 @@
"outputs": [],
"source": [
"# mask of non-missing elements\n",
"print(Am.known_mask)"
"print(Am.get_known_mask())"
]
},
{
......@@ -237,7 +237,7 @@
"outputs": [],
"source": [
"# mask of missing elements\n",
"print(Am.unknown_mask)"
"print(Am.get_unknown_mask())"
]
},
{
......
......@@ -40,8 +40,12 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# ######### COPYRIGHT #########
"""This modules implements data structures adapted to handle missing entries in
audio data structures."""
"""Data structures adapted to handle audio signals with missing data
.. moduleauthor:: Ronan Hamon
.. moduleauthor:: Valentin Emiya
.. moduleauthor:: Florent Jaillet
"""
from .mad_array import MadArray
from .waveform import Waveform
......
This diff is collapsed.
This diff is collapsed.
......@@ -49,6 +49,7 @@ using 'warnings.catch_warnings(record=True)').
.. moduleauthor:: Ronan Hamon
.. moduleauthor:: Valentin Emiya
.. moduleauthor:: Florent Jaillet
"""
import pickle
import pytest
......
......@@ -39,7 +39,12 @@
# along with this program. If not, see <http://www.gnu.org/licenses/>.
#
# ######### COPYRIGHT #########
"""Utils functions for testing."""
"""Utils functions for testing.
.. moduleauthor:: Ronan Hamon
.. moduleauthor:: Valentin Emiya
.. moduleauthor:: Florent Jaillet
"""
import numpy as np
......
......@@ -691,7 +691,7 @@ class Waveform(MadArray):
--------
scipy.signal.hilbert
"""
if np.any(self.unknown_mask):
if np.any(self.get_unknown_mask()):
errmsg = 'Waveform has missing samples.'
raise TypeError(errmsg)
......@@ -827,7 +827,7 @@ class Waveform(MadArray):
errmsg = 'Unsupported target type {}.'
raise TypeError(errmsg.format(dtype))
return Waveform(y, mask=self.unknown_mask, fs=self.fs)
return Waveform(y, mask=self.get_unknown_mask(), fs=self.fs)
def copy(self):
return Waveform(self)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment