Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enh/elephant data versioning #463

Merged

Conversation

Moritz-Alexander-Kern
Copy link
Member

@Moritz-Alexander-Kern Moritz-Alexander-Kern commented Mar 17, 2022

With this PR versioning for elephant-data (currently on: https://gin.g-node.org/INM-6/elephant-data) is introduced.

Issue

Different files from elephant-data are used in unit-tests and tutorial notebooks. Since the datasets on elephant-data may undergo various changes over time, any change would potentially break the unit tests of old elephant versions.

During development of a new tutorial or unit-test the used files might not yet be merged into elephant-data[master]. This requires the use of hard coded links to the development branch (on gin) until merged.

download_datasets: use only paths relative to repo root

Those issues might be addressed by creating releases of the elephant-data repository. Currently all links used in tutorials and unit-tests have to following structure:

Link to root of repository+path starting at root
example:
'https://web.gin.g-node.org/INM-6/elephant-data/raw/master/'+'unittest/spectral/multitaper_psd/data/time_series.npy'

This PR addresses this issue by introducing a new function download_datasets , which contains a default URL (first part in example above) and hence only requires the relative path from repository root as input. This default URL could be set to a specific release of elephant-data, e.g. 'https://web.gin.g-node.org/INM-6/elephant-data/raw/0.0.1'pointing to release v0.0.1. With every new version of elephant, this could be changed to the corresponding elephant-data version.

Update: A first release of elephant-data was created (v0.11.0). download_datasets now uses the currently installed version of elephant to create the URL pointing to a specific elephant-data release.

environment variable ELEPHANT_DATA_URL

Furthermore an environment variable ELEPHANT_DATA_URL is introduced, which allows to specify a different URL to the root of the repository.

Typical use cases could be development and CI workflows.

  • for CI use the latest state of elephant-data
    - set ELEPHANT_DATA_URL to 'https://web.gin.g-node.org/INM-6/elephant-data/raw/master/'
  • during development use a specific branch (e.g. multitaper) of elephant-data
    - set ELEPHANT_DATA_URL to 'https://web.gin.g-node.org/INM-6/elephant-data/raw/multitaper'

In both use cases an environment variable is changed and only the relative paths to the repository's root are hard coded.

TODO:

@Moritz-Alexander-Kern Moritz-Alexander-Kern added this to the v0.11.0 milestone Mar 17, 2022
@Moritz-Alexander-Kern Moritz-Alexander-Kern marked this pull request as ready for review March 25, 2022 17:48
@coveralls
Copy link
Collaborator

coveralls commented Mar 28, 2022

Coverage Status

Coverage decreased (-0.1%) to 88.557% when pulling 4af2ed8 on INM-6:enh/elephant_data_versioning into 7a6d3f2 on NeuralEnsemble:master.

* added handling for SSL verification error
* update ASSET and UE tutorials
@Moritz-Alexander-Kern Moritz-Alexander-Kern added the new functionality New modules, functions label Mar 29, 2022
* allow download without verified certificate
@pep8speaks
Copy link

pep8speaks commented Mar 29, 2022

Hello @Moritz-Alexander-Kern! Thanks for updating this PR. We checked the lines you've touched for PEP 8 issues, and found:

There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻

Comment last updated at 2022-03-30 15:47:01 UTC

@Moritz-Alexander-Kern Moritz-Alexander-Kern added the enhancement Editing an existing module, improving something label Mar 29, 2022
@Moritz-Alexander-Kern Moritz-Alexander-Kern added enhancement Editing an existing module, improving something and removed enhancement Editing an existing module, improving something labels Mar 30, 2022
@Moritz-Alexander-Kern Moritz-Alexander-Kern added enhancement Editing an existing module, improving something breaking-changes and removed enhancement Editing an existing module, improving something labels Mar 30, 2022
@Moritz-Alexander-Kern Moritz-Alexander-Kern merged commit dc893be into NeuralEnsemble:master Mar 30, 2022
@Moritz-Alexander-Kern Moritz-Alexander-Kern deleted the enh/elephant_data_versioning branch March 31, 2022 08:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
breaking-changes enhancement Editing an existing module, improving something new functionality New modules, functions
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants