Repository: aeye-lab/pymovements
Pull request #966 (2025-02-24 10:32:19)

docs: improve datasets error message
`gaze_resources` is an artifcat from a previous implementation.

codecov[bot]: ## [Codecov](https://app.codecov.io/gh/aeye-lab/pymovements/pull/966?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 [(`9073c28`)](https://app.codecov.io/gh/aeye-lab/pymovements/commit/9073c2814152e86ffa9622476d967c54f5352381?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aeye-lab) to head [(`120e20a`)](https://app.codecov.io/gh/aeye-lab/pymovements/commit/120e20ac7ff60b20d4f423b3b7c7f30d35b28d55?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     #966      +/-   ##
===========================================
- Coverage   100.00%   99.94%   -0.06%     
===========================================
  Files           74       74              
  Lines         3462     3462              
  Branches       622      622              
===========================================
- Hits          3462     3460       -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/966?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).


Patch:
diff --git a/src/pymovements/dataset/dataset_download.py b/src/pymovements/dataset/dataset_download.py
index 922c246..ccf24c8 100644
--- a/src/pymovements/dataset/dataset_download.py
+++ b/src/pymovements/dataset/dataset_download.py
@@ -75,7 +75,7 @@ def download_dataset(
             raise AttributeError('number of mirrors must not be zero to download dataset')
 
         if len(definition.resources['gaze']) == 0:
-            raise AttributeError('number of gaze_resources must not be zero to download dataset')
+            raise AttributeError('number of `gaze` resources must not be zero to download dataset')
 
         paths.raw.mkdir(parents=True, exist_ok=True)
 
@@ -119,7 +119,7 @@ def download_dataset(
 
         if len(definition.resources['precomputed_events']) == 0:
             raise AttributeError(
-                'number of precomputed_event_resources must not be zero to download dataset',
+                'number of `precomputed_events` resources must not be zero to download dataset',
             )
 
         paths.precomputed_events.mkdir(parents=True, exist_ok=True)
@@ -160,12 +160,13 @@ def download_dataset(
     if definition.has_files['precomputed_reading_measures']:
         if len(definition.mirrors['precomputed_reading_measures']) == 0:
             raise AttributeError(
-                'number of precomputed mirrors must not be zero to download dataset',
+                'number of `precomputed_reading_measures` mirrors must in datasets definition'
+                'not be zero to download dataset',
             )
 
         if len(definition.resources['precomputed_reading_measures']) == 0:
             raise AttributeError(
-                'number of precomputed_reading_measures resources '
+                'number of `precomputed_reading_measures` resources in datasets definition'
                 'must not be zero to download dataset',
             )
 


Test patch:
diff --git a/tests/unit/dataset/dataset_download_test.py b/tests/unit/dataset/dataset_download_test.py
index 7becde9..ca86349 100644
--- a/tests/unit/dataset/dataset_download_test.py
+++ b/tests/unit/dataset/dataset_download_test.py
@@ -1152,7 +1152,7 @@ def test_dataset_download_no_precomputed_event_resources_raises_exception(tmp_pa
 
     msg, = excinfo.value.args
 
-    expected_substrings = ['number', 'precomputed_event_resources', 'zero', 'download']
+    expected_substrings = ['number', '`precomputed_events` resources', 'zero', 'download']
     for substring in expected_substrings:
         assert substring in msg
 
@@ -1286,6 +1286,6 @@ def test_dataset_download_no_precomputed_rm_resources_raises_exception(tmp_path)
 
     msg, = excinfo.value.args
 
-    expected_substrings = ['number', 'precomputed_reading_measures resources', 'zero', 'download']
+    expected_substrings = ['number', '`precomputed_reading_measures` resources', 'zero', 'download']
     for substring in expected_substrings:
         assert substring in msg