meta00 / vital_sqi

A package for physiological signal quality control
MIT License
30 stars 11 forks source link

Fixed issue with pandas. pandas.DataFrame.append is deprecated #101

Closed tiagofrepereira2012 closed 1 year ago

tiagofrepereira2012 commented 1 year ago

The following tests are falling because of the usage of a deprecated pandas method

FAILED tests/pipeline/test_pipeline_highlevel.py::TestGetPPGSQIs::test_on_get_ppg_sqis - AttributeError: 'DataFrame' object has no attribute 'append'. Did you mean: '_append'?
FAILED tests/pipeline/test_pipeline_highlevel.py::TestGetQualifiedPPG::test_on_get_qualified_ppg - AttributeError: 'DataFrame' object has no attribute 'append'. Did you mean: '_append'?
FAILED tests/pipeline/test_pipeline_highlevel.py::TestGetECGSQIs::test_on_get_ecg_sqis - AttributeError: 'DataFrame' object has no attribute 'append'. Did you mean: '_append'?
FAILED tests/pipeline/test_pipeline_highlevel.py::TestGetQualifiedSQIs::test_on_get_qualified_ecg - AttributeError: 'DataFrame' object has no attribute 'append'. Did you mean: '_append'?

The thing is that pandas.DataFrame.append used here https://github.com/meta00/vital_sqi/blob/main/vital_sqi/pipeline/pipeline_functions.py#L476 was deprecated a long time ago. Check here https://github.com/pandas-dev/pandas/issues/35407 and here https://github.com/pandas-dev/pandas/pull/44539

pandas.DataFrame.concat should be used instead.

ping @Koaha

thanks

closes #100

tiagofrepereira2012 commented 1 year ago

This PR also fixes #101

Basically, the keyword argument block_size from pyedflib.highlevel.write_edf was removed since version 0.1.31 https://github.com/holgern/pyedflib/blob/v0.1.31/pyedflib/highlevel.py#L397 of the package pyEDFlib via this commit (https://github.com/holgern/pyedflib/commit/14857b7ee990e41f02dbe4e12989d6cb6b324b06)

I fixed the issue an also pinned the lib to the version to >=0.1.31