Skip to content
This repository was archived by the owner on Feb 7, 2024. It is now read-only.
This repository was archived by the owner on Feb 7, 2024. It is now read-only.

Failing test #242

@FRidh

Description

@FRidh

Failing test with nixpkgs at d10a0143d0cbf3777c0e386c8dac635b59754cf2.

/build/acoustics-0.2.3/tests /build/acoustics-0.2.3
============================= test session starts ==============================
platform linux -- Python 3.7.6, pytest-5.3.5, py-1.8.1, pluggy-0.13.1
rootdir: /build/acoustics-0.2.3
collected 504 items                                                            

test__signal.py ........................................................ [ 11%]
........................................................................ [ 25%]                                                                                                                                                                    
...............................                                          [ 31%]                                                                                                                                                                    
test_aio.py ............................................................ [ 43%]
................................................................         [ 56%]                                                                                                                                                                    
test_atmosphere.py ..                                                    [ 56%]
test_bands.py ................                                           [ 59%]
test_building.py .........                                               [ 61%]
test_cepstrum.py ..                                                      [ 61%]
test_criterion.py ...................                                    [ 65%]
test_decibel.py ......                                                   [ 66%]
test_descriptors.py ..........                                           [ 68%]
test_directivity.py .....                                                [ 69%]
test_generator.py ..............................                         [ 75%]
test_imaging.py .....                                                    [ 76%]
test_octave.py ..                                                        [ 77%]
test_power.py ...                                                        [ 77%]
test_room.py .............................                               [ 83%]
test_signal.py ...................................................       [ 93%]
test_utils.py ..............                                             [ 96%]
test_weighting.py ......                                                 [ 97%]
standards/test_iec_61672_1_2013.py ..........                            [ 99%]
standards/test_iso_1996_2_2007.py F                                      [ 99%]
standards/test_iso_tr_25417_2007.py .                                    [100%]

=================================== FAILURES ===================================
________________________________ test_tonality _________________________________

    def test_tonality():
    
        duration = 60.0
        fs = 10025.0
        samples = int(fs * duration)
        times = np.arange(samples) / fs
    
        signal = Signal(np.sin(2.0 * np.pi * 1000.0 * times), fs)
    
        tonality = Tonality(signal, signal.fs)
    
        # Test methods before analysis
        tonality.spectrum
        tonality.plot_spectrum()
    
        tonality.frequency_resolution
        tonality.effective_analysis_bandwidth
    
        # No values yet, cannot print overview.
        with pytest.raises(ValueError):
            print(tonality.overview())
        tonality.results_as_dataframe()
    
        assert len(list(tonality.noise_pauses)) == 0
        assert len(list(tonality.tones)) == 0
        assert len(list(tonality.critical_bands)) == 0
    
        # Perform analysis
>       tonality.determine_noise_pauses().analyse()

standards/test_iso_1996_2_2007.py:36:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
/nix/store/ndi5w75n7cvgfchh5y1icykk6jhvhnkq-python3.7-acoustics-0.2.3/lib/python3.7/site-packages/acoustics/standards/iso_1996_2_2007.py:321: in analyse
    self._determine_tones()
/nix/store/ndi5w75n7cvgfchh5y1icykk6jhvhnkq-python3.7-acoustics-0.2.3/lib/python3.7/site-packages/acoustics/standards/iso_1996_2_2007.py:295: in _determine_tones
    self.force_bandwidth_criterion,
/nix/store/ndi5w75n7cvgfchh5y1icykk6jhvhnkq-python3.7-acoustics-0.2.3/lib/python3.7/site-packages/acoustics/standards/iso_1996_2_2007.py:658: in determine_tone_lines
    indices_3db = np.nonzero(levels.iloc[npr] >= levels.iloc[npr].max() - TONE_BANDWIDTH_CRITERION_DB)[0]
<__array_function__ internals>:6: in nonzero
    ???
/nix/store/mg6agzzf88rxhsc5j3lhgv68sdwvc4hd-python3.7-numpy-1.18.1/lib/python3.7/site-packages/numpy/core/fromnumeric.py:1896: in nonzero
    return _wrapfunc(a, 'nonzero')
/nix/store/mg6agzzf88rxhsc5j3lhgv68sdwvc4hd-python3.7-numpy-1.18.1/lib/python3.7/site-packages/numpy/core/fromnumeric.py:58: in _wrapfunc
    return _wrapit(obj, method, *args, **kwds)
/nix/store/mg6agzzf88rxhsc5j3lhgv68sdwvc4hd-python3.7-numpy-1.18.1/lib/python3.7/site-packages/numpy/core/fromnumeric.py:51: in _wrapit
    result = wrap(result)
