mad-lab-fau / gaitmap

The Gait and Movement Analysis Package
https://gaitmap.readthedocs.io
Other
38 stars 2 forks source link

Tests fail on windows #33

Closed MalteOlle closed 1 year ago

MalteOlle commented 1 year ago

Steps to reproduce:

Result:

FAILED tests/test_data_transforms/test_feature_transformer.py::TestResample::test_resample_roi_list - AssertionError: Attributes of DataFrame.iloc[:, 0] (column name="start") are different
FAILED tests/test_evaluation_utlis/test_parameter_errors.py::TestCalculateAggregatedParameterErrors::test_doctest - assert 3 == 0
FAILED tests/test_zupt_detection/test_moving_window_zupt_detector.py::TestNormZuptDetector::test_single_window_fit[NormZuptDetector] - AssertionError: Attributes of DataFrame.iloc[:, 0] (column name="start") are different
FAILED tests/test_zupt_detection/test_moving_window_zupt_detector.py::TestNormZuptDetector::test_single_window_fit[AredZuptDetector] - AssertionError: Attributes of DataFrame.iloc[:, 0] (column name="start") are different
FAILED tests/test_zupt_detection/test_moving_window_zupt_detector.py::TestNormZuptDetector::test_max_overlap_metric_max_w4_default_overlap[NormZuptDetector] - AssertionError: Attributes of DataFrame.iloc[:, 0] (column name="start") are different
FAILED tests/test_zupt_detection/test_moving_window_zupt_detector.py::TestNormZuptDetector::test_max_overlap_metric_max_w4_default_overlap[AredZuptDetector] - AssertionError: Attributes of DataFrame.iloc[:, 0] (column name="start") are different
FAILED tests/test_zupt_detection/test_moving_window_zupt_detector.py::TestNormZuptDetector::test_max_overlap_metric_max_w3[NormZuptDetector] - AssertionError: Attributes of DataFrame.iloc[:, 0] (column name="start") are different
FAILED tests/test_zupt_detection/test_moving_window_zupt_detector.py::TestNormZuptDetector::test_max_overlap_metric_max_w3[AredZuptDetector] - AssertionError: Attributes of DataFrame.iloc[:, 0] (column name="start") are different
FAILED tests/test_zupt_detection/test_moving_window_zupt_detector.py::TestNormZuptDetector::test_max_overlap_metric_max_w6_default_overlap[NormZuptDetector] - AssertionError: Attributes of DataFrame.iloc[:, 0] (column name="start") are different
FAILED tests/test_zupt_detection/test_moving_window_zupt_detector.py::TestNormZuptDetector::test_max_overlap_metric_max_w6_default_overlap[AredZuptDetector] - AssertionError: Attributes of DataFrame.iloc[:, 0] (column name="start") are different
FAILED tests/test_zupt_detection/test_moving_window_zupt_detector.py::TestNormZuptDetector::test_real_data_regression[NormZuptDetector] - AssertionError: Attributes of DataFrame.iloc[:, 0] (column name="start") are different
FAILED tests/test_zupt_detection/test_moving_window_zupt_detector.py::TestNormZuptDetector::test_real_data_regression[AredZuptDetector] - AssertionError: Attributes of DataFrame.iloc[:, 0] (column name="start") are different
FAILED tests/test_zupt_detection/test_moving_window_zupt_detector.py::TestShoeZuptDetector::test_real_data_regression - AssertionError: Attributes of DataFrame.iloc[:, 0] (column name="start") are different
FAILED tests/test_zupt_detection/test_stride_event_zupt_detector.py::TestStrideEventZuptDetector::test_region_0 - AssertionError: Attributes of DataFrame.iloc[:, 0] (column name="start") are different
FAILED tests/test_zupt_detection/test_stride_event_zupt_detector.py::TestStrideEventZuptDetector::test_edge_case - AssertionError: Attributes of DataFrame.iloc[:, 0] (column name="start") are different
FAILED tests/test_zupt_detection/test_stride_event_zupt_detector.py::TestStrideEventZuptDetector::test_with_overlap - AssertionError: Attributes of DataFrame.iloc[:, 0] (column name="start") are different
FAILED tests/test_zupt_detection/test_stride_event_zupt_detector.py::TestStrideEventZuptDetector::test_simple - AssertionError: Attributes of DataFrame.iloc[:, 0] (column name="start") are different
===================================================================== 17 failed, 2077 passed, 41 skipped, 157 warnings in 577.91s (0:09:37) ======================================================================
AKuederle commented 1 year ago

All the tests are unrelated to pomegrante. Strange... these tests are pretty simple. Nothing that should depend on the operating system

AKuederle commented 1 year ago

@MalteOlle Which Python version are you on?

AKuederle commented 1 year ago

Seems to be reproducible: https://github.com/mad-lab-fau/gaitmap/actions/runs/5177786883/jobs/9328332843

AKuederle commented 1 year ago

Aah but luckily an easy fix. It has something todo that the default dtype for ints under windows is different. I will try to set the dtype explicit in thee cases. So you can ignore the failures for now.

AKuederle commented 1 year ago

Fixed! Took some more work than expected, but should work now. Note that I updated to Pandas >2.0 in the process. You might need to run poetry install again if you want to test the new changes.

I also created a follow-up issue #35, as during fixing that, I realised that we had at least one bug related to "unsafe" type casting from float to int and we should be more explicit about that by not allowing float dtypes in objsects that we expect to be ints. We should force users to perform explicit typecasting.