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

[JOSS] error when trying to reproduce Figure 3 #29

Closed
djmannion opened this issue Feb 8, 2024 · 1 comment
Closed

[JOSS] error when trying to reproduce Figure 3 #29

djmannion opened this issue Feb 8, 2024 · 1 comment

Comments

@djmannion
Copy link

openjournals/joss-reviews#6269

  • MRdataset version: 0.1.dev862+g33355da (installed via the docs instructions)
  • Python version: 3.11
  • Operating System: Linux

Description

Attempting to run the code shown in Figure 3 of the JOSS manuscript.

What I Did

# get an example DICOM from pydicom
import pathlib
import pydicom
demo_dcm = pathlib.Path(pydicom.data.get_testdata_file("MR_small.dcm")).parent

# from Figure 3
from MRdataset import import_dataset
ds = import_dataset(str(demo_dcm), format='dicom')

gives

dicom.py:MRdataset:__init__:80: Unable to read config file /home/damien/reviews/MRdataset/venv_repo/lib/python3.11/site-packages/MRdataset/resources/mri-config.json
Traceback (most recent call last):
  File "/home/damien/reviews/MRdataset/f3_err.py", line 9, in <module>
    ds = import_dataset(str(demo_dcm), format='dicom')
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/damien/reviews/MRdataset/venv_repo/lib/python3.11/site-packages/MRdataset/common.py", line 95, in import_dataset
    dataset = dataset_class(
              ^^^^^^^^^^^^^^
  File "/home/damien/reviews/MRdataset/venv_repo/lib/python3.11/site-packages/MRdataset/dicom.py", line 81, in __init__
    raise e
  File "/home/damien/reviews/MRdataset/venv_repo/lib/python3.11/site-packages/MRdataset/dicom.py", line 78, in __init__
    self.config_dict = read_json(Path(self.config_path))
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/damien/reviews/MRdataset/venv_repo/lib/python3.11/site-packages/MRdataset/utils.py", line 207, in read_json
    raise FileNotFoundError(f'File not found: {filepath}')
FileNotFoundError: File not found: /home/damien/reviews/MRdataset/venv_repo/lib/python3.11/site-packages/MRdataset/resources/mri-config.json
@sinhaharsh
Copy link
Collaborator

It seems that the resources folder was not included while publishing the library on PyPI. As of now you may try out the code in Figure 3 in the tutorial notebook.

sinhaharsh added a commit to sinhaharsh/MRdataset that referenced this issue Feb 9, 2024
1) Modify working directory so that pytest uses installed version of the library (in site-packages), and not that of Github repository
2) Include tests in pyproject.toml

Related to Open-Minds-Lab#29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants