Skip to content

Commit

Permalink
do not use pkg resource
Browse files Browse the repository at this point in the history
  • Loading branch information
Remi-Gau committed Mar 15, 2024
1 parent e332690 commit e39a275
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 8 deletions.
11 changes: 8 additions & 3 deletions CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -20,20 +20,25 @@ identifiers:
value: "10.5281/zenodo.7493322"

contact:
- affiliation: "Université catholique de Louvain"
email: remi.[email protected]
- affiliation: "McGill university"
email: remi.[email protected]
family-names: Gau
given-names: Rémi

authors:
- family-names: "Gau"
given-names: "Rémi"
orcid: "https://orcid.org/0000-0002-1535-9767"
affiliation: "Université catholique de Louvain"
affiliation: "McGill university"

- family-names: "Cabee"
given-names: "Pauline"

- family-names: "Yang"
given-names: "Ying"
orcid: "https://orcid.org/0000-0002-4157-2975"
affiliation: "Université catholique de Louvain"

license: GPL-3.0

keywords:
Expand Down
8 changes: 5 additions & 3 deletions bidsmreye/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@
import argparse
import sys
import warnings
from importlib import resources
from pathlib import Path
from typing import IO, Any

import pkg_resources
import pooch
import rich

import bidsmreye
from bidsmreye.defaults import available_models, default_model
from bidsmreye.logging import bidsmreye_log

Expand Down Expand Up @@ -98,8 +99,9 @@ def download(
base_url="https://osf.io/download/",
registry=None,
)
registry_file = pkg_resources.resource_stream("bidsmreye", "models/registry.txt")
POOCH.load_registry(registry_file)
source = resources.files(bidsmreye).joinpath("models/registry.txt")
with resources.as_file(source) as registry_file:
POOCH.load_registry(registry_file)

output_file = output_dir.joinpath(f"dataset_{model_name}")

Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -35,8 +35,8 @@ classifiers = [
]
dependencies = [
"attrs",
"chevron",
"deepmreye",
"chevron>=0.14.0",
"deepmreye>=0.2.1",
"kaleido",
"pooch>=1.6.0",
"pybids",
Expand Down

0 comments on commit e39a275

Please sign in to comment.