/nix/store/sdvrxnwmjbs14p27racmgidjkwg5ypw3-python3.7-pandas-1.0.1/lib/python3.7/site-packages/pandas/core/generic.py:1918: in __array_wrap__
    return self._constructor(result, **d).__finalize__(self)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

self = <[AttributeError("'Series' object has no attribute '_name'") raised in repr()] Series object at 0x7fffe072d850>
data = array([[1, 2]])
index = Float64Index([4.0, 5.0, 6.0, 7.0], dtype='float64'), dtype = None
name = None, copy = False, fastpath = False

    def __init__(
        self, data=None, index=None, dtype=None, name=None, copy=False, fastpath=False
    ):
    
        # we are called internally, so short-circuit
        if fastpath:
    
            # data is an ndarray, index is defined
            if not isinstance(data, SingleBlockManager):
                data = SingleBlockManager(data, index, fastpath=True)
            if copy:
                data = data.copy()
            if index is None:
                index = data.index
    
        else:
    
            name = ibase.maybe_extract_name(name, data, type(self))
    
            if is_empty_data(data) and dtype is None:
                # gh-17261
                warnings.warn(
                    "The default dtype for empty Series will be 'object' instead "
                    "of 'float64' in a future version. Specify a dtype explicitly "
                    "to silence this warning.",
                    DeprecationWarning,
                    stacklevel=2,
                )
                # uncomment the line below when removing the DeprecationWarning
                # dtype = np.dtype(object)
    
            if index is not None:
                index = ensure_index(index)
    
            if data is None:
                data = {}
            if dtype is not None:
                dtype = self._validate_dtype(dtype)
    
            if isinstance(data, MultiIndex):
                raise NotImplementedError(
                    "initializing a Series from a MultiIndex is not supported"
                )
            elif isinstance(data, Index):
    
                if dtype is not None:
                    # astype copies
                    data = data.astype(dtype)
                else:
                    # need to copy to avoid aliasing issues
                    data = data._values.copy()
                    if isinstance(data, ABCDatetimeIndex) and data.tz is not None:
                        # GH#24096 need copy to be deep for datetime64tz case
                        # TODO: See if we can avoid these copies
                        data = data._values.copy(deep=True)
                copy = False
    
            elif isinstance(data, np.ndarray):
                if len(data.dtype):
                    # GH#13296 we are dealing with a compound dtype, which
                    #  should be treated as 2D
                    raise ValueError(
                        "Cannot construct a Series from an ndarray with "
                        "compound dtype.  Use DataFrame instead."
                    )
                pass
            elif isinstance(data, ABCSeries):
                if index is None:
                    index = data.index
                else:
                    data = data.reindex(index, copy=copy)
                data = data._data
            elif is_dict_like(data):
                data, index = self._init_dict(data, index, dtype)
                dtype = None
                copy = False
            elif isinstance(data, SingleBlockManager):
                if index is None:
                    index = data.index
                elif not data.index.equals(index) or copy:
                    # GH#19275 SingleBlockManager input should only be called
                    # internally
                    raise AssertionError(
                        "Cannot pass both SingleBlockManager "
                        "`data` argument and a different "
                        "`index` argument. `copy` must be False."
                    )
    
            elif is_extension_array_dtype(data):
                pass
            elif isinstance(data, (set, frozenset)):
                raise TypeError(f"'{type(data).__name__}' type is unordered")
            elif isinstance(data, ABCSparseArray):
                # handle sparse passed here (and force conversion)
                data = data.to_dense()
            else:
                data = com.maybe_iterable_to_list(data)
    
            if index is None:
                if not is_list_like(data):
                    data = [data]
                index = ibase.default_index(len(data))
            elif is_list_like(data):
    
                # a scalar numpy array is list-like but doesn't
                # have a proper length
                try:
                    if len(index) != len(data):
                        raise ValueError(
>                           f"Length of passed values is {len(data)}, "
                            f"index implies {len(index)}."
                        )
E                       ValueError: Length of passed values is 1, index implies 4.

/nix/store/sdvrxnwmjbs14p27racmgidjkwg5ypw3-python3.7-pandas-1.0.1/lib/python3.7/site-packages/pandas/core/series.py:292: ValueError
=============================== warnings summary ===============================
standards/test_iec_61672_1_2013.py:30
  /build/acoustics-0.2.3/tests/standards/test_iec_61672_1_2013.py:30: DeprecationWarning: invalid escape sequence \c
    """

-- Docs: https://docs.pytest.org/en/latest/warnings.html
================== 1 failed, 503 passed, 1 warning in 17.45s ===================
builder for '/nix/store/10sbf7k08xjbq84jc2qvymly3gvs1q1s-python3.7-acoustics-0.2.3.drv' failed with exit code 1
error: build of '/nix/store/10sbf7k08xjbq84jc2qvymly3gvs1q1s-python3.7-acoustics-0.2.3.drv' failed

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions