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

Running T1-linear raises an error related to CAPS #1255

Closed
AliceJoubert opened this issue Aug 19, 2024 · 2 comments
Closed

Running T1-linear raises an error related to CAPS #1255

AliceJoubert opened this issue Aug 19, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@AliceJoubert
Copy link
Contributor

While running the T1-linear pipeline with the latest dev version of Clinica, I encountered an error seemingly related to #1158.

I ran the following cmd line :
clinica run t1-linear .../BIDS20_OASIS3 .../CAPS20_OASIS3
to process a BIDS folder which normally contains all the expected files (dataset_description.json, participants.tsv...).

The environnement used to run clinica contains the following dependencies (sample) :

attrs==23.2.0
cattrs==1.10.0
isodate==0.6.1
isoduration==20.11.0
requests==2.32.3
requests-oauthlib==2.0.0

The output was the following error log :

/Users/alice.joubert/miniconda/envs/clinicaEnv/lib/python3.11/site-packages/requests/__init__.py:86: RequestsDependencyWarning: Unable to find acceptable character detection dependency (chardet or charset_normalizer).
  warnings.warn(
Traceback (most recent call last):
  File "/Users/alice.joubert/miniconda/envs/clinicaEnv/bin/clinica", line 6, in <module>
    sys.exit(main())
             ^^^^^^
  File "/Users/alice.joubert/clinica/clinica/cmdline.py", line 113, in main
    cli()
  File "/Users/alice.joubert/miniconda/envs/clinicaEnv/lib/python3.11/site-packages/click/core.py", line 1157, in __call__
    return self.main(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/alice.joubert/miniconda/envs/clinicaEnv/lib/python3.11/site-packages/click/core.py", line 1078, in main
    rv = self.invoke(ctx)
         ^^^^^^^^^^^^^^^^
  File "/Users/alice.joubert/miniconda/envs/clinicaEnv/lib/python3.11/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/alice.joubert/miniconda/envs/clinicaEnv/lib/python3.11/site-packages/click/core.py", line 1688, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
                           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/alice.joubert/miniconda/envs/clinicaEnv/lib/python3.11/site-packages/click/core.py", line 1434, in invoke
    return ctx.invoke(self.callback, **ctx.params)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/alice.joubert/miniconda/envs/clinicaEnv/lib/python3.11/site-packages/click/core.py", line 783, in invoke
    return __callback(*args, **kwargs)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/alice.joubert/clinica/clinica/pipelines/t1_linear/t1_linear_cli.py", line 63, in cli
    pipeline = AnatLinear(
               ^^^^^^^^^^^
  File "/Users/alice.joubert/clinica/clinica/pipelines/t1_linear/anat_linear_pipeline.py", line 42, in __init__
    super().__init__(
  File "/Users/alice.joubert/clinica/clinica/pipelines/engine.py", line 427, in __init__
    from clinica.utils.caps import (
  File "/Users/alice.joubert/clinica/clinica/utils/caps.py", line 351, in <module>
    converter.register_unstructure_hook(IsoDate, lambda dt: dt.isoformat())
  File "/Users/alice.joubert/miniconda/envs/clinicaEnv/lib/python3.11/site-packages/cattr/converters.py", line 225, in register_unstructure_hook
    self._unstructure_func.register_cls_list([(cls, func)])
  File "/Users/alice.joubert/miniconda/envs/clinicaEnv/lib/python3.11/site-packages/cattr/dispatch.py", line 57, in register_cls_list
    self._single_dispatch.register(cls, handler)
  File "/Users/alice.joubert/miniconda/envs/clinicaEnv/lib/python3.11/functools.py", line 864, in register
    raise TypeError(
TypeError: Invalid first argument to `register()`. clinica.utils.caps.IsoDate is not a class or union type.
@AliceJoubert AliceJoubert added the bug Something isn't working label Aug 19, 2024
@NicolasGensollen
Copy link
Member

Hi @AliceJoubert

Thanks for reporting. It looks like your version of cattrs is pretty old (1.10.0) while the current one is 23.2.3 (they changed from semantic to calendar versioning a couple years ago).
Could you delete your environment and re-install clinica ? I think that should fix this issue.

@AliceJoubert
Copy link
Contributor Author

Indeed, it works now ! Thanks @NicolasGensollen :)

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