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

Logic issue in XnatUtils.has_resource #291

Closed
baxpr opened this issue Sep 3, 2020 · 1 comment
Closed

Logic issue in XnatUtils.has_resource #291

baxpr opened this issue Sep 3, 2020 · 1 comment
Assignees
Labels

Comments

@baxpr
Copy link
Member

baxpr commented Sep 3, 2020

def has_resource(cobj, resource_label):

If the resource doesn't exist, this throws the error below instead of politely returning 'false' like it's supposed to. Looks like it needs to check for 'None' somewhere maybe:

2020-09-02 15:40:31,415 - CRITICAL - launcher - Caught exception building sessions 603854632982
2020-09-02 15:40:31,415 - CRITICAL - launcher - Exception class <class 'ValueError'> caught with message invalid literal for int() with base 10: ''
2020-09-02 15:40:31,423 - CRITICAL - launcher - Traceback (most recent call last):
  File "/gpfs52/data/mcr/centos7/venv/dax/lib/python3.6/site-packages/dax/launcher.py", line 556, in build_project
    sessions=cached_sessions)
  File "/gpfs52/data/mcr/centos7/venv/dax/lib/python3.6/site-packages/dax/launcher.py", line 618, in build_session
    self.build_scan_modules(intf, cscan, scan_mod_list)
  File "/gpfs52/data/mcr/centos7/venv/dax/lib/python3.6/site-packages/dax/launcher.py", line 686, in build_scan_modules
    if scan_mod.needs_run(cscan, xnat):
  File "/data/mcr/centos7/dax_modules/Module_dcm2niix.py", line 66, in needs_run
    if not XnatUtils.has_resource(cscan, 'DICOM'):
  File "/gpfs52/data/mcr/centos7/venv/dax/lib/python3.6/site-packages/dax/XnatUtils.py", line 2767, in has_resource
    return (len(res_list) > 0) and (int(res_list[0]['file_count']) > 0)
ValueError: invalid literal for int() with base 10: ''
@baxpr baxpr added the bug label Sep 3, 2020
bud42 added a commit that referenced this issue Dec 28, 2020
@bud42
Copy link
Member

bud42 commented Jan 26, 2021

fixed in dax v2.0.0

@bud42 bud42 closed this as completed Jan 26, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants