Skip to content

Commit 12c2991

Browse files
authored
Merge branch 'master' into nev-22-spikes-above-255
2 parents b83cee6 + c5d0cfb commit 12c2991

4 files changed

Lines changed: 17 additions & 6 deletions

File tree

‎.github/workflows/io-test.yml‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,11 @@ jobs:
4242
# the key depend on the last commit repo https://gin.g-node.org/NeuralEnsemble/ephy_testing_data.git
4343
id: ephy_testing_data
4444
run: |
45+
# if gin cannot be reached the key matches no cache and the restore-keys below restore the most recent one
4546
set -o pipefail
4647
if ! hash="$(git ls-remote https://gin.g-node.org/NeuralEnsemble/ephy_testing_data.git HEAD | cut -f1)" || [ -z "$hash" ]; then
47-
echo "::error::could not resolve ephy_testing_data HEAD on gin; refusing to build a degenerate cache key"
48-
exit 1
48+
echo "::warning::could not resolve ephy_testing_data HEAD on gin; restoring the most recent dataset cache"
49+
hash=""
4950
fi
5051
echo "dataset_hash=$hash" >> "$GITHUB_OUTPUT"
5152

‎.github/workflows/plexon2-testing.yml‎

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,11 @@ jobs:
3333
# the key depend on the last commit repo https://gin.g-node.org/NeuralEnsemble/ephy_testing_data.git
3434
id: ephy_testing_data
3535
run: |
36+
# if gin cannot be reached the key matches no cache and the restore-keys below restore the most recent one
3637
set -o pipefail
3738
if ! hash="$(git ls-remote https://gin.g-node.org/NeuralEnsemble/ephy_testing_data.git HEAD | cut -f1)" || [ -z "$hash" ]; then
38-
echo "::error::could not resolve ephy_testing_data HEAD on gin; refusing to build a degenerate cache key"
39-
exit 1
39+
echo "::warning::could not resolve ephy_testing_data HEAD on gin; restoring the most recent dataset cache"
40+
hash=""
4041
fi
4142
echo "dataset_hash=$hash" >> "$GITHUB_OUTPUT"
4243

‎neo/rawio/baserawio.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1544,7 +1544,7 @@ def _rescale_epoch_duration(self, raw_duration: np.ndarray, dtype: np.dtype):
15441544
# buffer api zone
15451545
# must be implemented if has_buffer_description_api=True
15461546
def get_analogsignal_buffer_description(self, block_index: int = 0, seg_index: int = 0, buffer_id: str = None):
1547-
if not self.has_buffer_description_api:
1547+
if not self.has_buffer_description_api():
15481548
raise ValueError("This reader do not support buffer_description API")
15491549
descr = self._get_analogsignal_buffer_description(block_index, seg_index, buffer_id)
15501550
return descr

‎neo/utils/datasets.py‎

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
"""
44

55
import os
6+
import warnings
67
from pathlib import Path
78

89
default_testing_repo = "https://gin.g-node.org/NeuralEnsemble/ephy_testing_data"
@@ -14,6 +15,9 @@
1415
# set in home
1516
local_testing_data_folder = Path.home() / "ephy_testing_data"
1617

18+
# local copies already updated in this process, so each one asks its remote at most once
19+
_updated_folders = set()
20+
1721

1822
def get_local_testing_data_folder():
1923
global local_testing_data_folder
@@ -64,7 +68,12 @@ def download_dataset(repo=default_testing_repo, remote_path=None, local_folder=N
6468
# make sure git repo is in clean state
6569
repo = dataset.repo
6670
repo.call_git(["checkout", "--force", "master"])
67-
dataset.update(merge=True)
71+
if local_folder not in _updated_folders:
72+
_updated_folders.add(local_folder)
73+
# the remote can be unreachable (gin answers 403 to CI runners at times), so keep the local copy then
74+
results = dataset.update(merge=True, on_failure="ignore")
75+
if any(result["status"] in ("impossible", "error") for result in results):
76+
warnings.warn(f"Could not update {local_folder} from its remote, using the local copy as it is")
6877
else:
6978
dataset = datalad.api.install(path=local_folder, source=repo)
7079

0 commit comments

Comments
 (0)