Skip to content

Commit faba17d

Browse files
authored
Merge branch 'master' into fix_openephys_stream
2 parents e92de38 + 467b946 commit faba17d

File tree

3 files changed

+57
-53
lines changed

3 files changed

+57
-53
lines changed

.github/workflows/caches_cron_job.yml

Lines changed: 51 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -10,57 +10,57 @@ on:
1010

1111
jobs:
1212

13-
create-conda-env-cache-if-missing:
14-
name: Caching conda env
15-
runs-on: "ubuntu-latest"
16-
strategy:
17-
fail-fast: true
18-
defaults:
19-
# by default run in bash mode (required for conda usage)
20-
run:
21-
shell: bash -l {0}
22-
steps:
23-
- uses: actions/checkout@v3
24-
25-
- name: Get current year-month
26-
id: date
27-
run: |
28-
echo "date=$(date +'%Y-%m')" >> $GITHUB_OUTPUT
29-
30-
- name: Get current dependencies hash
31-
id: dependencies
32-
run: |
33-
echo "hash=${{hashFiles('**/pyproject.toml', '**/environment_testing.yml')}}" >> $GITHUB_OUTPUT
34-
35-
- uses: actions/cache@v3
36-
# the cache for python package is reset:
37-
# * every month
38-
# * when package dependencies change
39-
id: cache-conda-env
40-
with:
41-
path: /usr/share/miniconda/envs/neo-test-env
42-
key: ${{ runner.os }}-conda-env-${{ steps.dependencies.outputs.hash }}-${{ steps.date.outputs.date }}
43-
44-
- name: Cache found?
45-
run: echo "Cache-hit == ${{steps.cache-conda-env.outputs.cache-hit == 'true'}}"
46-
47-
# activate environment if not restored from cache
48-
- uses: conda-incubator/[email protected]
49-
if: steps.cache-conda-env.outputs.cache-hit != 'true'
50-
with:
51-
activate-environment: neo-test-env
52-
environment-file: environment_testing.yml
53-
python-version: 3.9
54-
55-
- name: Create the conda environment to be cached
56-
if: steps.cache-conda-env.outputs.cache-hit != 'true'
57-
# create conda env, configure git and install pip, neo and test dependencies from master
58-
# for PRs that change dependencies, this environment will be updated in the test workflow
59-
run: |
60-
git config --global user.email "neo_ci@fake_mail.com"
61-
git config --global user.name "neo CI"
62-
python -m pip install -U pip # Official recommended way
63-
pip install --upgrade -e .[test]
13+
# create-conda-env-cache-if-missing:
14+
# name: Caching conda env
15+
# runs-on: "ubuntu-latest"
16+
# strategy:
17+
# fail-fast: true
18+
# defaults:
19+
# # by default run in bash mode (required for conda usage)
20+
# run:
21+
# shell: bash -l {0}
22+
# steps:
23+
# - uses: actions/checkout@v3
24+
25+
# - name: Get current year-month
26+
# id: date
27+
# run: |
28+
# echo "date=$(date +'%Y-%m')" >> $GITHUB_OUTPUT
29+
30+
# - name: Get current dependencies hash
31+
# id: dependencies
32+
# run: |
33+
# echo "hash=${{hashFiles('**/pyproject.toml', '**/environment_testing.yml')}}" >> $GITHUB_OUTPUT
34+
35+
# - uses: actions/cache@v3
36+
# # the cache for python package is reset:
37+
# # * every month
38+
# # * when package dependencies change
39+
# id: cache-conda-env
40+
# with:
41+
# path: /usr/share/miniconda/envs/neo-test-env
42+
# key: ${{ runner.os }}-conda-env-${{ steps.dependencies.outputs.hash }}-${{ steps.date.outputs.date }}
43+
44+
# - name: Cache found?
45+
# run: echo "Cache-hit == ${{steps.cache-conda-env.outputs.cache-hit == 'true'}}"
46+
47+
# # activate environment if not restored from cache
48+
# - uses: conda-incubator/[email protected]
49+
# if: steps.cache-conda-env.outputs.cache-hit != 'true'
50+
# with:
51+
# activate-environment: neo-test-env
52+
# environment-file: environment_testing.yml
53+
# python-version: 3.9
54+
55+
# - name: Create the conda environment to be cached
56+
# if: steps.cache-conda-env.outputs.cache-hit != 'true'
57+
# # create conda env, configure git and install pip, neo and test dependencies from master
58+
# # for PRs that change dependencies, this environment will be updated in the test workflow
59+
# run: |
60+
# git config --global user.email "neo_ci@fake_mail.com"
61+
# git config --global user.name "neo CI"
62+
# python -m pip install -U pip # Official recommended way
63+
# pip install --upgrade -e .[test]
6464

6565
create-data-cache-if-missing:
6666
name: Caching data env

neo/io/neomatlabio.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -281,6 +281,8 @@ def write_block(self, bl, **kargs):
281281
"""
282282
Arguments:
283283
bl: the block to be saved
284+
kargs: extra keyword arguments broadcasted to scipy.io.savemat
285+
284286
"""
285287
import scipy.io
286288

@@ -307,7 +309,7 @@ def write_block(self, bl, **kargs):
307309
else:
308310
group_structure[container_name].append(id(child_obj))
309311

310-
scipy.io.savemat(self.filename, {"block": bl_struct}, oned_as="row")
312+
scipy.io.savemat(self.filename, {"block": bl_struct}, oned_as="row", **kargs)
311313

312314
def _get_matlab_value(self, ob, attrname):
313315
units = None

neo/rawio/edfrawio.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,8 @@ def _parse_header(self):
100100
for ch_idx, sig_dict in enumerate(self.signal_headers):
101101
ch_name = sig_dict["label"]
102102
chan_id = ch_idx
103-
sr = sig_dict["sample_rate"] # Hz
103+
# pyedf >= 0.1.39 uses sample_frequency, pyedf < 0.1.39 uses sample_rate
104+
sr = sig_dict.get("sample_frequency") or sig_dict.get("sample_rate") # Hz
104105
dtype = "int16" # assume general int16 based on edf documentation
105106
units = sig_dict["dimension"]
106107
physical_range = sig_dict["physical_max"] - sig_dict["physical_min"]
@@ -160,6 +161,7 @@ def _parse_header(self):
160161
"label",
161162
"dimension",
162163
"sample_rate",
164+
"sample_frequency",
163165
"physical_min",
164166
"physical_max",
165167
"digital_min",

0 commit comments

Comments
 (0)