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

Fixing the dataloading for "edited_connectivity" #677

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 17 additions & 17 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,25 +47,25 @@ jobs:
cd tvb_build
bash install_full_tvb.sh

- name: cache data
id: cache-data
uses: actions/cache@v3
with:
path: tvb_data
key: tvb-data
#- name: cache data
# id: cache-data
# uses: actions/cache@v3
# with:
# path: tvb_data
# key: tvb-data

- name: download data
if: steps.cache-data.outputs.cache-hit != 'true'
run: |
wget -q https://zenodo.org/record/7574266/files/tvb_data.zip?download=1 -O tvb_data.zip
mkdir tvb_data
unzip tvb_data.zip -d tvb_data
rm tvb_data.zip
#- name: download data
# if: steps.cache-data.outputs.cache-hit != 'true'
# run: |
# wget -q https://zenodo.org/record/7574266/files/tvb_data.zip?download=1 -O tvb_data.zip
# mkdir tvb_data
# unzip tvb_data.zip -d tvb_data
# rm tvb_data.zip

- name: setup data
run: |
cd tvb_data
python3 setup.py develop
#- name: setup data
# run: |
# cd tvb_data
# python3 setup.py develop

- name: run library tests
run: pytest -v tvb_library --cov --cov-report=xml && mv coverage.xml coverage-library.xml
Expand Down
10 changes: 8 additions & 2 deletions tvb_library/tvb/datasets/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,14 @@ def __init__(self, version, extract_dir=None):
def download(self):
pass

def fetch_data(self):
pass
def fetch_data(self, file_name):
if Path(file_name).is_absolute():
return file_name

return self._fetch_data(file_name)

def _fetch_data(self, file_name):
pass

def get_version(self):
return self.version
2 changes: 1 addition & 1 deletion tvb_library/tvb/datasets/tvb_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def download(self, path=None):
"""
self.rec.download(path)

def fetch_data(self, file_name):
def _fetch_data(self, file_name):
"""
Fetches the data

Expand Down
2 changes: 1 addition & 1 deletion tvb_library/tvb/datasets/zenodo.py
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ def get_record(self, recid: str) -> Record:
return Record(requests.get(url).json())


def _get_records(self, params: dict[str, str]) -> List[Record]:
def _get_records(self, params: Dict[str, str]) -> List[Record]:
url = self.base_url + "records?" + urlencode(params)

return [Record(hit) for hit in requests.get(url).json()["hits"]["hits"]]
Expand Down