[BUG]: FunctionalConnectivityBase not included in markers/__init__.py #289

Closed
opened 2023-12-20 15:47:42 +00:00 by tomug · 3 comments
tomug commented 2023-12-20 15:47:42 +00:00 (Migrated from github.com)

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

When trying to import the FunctionalConnectivityBase class in a custom FC class I get ModuleNotFoundError.

Expected Behavior

Being able to import FunctionalConnectivityBase class

Steps To Reproduce

  1. on juseless
  2. running: junifer queue yamls/test_voxel_mean.yaml --submit --element 100408
  3. Following error:
from junifer.markers import FunctionalConnectivityBase
ModuleNotFoundError: No module named 'junifer.functional_connectivity_base'

Environment

junifer:
  version: 0.0.2.dev24
python:
  version: 3.10.8
  implementation: CPython
dependencies:
  click: 8.1.3
  numpy: 1.23.5
  datalad: 0.17.10
  pandas: 1.5.2
  nibabel: 4.0.2
  nilearn: 0.9.2
  sqlalchemy: 1.4.45
  yaml: '6.0'
system:
  platform: Linux-6.1.0-12-amd64-x86_64-with-glibc2.36

Relevant log output

No response

Anything else?

No response

### Is there an existing issue for this? - [X] I have searched the existing issues ### Current Behavior When trying to import the FunctionalConnectivityBase class in a custom FC class I get ModuleNotFoundError. ### Expected Behavior Being able to import FunctionalConnectivityBase class ### Steps To Reproduce 1. on juseless 2. running: junifer queue yamls/test_voxel_mean.yaml --submit --element 100408 3. Following error: ``` from junifer.markers import FunctionalConnectivityBase ModuleNotFoundError: No module named 'junifer.functional_connectivity_base' ``` ### Environment ```markdown junifer: version: 0.0.2.dev24 python: version: 3.10.8 implementation: CPython dependencies: click: 8.1.3 numpy: 1.23.5 datalad: 0.17.10 pandas: 1.5.2 nibabel: 4.0.2 nilearn: 0.9.2 sqlalchemy: 1.4.45 yaml: '6.0' system: platform: Linux-6.1.0-12-amd64-x86_64-with-glibc2.36 ``` ### Relevant log output _No response_ ### Anything else? _No response_
synchon commented 2023-12-21 05:02:16 +00:00 (Migrated from github.com)

Hi, your version of junifer looks pretty old, can you update it with pip install -U junifer and then try again?

Hi, your version of `junifer` looks pretty old, can you update it with `pip install -U junifer` and then try again?
tomug commented 2023-12-21 09:28:05 +00:00 (Migrated from github.com)

Hi, I updated to junifer v0.0.3 and the Error persists.

2023-12-21 10:25:09,209 - JUNIFER - INFO - ===== Lib Versions =====
2023-12-21 10:25:09,210 - JUNIFER - INFO - numpy: 1.25.2
2023-12-21 10:25:09,210 - JUNIFER - INFO - scipy: 1.10.0rc1
2023-12-21 10:25:09,210 - JUNIFER - INFO - pandas: 1.5.2
2023-12-21 10:25:09,210 - JUNIFER - INFO - nilearn: 0.9.2
2023-12-21 10:25:09,210 - JUNIFER - INFO - nibabel: 4.0.2
2023-12-21 10:25:09,210 - JUNIFER - INFO - junifer: 0.0.3
2023-12-21 10:25:09,210 - JUNIFER - INFO - ========================
2023-12-21 10:25:09,210 - JUNIFER - INFO - Parsing yaml file: /data/project/voxel_vs_roi/VvsR/scrap/tests/junifer/test/yamls/test_voxel_mean.yaml
================================================================================
REGISTERING MY OWN MASK
================================================================================
================================================================================
REGISTERING MY OWN PARCELLATION
================================================================================
2023-12-21 10:25:09,469 - JUNIFER - INFO - Registering demeanConfRemover in marker
Traceback (most recent call last):
  File "/home/tmuganga/miniconda3/envs/junifer_release/bin/junifer", line 8, in <module>
    sys.exit(cli())
  File "/home/tmuganga/miniconda3/envs/junifer_release/lib/python3.10/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/home/tmuganga/miniconda3/envs/junifer_release/lib/python3.10/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/home/tmuganga/miniconda3/envs/junifer_release/lib/python3.10/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/home/tmuganga/miniconda3/envs/junifer_release/lib/python3.10/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/home/tmuganga/miniconda3/envs/junifer_release/lib/python3.10/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/home/tmuganga/miniconda3/envs/junifer_release/lib/python3.10/site-packages/junifer/api/cli.py", line 250, in queue
    config = parse_yaml(filepath)  # type: ignore
  File "/home/tmuganga/miniconda3/envs/junifer_release/lib/python3.10/site-packages/junifer/api/parser.py", line 67, in parse_yaml
    spec.loader.exec_module(module)  # type: ignore
  File "<frozen importlib._bootstrap_external>", line 883, in exec_module
  File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed
  File "/data/project/voxel_vs_roi/VvsR/scrap/tests/junifer/test/yamls/../extensions/markers/fc_parcel_timeseries.py", line 6, in <module>
    from junifer.functional_connectivity_base import FunctionalConnectivityBase
