Repository: aeye-lab/pymovements
Pull request #759 (2024-07-16 12:25:46)

rename resource gaze_resource
first step towards #716 

codecov[bot]: ## [Codecov](https://app.codecov.io/gh/aeye-lab/pymovements/pull/759?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 100.00%. Comparing base [(`7ac6b45`)](https://app.codecov.io/gh/aeye-lab/pymovements/commit/7ac6b452e1a15fa82ec2873db6a539bbec39b23b?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=aeye-lab) to head [(`637ea14`)](https://app.codecov.io/gh/aeye-lab/pymovements/commit/637ea149d18ced9ea2ab03501a02d951d21b3d06?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      #759   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           60        60           
  Lines         2819      2819           
  Branches       758       758           
=========================================
  Hits          2819      2819           
```

</details>

[:umbrella: View full report in Codecov by Sentry](https://app.codecov.io/gh/aeye-lab/pymovements/pull/759?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 db6c6fc..5aea0fb 100644
--- a/src/pymovements/dataset/dataset_download.py
+++ b/src/pymovements/dataset/dataset_download.py
@@ -82,7 +82,7 @@ def download_dataset(
 
         for mirror_idx, mirror in enumerate(definition.mirrors):
 
-            url = f'{mirror}{resource["resource"]}'
+            url = f'{mirror}{resource["gaze_resource"]}'
 
             try:
                 download_file(
@@ -106,7 +106,7 @@ def download_dataset(
 
         if not success:
             raise RuntimeError(
-                f"downloading resource {resource['resource']} failed for all mirrors.",
+                f"downloading resource {resource['gaze_resource']} failed for all mirrors.",
             )
 
     if extract:
diff --git a/src/pymovements/datasets/gaze_graph.py b/src/pymovements/datasets/gaze_graph.py
index b94972f..0705543 100644
--- a/src/pymovements/datasets/gaze_graph.py
+++ b/src/pymovements/datasets/gaze_graph.py
@@ -108,7 +108,7 @@ class GazeGraph(DatasetDefinition):
 
     resources: tuple[dict[str, str], ...] = (
         {
-            'resource': 'master',
+            'gaze_resource': 'master',
             'filename': 'gaze_graph_data.zip',
             'md5': '181f4b79477cee6e0267482d989610b0',
         },
diff --git a/src/pymovements/datasets/gazebase.py b/src/pymovements/datasets/gazebase.py
index ed89f4d..2d0a264 100644
--- a/src/pymovements/datasets/gazebase.py
+++ b/src/pymovements/datasets/gazebase.py
@@ -110,7 +110,7 @@ class GazeBase(DatasetDefinition):
 
     resources: tuple[dict[str, str]] = (
         {
-            'resource': '27039812',
+            'gaze_resource': '27039812',
             'filename': 'GazeBase_v2_0.zip',
             'md5': 'cb7eb895fb48f8661decf038ab998c9a',
         },
diff --git a/src/pymovements/datasets/gazebasevr.py b/src/pymovements/datasets/gazebasevr.py
index d54af21..aa33d28 100644
--- a/src/pymovements/datasets/gazebasevr.py
+++ b/src/pymovements/datasets/gazebasevr.py
@@ -111,7 +111,7 @@ class GazeBaseVR(DatasetDefinition):
 
     resources: tuple[dict[str, str]] = (
         {
-            'resource': '38844024',
+            'gaze_resource': '38844024',
             'filename': 'gazebasevr.zip',
             'md5': '048c04b00fd64347375cc8d37b451a22',
         },
diff --git a/src/pymovements/datasets/hbn.py b/src/pymovements/datasets/hbn.py
index c0cb1ac..0c539b0 100644
--- a/src/pymovements/datasets/hbn.py
+++ b/src/pymovements/datasets/hbn.py
@@ -105,7 +105,7 @@ class HBN(DatasetDefinition):
 
     resources: tuple[dict[str, str], ...] = (
         {
-            'resource': '651190031e76a453918a9971',
+            'gaze_resource': '651190031e76a453918a9971',
             'filename': 'data.zip',
             'md5': '2c523e911022ffc0eab700e34e9f7f30',
         },
diff --git a/src/pymovements/datasets/judo1000.py b/src/pymovements/datasets/judo1000.py
index 0cf706f..6092f88 100644
--- a/src/pymovements/datasets/judo1000.py
+++ b/src/pymovements/datasets/judo1000.py
@@ -104,7 +104,7 @@ class JuDo1000(DatasetDefinition):
 
     resources: tuple[dict[str, str], ...] = (
         {
-            'resource': '4wy7s/',
+            'gaze_resource': '4wy7s/',
             'filename': 'JuDo1000.zip',
             'md5': 'b8b9e5bb65b78d6f2bd260451cdd89f8',
         },
diff --git a/src/pymovements/datasets/potec.py b/src/pymovements/datasets/potec.py
index e1aa8e5..6cf01c2 100644
--- a/src/pymovements/datasets/potec.py
+++ b/src/pymovements/datasets/potec.py
@@ -114,7 +114,7 @@ class PoTeC(DatasetDefinition):
 
     resources: tuple[dict[str, str], ...] = (
         {
-            'resource': 'tgd9q/',
+            'gaze_resource': 'tgd9q/',
             'filename': 'PoTeC.zip',
             'md5': 'cffd45039757c3777e2fd130e5d8a2ad',
         },
diff --git a/src/pymovements/datasets/sb_sat.py b/src/pymovements/datasets/sb_sat.py
index e19dbbd..bdc284d 100644
--- a/src/pymovements/datasets/sb_sat.py
+++ b/src/pymovements/datasets/sb_sat.py
@@ -104,7 +104,7 @@ class SBSAT(DatasetDefinition):
 
     resources: tuple[dict[str, str], ...] = (
         {
-            'resource': 'jgae7/',
+            'gaze_resource': 'jgae7/',
             'filename': 'sbsat_csvs.zip',
             'md5': 'a6ef1fb0ecced683cdb489c3bd3e1a5c',
         },
diff --git a/src/pymovements/datasets/toy_dataset.py b/src/pymovements/datasets/toy_dataset.py
index 297d44f..37dd5cf 100644
--- a/src/pymovements/datasets/toy_dataset.py
+++ b/src/pymovements/datasets/toy_dataset.py
@@ -102,7 +102,7 @@ class ToyDataset(DatasetDefinition):
 
     resources: tuple[dict[str, str], ...] = (
         {
-            'resource': '6cb5d663317bf418cec0c9abe1dde5085a8a8ebd/',
+            'gaze_resource': '6cb5d663317bf418cec0c9abe1dde5085a8a8ebd/',
             'filename': 'pymovements-toy-dataset.zip',
             'md5': '4da622457637a8181d86601fe17f3aa8',
         },
diff --git a/src/pymovements/datasets/toy_dataset_eyelink.py b/src/pymovements/datasets/toy_dataset_eyelink.py
index 71d8fbf..94f1a8e 100644
--- a/src/pymovements/datasets/toy_dataset_eyelink.py
+++ b/src/pymovements/datasets/toy_dataset_eyelink.py
@@ -103,7 +103,7 @@ class ToyDatasetEyeLink(DatasetDefinition):
 
     resources: tuple[dict[str, str], ...] = (
         {
-            'resource': 'a970d090588542dad745297866e794ab9dad8795/',
+            'gaze_resource': 'a970d090588542dad745297866e794ab9dad8795/',
             'filename': 'pymovements-toy-dataset-eyelink.zip',
             'md5': 'b1d426751403752c8a154fc48d1670ce',
         },


Test patch:
diff --git a/tests/unit/dataset/dataset_download_test.py b/tests/unit/dataset/dataset_download_test.py
index 03dd7a5..4c29441 100644
--- a/tests/unit/dataset/dataset_download_test.py
+++ b/tests/unit/dataset/dataset_download_test.py
@@ -43,7 +43,7 @@ def dataset_definition_fixture():
 
         resources: tuple[dict[str, str], ...] = (
             {
-                'resource': 'test.gz.tar',
+                'gaze_resource': 'test.gz.tar',
                 'filename': 'test.gz.tar',
                 'md5': '52bbf03a7c50ee7152ccb9d357c2bb30',
             },
@@ -275,7 +275,7 @@ def test_dataset_download_no_mirrors_raises_exception(tmp_path):
 
         resources: tuple[dict[str, str], ...] = (
             {
-                'resource': 'test.gz.tar',
+                'gaze_resource': 'test.gz.tar',
                 'filename': 'test.gz.tar',
                 'md5': '52bbf03a7c50ee7152ccb9d357c2bb30',
             },