Skip to content

Commit 49e4338

Browse files
authored
Merge branch 'NeuralEnsemble:master' into tdt_neo_changes
2 parents 8649dc4 + 2670b7f commit 49e4338

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+695
-302
lines changed
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
name: Create caches for ephy_testing_data and conda env
2+
3+
on:
4+
workflow_dispatch: # Workflow can be triggered manually via GH actions webinterface
5+
push: # When something is pushed into master this checks if caches need to re-created
6+
branches:
7+
- master
8+
schedule:
9+
- cron: "0 12 * * *" # Daily at noon UTC
10+
11+
jobs:
12+
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 .
64+
pip install .[test]
65+
66+
create-data-cache-if-missing:
67+
name: Caching data env
68+
runs-on: "ubuntu-latest"
69+
steps:
70+
71+
- name: Get current hash (SHA) of the ephy_testing_data repo
72+
id: ephy_testing_data
73+
run: |
74+
echo "dataset_hash=$(git ls-remote https://gin.g-node.org/NeuralEnsemble/ephy_testing_data.git HEAD | cut -f1)" >> $GITHUB_OUTPUT
75+
76+
- uses: actions/cache@v3
77+
# Loading cache of ephys_testing_dataset
78+
id: cache-datasets
79+
with:
80+
path: ~/ephy_testing_data
81+
key: ${{ runner.os }}-datasets-${{ steps.ephy_testing_data.outputs.dataset_hash }}
82+
83+
- name: Cache found?
84+
run: echo "Cache-hit == ${{steps.cache-datasets.outputs.cache-hit == 'true'}}"
85+
86+
- name: Installing datalad and git-annex
87+
if: steps.cache-datasets.outputs.cache-hit != 'true'
88+
run: |
89+
git config --global user.email "neo_ci@fake_mail.com"
90+
git config --global user.name "neo CI"
91+
python -m pip install -U pip # Official recommended way
92+
pip install datalad-installer
93+
datalad-installer --sudo ok git-annex --method datalad/packages
94+
pip install datalad
95+
git config --global filter.annex.process "git-annex filter-process" # recommended for efficiency
96+
97+
- name: Download dataset
98+
if: steps.cache-datasets.outputs.cache-hit != 'true'
99+
# Download repository and also fetch data
100+
run: |
101+
cd ~
102+
datalad install --recursive --get-data https://gin.g-node.org/NeuralEnsemble/ephy_testing_data
103+
104+
- name: Show size of the cache to assert data is downloaded
105+
run: |
106+
cd ~
107+
pwd
108+
du -hs ephy_testing_data
109+
cd ephy_testing_data
110+
pwd

.github/workflows/core-test.yml

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,17 @@ on:
44
pull_request:
55
branches: [master]
66
types: [synchronize, opened, reopened, ready_for_review]
7+
paths:
8+
- 'neo/core/**'
9+
- 'pyproject.toml'
710

811
# run checks on any change of master, including merge of PRs
912
push:
1013
branches: [master]
1114

12-
15+
concurrency: # Cancel previous workflows on the same pull request
16+
group: ${{ github.workflow }}-${{ github.ref }}
17+
cancel-in-progress: true
1318

1419
jobs:
1520
multi-os-python-numpy:
@@ -20,19 +25,19 @@ jobs:
2025
matrix:
2126
os: ["ubuntu-latest", "windows-latest"]
2227
# "macos-latest",
23-
python-version: ['3.7', '3.8', '3.9', '3.10']
24-
numpy-version: ['1.18.5', '1.19.5', '1.20.3', '1.21.6', '1.22.4', '1.23.0']
28+
python-version: ['3.8', '3.9', '3.10', '3.11']
29+
numpy-version: ['1.19.5', '1.20.3', '1.21.6', '1.22.4', '1.23.5', '1.24.1']
2530
exclude:
26-
- python-version: '3.7'
27-
numpy-version: '1.22.4'
28-
- python-version: '3.7'
29-
numpy-version: '1.23.0'
30-
- python-version: '3.10'
31-
numpy-version: '1.18.5'
3231
- python-version: '3.10'
3332
numpy-version: '1.19.5'
3433
- python-version: '3.10'
3534
numpy-version: '1.20.3'
35+
- python-version: '3.11'
36+
numpy-version: '1.19.5'
37+
- python-version: '3.11'
38+
numpy-version: '1.20.3'
39+
- python-version: '3.11'
40+
numpy-version: '1.21.6'
3641
steps:
3742
- name: Set up Python ${{ matrix.python-version }}
3843
uses: actions/setup-python@v4

