Repository: aeye-lab/pymovements
Pull request #1153 (2025-05-14 16:18:54)

chore: set `DatasetDefinition.time_unit` default to `None`
## Description

if the time unit is `None` the `Gaze` constructor will set it automatically anyway.

codecov[bot]: ## [Codecov](https://app.codecov.io/gh/aeye-lab/pymovements/pull/1153?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aeye-lab) Report
All modified and coverable lines are covered by tests :white_check_mark:
> Project coverage is 99.94%. Comparing base [(`362c4f8`)](https://app.codecov.io/gh/aeye-lab/pymovements/commit/362c4f854b05d75ae8142b8e0ded65d6e898595f?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aeye-lab) to head [(`d1b966d`)](https://app.codecov.io/gh/aeye-lab/pymovements/commit/d1b966d3dbcb7c9347a3073d70f55954496cf03c?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aeye-lab).

<details><summary>Additional details and impacted files</summary>


```diff
@@             Coverage Diff             @@
##              main    #1153      +/-   ##
===========================================
- Coverage   100.00%   99.94%   -0.06%     
===========================================
  Files           90       90              
  Lines         3985     3985              
  Branches       708      708              
===========================================
- Hits          3985     3983       -2     
- Misses           0        1       +1     
- Partials         0        1       +1     
```

</details>

[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/aeye-lab/pymovements/pull/1153?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aeye-lab).   
:loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aeye-lab).

<details><summary> :rocket: New features to boost your workflow: </summary>

- :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
</details>

Patch:
diff --git a/src/pymovements/dataset/dataset_definition.py b/src/pymovements/dataset/dataset_definition.py
index ef0bd56..23ce992 100644
--- a/src/pymovements/dataset/dataset_definition.py
+++ b/src/pymovements/dataset/dataset_definition.py
@@ -169,7 +169,7 @@ class DatasetDefinition:
 
     trial_columns: list[str] | None = None
     time_column: str | None = None
-    time_unit: str | None = 'ms'
+    time_unit: str | None = None
     pixel_columns: list[str] | None = None
     position_columns: list[str] | None = None
     velocity_columns: list[str] | None = None


Test patch:
diff --git a/tests/unit/dataset/dataset_definition_test.py b/tests/unit/dataset/dataset_definition_test.py
index 9f2400f..ed35950 100644
--- a/tests/unit/dataset/dataset_definition_test.py
+++ b/tests/unit/dataset/dataset_definition_test.py
@@ -100,7 +100,7 @@ def test_dataset_definition_is_equal(init_kwargs):
                 'position_columns': None,
                 'resources': {},
                 'time_column': None,
-                'time_unit': 'ms',
+                'time_unit': None,
                 'trial_columns': None,
                 'velocity_columns': None,
             },
@@ -164,7 +164,7 @@ def test_dataset_definition_is_equal(init_kwargs):
                 'position_columns': None,
                 'resources': {},
                 'time_column': None,
-                'time_unit': 'ms',
+                'time_unit': None,
                 'trial_columns': None,
                 'velocity_columns': None,
             },
@@ -216,7 +216,7 @@ def test_dataset_definition_to_dict_expected(definition, expected_dict):
                 'position_columns': None,
                 'resources': {},
                 'time_column': None,
-                'time_unit': 'ms',
+                'time_unit': None,
                 'trial_columns': None,
                 'velocity_columns': None,
             },
@@ -261,7 +261,7 @@ def test_dataset_definition_to_dict_expected(definition, expected_dict):
                 'position_columns': None,
                 'resources': {},
                 'time_column': None,
-                'time_unit': 'ms',
+                'time_unit': None,
                 'trial_columns': None,
                 'velocity_columns': None,
             },
@@ -375,7 +375,6 @@ def test_check_equality_of_load_from_yaml_and_load_from_dictionary_dump(tmp_path
             True,
             {
                 'name': '.',
-                'time_unit': 'ms',
             },
             marks=pytest.mark.xfail(reason='#1148'),
             id='true_default',
@@ -386,7 +385,6 @@ def test_check_equality_of_load_from_yaml_and_load_from_dictionary_dump(tmp_path
             True,
             {
                 'name': '.',
-                'time_unit': 'ms',
             },
             id='true_experiment_origin_none',
         ),
@@ -401,7 +399,6 @@ def test_check_equality_of_load_from_yaml_and_load_from_dictionary_dump(tmp_path
             {
                 'name': '.',
                 'extract': {'test': True},
-                'time_unit': 'ms',
                 'position_columns': ['test', 'foo', 'bar'],
                 'distance_column': 'test',
             },
@@ -420,7 +417,6 @@ def test_check_equality_of_load_from_yaml_and_load_from_dictionary_dump(tmp_path
             {
                 'name': '.',
                 'extract': {'test': True},
-                'time_unit': 'ms',
                 'position_columns': ['test', 'foo', 'bar'],
                 'distance_column': 'test',
             },
@@ -444,7 +440,7 @@ def test_check_equality_of_load_from_yaml_and_load_from_dictionary_dump(tmp_path
                 'column_map': {},
                 'trial_columns': None,
                 'time_column': None,
-                'time_unit': 'ms',
+                'time_unit': None,
                 'pixel_columns': None,
                 'position_columns': None,
                 'velocity_columns': None,
@@ -472,7 +468,7 @@ def test_check_equality_of_load_from_yaml_and_load_from_dictionary_dump(tmp_path
                 'column_map': {},
                 'trial_columns': None,
                 'time_column': None,
-                'time_unit': 'ms',
+                'time_unit': None,
                 'pixel_columns': None,
                 'position_columns': None,
                 'velocity_columns': None,
@@ -518,7 +514,7 @@ def test_check_equality_of_load_from_yaml_and_load_from_dictionary_dump(tmp_path
                 'column_map': {},
                 'trial_columns': None,
                 'time_column': None,
-                'time_unit': 'ms',
+                'time_unit': None,
                 'pixel_columns': None,
                 'position_columns': None,
                 'velocity_columns': None,