ModuleNotFoundError: No module named 'junifer.functional_connectivity_base'

I just went through the __init__ files in the /markers dir in the Git Repo and noticed, that the FunctionalConnectivityBase class is not mentioned in any of the files.

Hi, I updated to junifer v0.0.3 and the Error persists. ``` 2023-12-21 10:25:09,209 - JUNIFER - INFO - ===== Lib Versions ===== 2023-12-21 10:25:09,210 - JUNIFER - INFO - numpy: 1.25.2 2023-12-21 10:25:09,210 - JUNIFER - INFO - scipy: 1.10.0rc1 2023-12-21 10:25:09,210 - JUNIFER - INFO - pandas: 1.5.2 2023-12-21 10:25:09,210 - JUNIFER - INFO - nilearn: 0.9.2 2023-12-21 10:25:09,210 - JUNIFER - INFO - nibabel: 4.0.2 2023-12-21 10:25:09,210 - JUNIFER - INFO - junifer: 0.0.3 2023-12-21 10:25:09,210 - JUNIFER - INFO - ======================== 2023-12-21 10:25:09,210 - JUNIFER - INFO - Parsing yaml file: /data/project/voxel_vs_roi/VvsR/scrap/tests/junifer/test/yamls/test_voxel_mean.yaml ================================================================================ REGISTERING MY OWN MASK ================================================================================ ================================================================================ REGISTERING MY OWN PARCELLATION ================================================================================ 2023-12-21 10:25:09,469 - JUNIFER - INFO - Registering demeanConfRemover in marker Traceback (most recent call last): File "/home/tmuganga/miniconda3/envs/junifer_release/bin/junifer", line 8, in <module> sys.exit(cli()) File "/home/tmuganga/miniconda3/envs/junifer_release/lib/python3.10/site-packages/click/core.py", line 1130, in __call__ return self.main(*args, **kwargs) File "/home/tmuganga/miniconda3/envs/junifer_release/lib/python3.10/site-packages/click/core.py", line 1055, in main rv = self.invoke(ctx) File "/home/tmuganga/miniconda3/envs/junifer_release/lib/python3.10/site-packages/click/core.py", line 1657, in invoke return _process_result(sub_ctx.command.invoke(sub_ctx)) File "/home/tmuganga/miniconda3/envs/junifer_release/lib/python3.10/site-packages/click/core.py", line 1404, in invoke return ctx.invoke(self.callback, **ctx.params) File "/home/tmuganga/miniconda3/envs/junifer_release/lib/python3.10/site-packages/click/core.py", line 760, in invoke return __callback(*args, **kwargs) File "/home/tmuganga/miniconda3/envs/junifer_release/lib/python3.10/site-packages/junifer/api/cli.py", line 250, in queue config = parse_yaml(filepath) # type: ignore File "/home/tmuganga/miniconda3/envs/junifer_release/lib/python3.10/site-packages/junifer/api/parser.py", line 67, in parse_yaml spec.loader.exec_module(module) # type: ignore File "<frozen importlib._bootstrap_external>", line 883, in exec_module File "<frozen importlib._bootstrap>", line 241, in _call_with_frames_removed File "/data/project/voxel_vs_roi/VvsR/scrap/tests/junifer/test/yamls/../extensions/markers/fc_parcel_timeseries.py", line 6, in <module> from junifer.functional_connectivity_base import FunctionalConnectivityBase ModuleNotFoundError: No module named 'junifer.functional_connectivity_base' ``` I just went through the `__init__` files in the `/markers` dir in the Git Repo and noticed, that the `FunctionalConnectivityBase` class is not mentioned in any of the files.
synchon commented 2023-12-21 09:46:41 +00:00 (Migrated from github.com)

Ok my bad, my eyes played trick on me and didn't read the issue description correctly, so the import should be:

from junifer.markers.functional_connectivity.functional_connectivity_base import FunctionalConnectivityBase

This is intentional to keep the base classes separate and not pollute the concrete classes available via:

from junifer.markers import ...
Ok my bad, my eyes played trick on me and didn't read the issue description correctly, so the import should be: ```python from junifer.markers.functional_connectivity.functional_connectivity_base import FunctionalConnectivityBase ``` This is intentional to keep the base classes separate and not pollute the concrete classes available via: ```python from junifer.markers import ... ```
Sign in to join this conversation.
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
juaml/junifer#289
No description provided.