.github/workflows/ebrains.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Mirror to EBRAINS
2+
3+
# Configure the events that are going to trigger tha automated update of the mirror
4+
on:
5+
push:
6+
branches: [ master ]
7+
8+
# Configure what will be updated
9+
jobs:
10+
# set the job name
11+
to_ebrains:
12+
runs-on: ubuntu-latest
13+
steps:
14+
# this task will push the master branch of the source_repo (github) to the
15+
# destination_repo (ebrains gitlab)
16+
- name: syncmaster
17+
uses: wei/git-sync@v3
18+
with:
19+
source_repo: https://github.com/NeuralEnsemble/python-neo
20+
source_branch: "master"
21+
destination_repo: "https://ghpusher:${{ secrets.EBRAINS_GITLAB_ACCESS_TOKEN }}@gitlab.ebrains.eu/NeuralEnsemble/neo.git"
22+
destination_branch: "main"
23+
# this task will push all tags from the source_repo to the destination_repo
24+
- name: synctags
25+
uses: wei/git-sync@v3
26+
with:
27+
source_repo: https://github.com/NeuralEnsemble/python-neo
28+
source_branch: "refs/tags/*"
29+
destination_repo: "https://ghpusher:${{ secrets.EBRAINS_GITLAB_ACCESS_TOKEN }}@gitlab.ebrains.eu/NeuralEnsemble/neo.git"
30+
destination_branch: "refs/tags/*"

.github/workflows/io-test.yml

Lines changed: 34 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ on:
99
push:
1010
branches: [master]
1111

12+
concurrency: # Cancel previous workflows on the same pull request
13+
group: ${{ github.workflow }}-${{ github.ref }}
14+
cancel-in-progress: true
1215

1316
jobs:
1417
build-and-test:
@@ -19,7 +22,7 @@ jobs:
1922
matrix:
2023
# "macos-latest", "windows-latest"
2124
os: ["ubuntu-latest", ]
22-
python-version: ['3.8', ]
25+
python-version: ['3.9', ]
2326
defaults:
2427
# by default run in bash mode (required for conda usage)
2528
run:
@@ -35,34 +38,44 @@ jobs:
3538

3639
- name: Get ephy_testing_data current head hash
3740
# the key depend on the last commit repo https://gin.g-node.org/NeuralEnsemble/ephy_testing_data.git
38-
id: ephy_testing_data_hash
41+
id: ephy_testing_data
3942
run: |
40-
echo "latest_hash=$(git ls-remote https://gin.g-node.org/NeuralEnsemble/ephy_testing_data.git HEAD | cut -f1)" >> GITHUB_OUTPUT
43+
echo "dataset_hash=$(git ls-remote https://gin.g-node.org/NeuralEnsemble/ephy_testing_data.git HEAD | cut -f1)" >> $GITHUB_OUTPUT
4144
42-
- uses: actions/cache@v3
45+
- uses: actions/cache/restore@v3
4346
# Loading cache of ephys_testing_dataset
4447
id: cache-datasets
4548
with:
4649
path: ~/ephy_testing_data
47-
key: ${{ runner.os }}-datasets-${{ steps.ephy_testing_data_hash.outputs.latest_hash }}
50+
key: ${{ runner.os }}-datasets-${{ steps.ephy_testing_data.outputs.dataset_hash }}
51+
restore-keys: ${{ runner.os }}-datasets-
4852

4953
- uses: conda-incubator/setup-miniconda@v2
5054
with:
5155
activate-environment: neo-test-env
5256
python-version: ${{ matrix.python-version }}
53-
clean-patched-environment-file: false
5457

