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

[BUG] Local setup and system-test seem broken for the get subcommand #241

Open
1 task done
surchs opened this issue Nov 11, 2024 · 1 comment
Open
1 task done
Labels
bug Something isn't working

Comments

@surchs
Copy link

surchs commented Nov 11, 2024

Is there an existing issue for this?

  • I have searched the existing issues

Expected Behavior

I can follow the setup instructions and then run a successful get example

Current Behavior

I am unable to get a dataset

Error message

Traceback (most recent call last):
  File "/home/surchs/miniconda3/envs/cohort/bin/cohort_creator", line 8, in <module>
    sys.exit(cli())
             ^^^^^
  File "/home/surchs/Repositories/external/cohort_creator/cohort_creator/_cli.py", line 104, in cli
    get_data(
  File "/home/surchs/Repositories/external/cohort_creator/cohort_creator/main.py", line 192, in get_data
    uri = get_dataset_url(dataset_, dataset_type_)
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/surchs/Repositories/external/cohort_creator/cohort_creator/_utils.py", line 625, in get_dataset_url
    datasets = known_datasets_df()
               ^^^^^^^^^^^^^^^^^^^
  File "/home/surchs/Repositories/external/cohort_creator/cohort_creator/data/utils.py", line 48, in known_datasets_df
    openneuro_df = _load_known_datasets(_openneuro_listing_tsv())
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/surchs/Repositories/external/cohort_creator/cohort_creator/data/utils.py", line 88, in _load_known_datasets
    df["duration"] = df["duration"].apply(_convert_duration)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/surchs/miniconda3/envs/cohort/lib/python3.12/site-packages/pandas/core/series.py", line 4924, in apply
    ).apply()
      ^^^^^^^
  File "/home/surchs/miniconda3/envs/cohort/lib/python3.12/site-packages/pandas/core/apply.py", line 1427, in apply
    return self.apply_standard()
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/surchs/miniconda3/envs/cohort/lib/python3.12/site-packages/pandas/core/apply.py", line 1507, in apply_standard
    mapped = obj._map_values(
             ^^^^^^^^^^^^^^^^
  File "/home/surchs/miniconda3/envs/cohort/lib/python3.12/site-packages/pandas/core/base.py", line 921, in _map_values
    return algorithms.map_array(arr, mapper, na_action=na_action, convert=convert)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/surchs/miniconda3/envs/cohort/lib/python3.12/site-packages/pandas/core/algorithms.py", line 1743, in map_array
    return lib.map_infer(values, mapper, convert=convert)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "lib.pyx", line 2972, in pandas._libs.lib.map_infer
  File "/home/surchs/Repositories/external/cohort_creator/cohort_creator/data/utils.py", line 96, in _convert_duration
    x = literal_eval(x.replace("nan", "None"))
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/surchs/miniconda3/envs/cohort/lib/python3.12/ast.py", line 112, in literal_eval
    return _convert(node_or_string)
           ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/surchs/miniconda3/envs/cohort/lib/python3.12/ast.py", line 101, in _convert
    return dict(zip(map(_convert, node.keys),
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/surchs/miniconda3/envs/cohort/lib/python3.12/ast.py", line 101, in _convert
    return dict(zip(map(_convert, node.keys),
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/surchs/miniconda3/envs/cohort/lib/python3.12/ast.py", line 92, in _convert
    return list(map(_convert, node.elts))
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/surchs/miniconda3/envs/cohort/lib/python3.12/ast.py", line 111, in _convert
    return _convert_signed_num(node)
           ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/surchs/miniconda3/envs/cohort/lib/python3.12/ast.py", line 85, in _convert_signed_num
    return _convert_num(node)
           ^^^^^^^^^^^^^^^^^^
  File "/home/surchs/miniconda3/envs/cohort/lib/python3.12/ast.py", line 76, in _convert_num
    _raise_malformed_node(node)
  File "/home/surchs/miniconda3/envs/cohort/lib/python3.12/ast.py", line 73, in _raise_malformed_node
    raise ValueError(msg + f': {node!r}')
ValueError: malformed node or string on line 1: <ast.Call object at 0x7f33d8808a10>

See also similar error in the CI: https://github.com/neurodatascience/cohort_creator/actions/runs/11661670629/job/32466433271#step:8:92

Environment

  • OS: Debian 12
  • Python/Node version: 3.12.7

How to reproduce

Anything else?

No response

@surchs surchs added the bug Something isn't working label Nov 11, 2024
@Remi-Gau
Copy link
Contributor

OK it seems that I need to do some serious clean up here.

Will get on this next week, when the next release of Nilearn is done.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants