From 5b66de5a023a131ef368e905d95b521d28357639 Mon Sep 17 00:00:00 2001 From: jmoo2880 Date: Wed, 4 Sep 2024 11:18:35 +1000 Subject: [PATCH 1/5] Update first min ACF and first 1/e crossing ACF long names. --- src/pycatch22/catch22.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pycatch22/catch22.py b/src/pycatch22/catch22.py index 5eaa932..89d68dc 100644 --- a/src/pycatch22/catch22.py +++ b/src/pycatch22/catch22.py @@ -18,8 +18,8 @@ def catch22_all(data, catch24=False, short_names=False): features = [ 'DN_HistogramMode_5', 'DN_HistogramMode_10', - 'CO_f1ecac', - 'CO_FirstMin_ac', + 'first1e_acf_tau', + 'firstMin_acf', 'CO_HistogramAMI_even_2_5', 'CO_trev_1_num', 'MD_hrv_classic_pnn40', From 68cf268b8e01f88c9c6212d927b1207bcfed20d5 Mon Sep 17 00:00:00 2001 From: jmoo2880 Date: Wed, 4 Sep 2024 12:05:42 +1000 Subject: [PATCH 2/5] Map old function names to new long feature names. --- src/pycatch22/catch22.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/pycatch22/catch22.py b/src/pycatch22/catch22.py index 89d68dc..ceb98c7 100644 --- a/src/pycatch22/catch22.py +++ b/src/pycatch22/catch22.py @@ -14,12 +14,17 @@ def catch22_all(data, catch24=False, short_names=False): If True, also include the short names of the features in the output. ''' + + name_mapping = { + 'CO_f1ecac' : 'first1e_acf_tau', + 'CO_FirstMin_ac' : 'firstMin_acf' + } features = [ 'DN_HistogramMode_5', 'DN_HistogramMode_10', - 'first1e_acf_tau', - 'firstMin_acf', + 'CO_f1ecac', + 'CO_FirstMin_ac', 'CO_HistogramAMI_even_2_5', 'CO_trev_1_num', 'MD_hrv_classic_pnn40', @@ -77,6 +82,8 @@ def catch22_all(data, catch24=False, short_names=False): featureFun = getattr(catch22_C, f) featureOut.append(featureFun(data)) + features = [name_mapping.get(s, s) for s in features] + if short_names: return {'names': features, 'short_names': features_short, 'values': featureOut} else: From 3c0ace7a46905c7b39fcf6da327111fa396b8c08 Mon Sep 17 00:00:00 2001 From: jmoo2880 Date: Wed, 4 Sep 2024 12:42:28 +1000 Subject: [PATCH 3/5] update unit tests to expect new long feature names --- src/pycatch22/catch22.py | 5 +++-- tests/benchmarks/expected_outputs/test2_output.txt | 4 ++-- tests/benchmarks/expected_outputs/testInfMinus_output.txt | 4 ++-- tests/benchmarks/expected_outputs/testInf_output.txt | 4 ++-- tests/benchmarks/expected_outputs/testNaN_output.txt | 4 ++-- tests/benchmarks/expected_outputs/testShort_output.txt | 4 ++-- tests/benchmarks/expected_outputs/testSinusoid_output.txt | 4 ++-- tests/benchmarks/expected_outputs/test_output.txt | 4 ++-- 8 files changed, 17 insertions(+), 16 deletions(-) diff --git a/src/pycatch22/catch22.py b/src/pycatch22/catch22.py index ceb98c7..d1099fa 100644 --- a/src/pycatch22/catch22.py +++ b/src/pycatch22/catch22.py @@ -14,7 +14,8 @@ def catch22_all(data, catch24=False, short_names=False): If True, also include the short names of the features in the output. ''' - + + # map the old function names to the new long feature names name_mapping = { 'CO_f1ecac' : 'first1e_acf_tau', 'CO_FirstMin_ac' : 'firstMin_acf' @@ -83,7 +84,7 @@ def catch22_all(data, catch24=False, short_names=False): featureOut.append(featureFun(data)) features = [name_mapping.get(s, s) for s in features] - + if short_names: return {'names': features, 'short_names': features_short, 'values': featureOut} else: diff --git a/tests/benchmarks/expected_outputs/test2_output.txt b/tests/benchmarks/expected_outputs/test2_output.txt index fb252c0..2dd5bf4 100644 --- a/tests/benchmarks/expected_outputs/test2_output.txt +++ b/tests/benchmarks/expected_outputs/test2_output.txt @@ -1,7 +1,7 @@ DN_HistogramMode_5, -0.6147991148452683 DN_HistogramMode_10, -0.7822544655522088 -CO_f1ecac, 32.502605476936466 -CO_FirstMin_ac, 77 +first1e_acf_tau, 32.502605476936466 +firstMin_acf, 77 CO_HistogramAMI_even_2_5, 1.0063890779937608 CO_trev_1_num, 1.782472611547055e-05 MD_hrv_classic_pnn40, 0.31970260223048325 diff --git a/tests/benchmarks/expected_outputs/testInfMinus_output.txt b/tests/benchmarks/expected_outputs/testInfMinus_output.txt index 448f693..e5369ed 100644 --- a/tests/benchmarks/expected_outputs/testInfMinus_output.txt +++ b/tests/benchmarks/expected_outputs/testInfMinus_output.txt @@ -1,7 +1,7 @@ DN_HistogramMode_5, nan DN_HistogramMode_10, nan -CO_f1ecac, 0.0 -CO_FirstMin_ac, 0 +first1e_acf_tau, 0.0 +firstMin_acf, 0 CO_HistogramAMI_even_2_5, nan CO_trev_1_num, nan MD_hrv_classic_pnn40, nan diff --git a/tests/benchmarks/expected_outputs/testInf_output.txt b/tests/benchmarks/expected_outputs/testInf_output.txt index c865081..2eecb39 100644 --- a/tests/benchmarks/expected_outputs/testInf_output.txt +++ b/tests/benchmarks/expected_outputs/testInf_output.txt @@ -1,7 +1,7 @@ DN_HistogramMode_5, nan DN_HistogramMode_10, nan -CO_f1ecac, 0.0 -CO_FirstMin_ac, 0 +first1e_acf_tau, 0.0 +firstMin_acf, 0 CO_HistogramAMI_even_2_5, nan CO_trev_1_num, nan MD_hrv_classic_pnn40, nan diff --git a/tests/benchmarks/expected_outputs/testNaN_output.txt b/tests/benchmarks/expected_outputs/testNaN_output.txt index 1f128b2..53423f9 100644 --- a/tests/benchmarks/expected_outputs/testNaN_output.txt +++ b/tests/benchmarks/expected_outputs/testNaN_output.txt @@ -1,7 +1,7 @@ DN_HistogramMode_5, nan DN_HistogramMode_10, nan -CO_f1ecac, 0.0 -CO_FirstMin_ac, 0 +first1e_acf_tau, 0.0 +firstMin_acf, 0 CO_HistogramAMI_even_2_5, nan CO_trev_1_num, nan MD_hrv_classic_pnn40, nan diff --git a/tests/benchmarks/expected_outputs/testShort_output.txt b/tests/benchmarks/expected_outputs/testShort_output.txt index 9fec566..3100020 100644 --- a/tests/benchmarks/expected_outputs/testShort_output.txt +++ b/tests/benchmarks/expected_outputs/testShort_output.txt @@ -1,7 +1,7 @@ DN_HistogramMode_5, 0.022699494958050126 DN_HistogramMode_10, 0.022699494958050237 -CO_f1ecac, 2.675241846131576 -CO_FirstMin_ac, 8 +first1e_acf_tau, 2.675241846131576 +firstMin_acf, 8 CO_HistogramAMI_even_2_5, 1.366158847569202 CO_trev_1_num, 0.019643781964449922 MD_hrv_classic_pnn40, 1.0 diff --git a/tests/benchmarks/expected_outputs/testSinusoid_output.txt b/tests/benchmarks/expected_outputs/testSinusoid_output.txt index 27ad34b..2d4526e 100644 --- a/tests/benchmarks/expected_outputs/testSinusoid_output.txt +++ b/tests/benchmarks/expected_outputs/testSinusoid_output.txt @@ -1,7 +1,7 @@ DN_HistogramMode_5, 1.272928076609852 DN_HistogramMode_10, -1.1275857573774708 -CO_f1ecac, 119.7407960033787 -CO_FirstMin_ac, 2 +first1e_acf_tau, 119.7407960033787 +firstMin_acf, 2 CO_HistogramAMI_even_2_5, 1.0794999556793812 CO_trev_1_num, -0.00017509308632170917 MD_hrv_classic_pnn40, 0.822 diff --git a/tests/benchmarks/expected_outputs/test_output.txt b/tests/benchmarks/expected_outputs/test_output.txt index fb252c0..2dd5bf4 100644 --- a/tests/benchmarks/expected_outputs/test_output.txt +++ b/tests/benchmarks/expected_outputs/test_output.txt @@ -1,7 +1,7 @@ DN_HistogramMode_5, -0.6147991148452683 DN_HistogramMode_10, -0.7822544655522088 -CO_f1ecac, 32.502605476936466 -CO_FirstMin_ac, 77 +first1e_acf_tau, 32.502605476936466 +firstMin_acf, 77 CO_HistogramAMI_even_2_5, 1.0063890779937608 CO_trev_1_num, 1.782472611547055e-05 MD_hrv_classic_pnn40, 0.31970260223048325 From 3fc3710a654196ab9fc2cea0fecbaa3d1bfbbc41 Mon Sep 17 00:00:00 2001 From: jmoo2880 Date: Wed, 4 Sep 2024 12:57:11 +1000 Subject: [PATCH 4/5] Bump version number for patch. --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index de9cddb..755e91b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "pycatch22" -version = "0.4.5" +version = "0.4.6" authors = [ {name = "Carl H Lubba"}, {email = "carl.lubba@gmx.de"}, From 6a5b6015f46fa6bfdad58c2fc56ed7884368fd99 Mon Sep 17 00:00:00 2001 From: jmoo2880 Date: Wed, 4 Sep 2024 12:58:47 +1000 Subject: [PATCH 5/5] Update CO_f1ecac feature name in README. --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 077131d..c17c7fb 100644 --- a/README.md +++ b/README.md @@ -90,7 +90,7 @@ Thanks to [@jmoo2880](https://github.com/jmoo2880) for putting together a [demon ### Usage notes -- When presenting results using _catch22_, you must identify the version used to allow clear reproduction of your results. For example, `CO_f1ecac` was altered from an integer-valued output to a linearly interpolated real-valued output from v0.3. +- When presenting results using _catch22_, you must identify the version used to allow clear reproduction of your results. For example, `first1e_acf_tau` was altered from an integer-valued output to a linearly interpolated real-valued output from v0.3. - __Important Note:__ _catch22_ features only evaluate _dynamical_ properties of time series and do not respond to basic differences in the location (e.g., mean) or spread (e.g., variance). - From _catch22_ v0.3, If the location and spread of the raw time-series distribution may be important for your application, we suggest applying the function argument `catch24 = True` to your call to the _catch22_ function in the language of your choice. This will result in 24 features being calculated: the _catch22_ features in addition to mean and standard deviation.