55-
- uses: actions/cache@v3
58+
- name: Get current dependencies hash
59+
id: dependencies
60+
run: |
61+
echo "hash=${{hashFiles('**/pyproject.toml', '**/environment_testing.yml')}}" >> $GITHUB_OUTPUT
62+
63+
- uses: actions/cache/restore@v3
5664
# the cache for python package is reset:
5765
# * every month
58-
# * when requirements/requirements_testing change
66+
# * when package dependencies change
5967
id: cache-conda-env
6068
with:
6169
path: /usr/share/miniconda/envs/neo-test-env
62-
key: ${{ runner.os }}-conda-env-${{ hashFiles('**/requirements.txt') }}-${{ hashFiles('**/requirements_testing.txt') }}-${{ hashFiles('**/environment_testing.txt') }}-${{ steps.date.outputs.date }}
70+
key: ${{ runner.os }}-conda-env-${{ steps.dependencies.outputs.hash }}-${{ steps.date.outputs.date }}
71+
# restore-keys match any key that starts with the restore-key
72+
restore-keys: |
73+
${{ runner.os }}-conda-env-${{ steps.dependencies.outputs.hash }}-
74+
${{ runner.os }}-conda-env-
6375
6476
- name: Install testing dependencies
65-
# testing environment is only installed if no cache was found
77+
# testing environment is only created from yml if no cache was found
78+
# restore-key hits should result in `cache-hit` == 'false'
6679
if: steps.cache-conda-env.outputs.cache-hit != 'true'
6780
run: |
6881
conda env update neo-test-env --file environment_testing.yml
@@ -72,9 +85,19 @@ jobs:
7285
git config --global user.email "neo_ci@fake_mail.com"
7386
git config --global user.name "neo CI"
7487
75-
- name: Install neo
88+
- name: Install neo including dependencies
89+
# installation with dependencies is only required if no cache was found
90+
# restore-key hits should result in `cache-hit` == 'false'
91+
if: steps.cache-conda-env.outputs.cache-hit != 'true'
7692
run: |
7793
pip install --upgrade -e .
94+
pip install .[test]
95+
96+
- name: Install neo without dependencies
97+
# only installing neo version to test as dependencies should be in cached conda env already
98+
if: steps.cache-conda-env.outputs.cache-hit == 'true'
99+
run: |
100+
pip install --no-dependencies -e .
78101
79102
- name: Test with pytest
80103
run: |

.readthedocs.yaml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,4 +12,6 @@ python:
1212
install:
1313
- method: pip
1414
path: .
15-
- requirements: doc/requirements_docs.txt
15+
extra_requirements:
16+
- docs
17+

doc/requirements_docs.txt

Lines changed: 0 additions & 3 deletions
This file was deleted.

doc/source/conf.py

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,17 +13,16 @@
1313

1414
import os
1515
import sys
16+
import re
1617

1718
from packaging.version import Version
1819

19-
with open("../../neo/version.py") as fp:
20-
d = {}
21-
exec(fp.read(), d)
22-
neo_release = d['version']
20+
with open('../../pyproject.toml', mode='r') as f:
21+
txt = f.read()
22+
neo_release = re.findall('version = "(\S+)"', txt)[0]
2323

2424
neo_version = '.'.join((str(e) for e in Version(neo_release).release[:2]))
2525

26-
2726
AUTHORS = 'Neo authors and contributors <[email protected]>'
2827

2928
# If extensions (or modules to document with autodoc) are in another directory,
@@ -51,7 +50,7 @@
5150

5251
# General information about the project.
5352
project = 'Neo'
54-
copyright = '2010-2022, ' + AUTHORS
53+
copyright = '2010-2023, ' + AUTHORS
5554

5655
# The version info for the project you're documenting, acts as replacement for
5756
# |version| and |release|, also used in various other places throughout the

doc/source/core.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -191,7 +191,7 @@ Relationship:
191191

192192
:download:`Click here for a better quality SVG diagram <./images/simple_generated_diagram.svg>`
193193

194-
.. note:: This figure do not include :class:`ChannelView` and :class:`RegionOfInterest`.
194+
.. note:: This figure does not include :class:`ChannelView` and :class:`RegionOfInterest`.
195195

196196
For more details, see the :doc:`api_reference`.
197197

0 commit comments

Comments
 (0)