neurogeriatricskiel / KielMAT

Python based toolbox for processing motion data
https://neurogeriatricskiel.github.io/KielMAT/
Other
6 stars 1 forks source link

Tests fail #43

Closed JuliusWelzel closed 8 months ago

JuliusWelzel commented 8 months ago

@masoudabedinifar After the merge from your reorganization, the tests fail:

Run poetry run pytest ngmt/test/test_calc.py --cov=ngmt --cov-report=xml
============================= test session starts =============================
platform win[32](https://github.com/neurogeriatricskiel/NGMT/actions/runs/7789548254/job/21241412135#step:5:33) -- Python 3.10.11, pytest-7.4.3, pluggy-1.3.0
rootdir: D:\a\NGMT\NGMT
plugins: cov-4.1.0
collected 64 items

ngmt\test\test_calc.py ................................................. [ 76%]
..........F....                                                          [100%]

================================== FAILURES ===================================
_________________ test_classify_physical_activity_valid_data __________________

self = Index(['acc'], dtype='object'), key = 'enmo'

    def get_loc(self, key):
        """
        Get integer location, slice or boolean mask for requested label.

        Parameters
        ----------
        key : label

        Returns
        -------
        int if unique index, slice if monotonic index, else mask

        Examples
        --------
        >>> unique_index = pd.Index(list('abc'))
        >>> unique_index.get_loc('b')
        1

        >>> monotonic_index = pd.Index(list('abbc'))
        >>> monotonic_index.get_loc('b')
        slice(1, 3, None)

        >>> non_monotonic_index = pd.Index(list('abcb'))
        >>> non_monotonic_index.get_loc('b')
        array([False,  True, False,  True])
        """
        casted_key = self._maybe_cast_indexer(key)
        try:
>           return self._engine.get_loc(casted_key)

.venv\lib\site-packages\pandas\core\indexes\base.py:[37](https://github.com/neurogeriatricskiel/NGMT/actions/runs/7789548254/job/21241412135#step:5:38)90: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
index.pyx:1[52](https://github.com/neurogeriatricskiel/NGMT/actions/runs/7789548254/job/21241412135#step:5:53): in pandas._libs.index.IndexEngine.get_loc
    ???
index.pyx:181: in pandas._libs.index.IndexEngine.get_loc
    ???
pandas\_libs\hashtable_class_helper.pxi:[70](https://github.com/neurogeriatricskiel/NGMT/actions/runs/7789548254/job/21241412135#step:5:71)80: in pandas._libs.hashtable.PyObjectHashTable.get_item
    ???
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

>   ???
E   KeyError: 'enmo'

Please check.

masoudabedinifar commented 8 months ago

@JuliusWelzel I handled this issue with the commit: 425d635e8f5d6a0a1e2fe17d82f8cdb094245979

JuliusWelzel commented 8 months ago

Testing seems to work, just the coverage dropped: image

JuliusWelzel commented 8 months ago

Hi, i added some example for a GSD module in https://github.com/neurogeriatricskiel/NGMT/commit/f6a919100e7a9d7319a4af77592a78bd6949bb69. Please check if if works, adapt to your tests!

JuliusWelzel commented 8 months ago

@masoudabedinifar Some modules produce a plot when running the test scripts. Please adapt them, so no plots are produced. The GH runners seem to run into problems with that

masoudabedinifar commented 8 months ago

Hi, plots were removed with this: a6c7727432aefa619c5863f2ef52f9a89ea4a5b2