Charestlab / pyGLMdenoise

python implementation of GLMdenoise
6 stars 6 forks source link

Importing glmdenoise does not import all submodules of io subpackage #71

Closed adkipnis closed 4 years ago

adkipnis commented 4 years ago

Screenshot_20200529_135230

Cannot use glmdenoise.io.input module, as it's not available. All .py files for io submodules are however in my package directory...

JasperVanDenBosch commented 4 years ago

Can you show the code you use to import it?

Note that we haven't tested the compatibility with Continuum Analytics software yet.

adkipnis commented 4 years ago

Thank you for your response! I import the module like this: from glmdenoise import io

JasperVanDenBosch commented 4 years ago

I'm not getting an error with that code. Can you give some more details?

adkipnis commented 4 years ago

I've cloned the master branch and installed pyGLMdenoise in a separate environment using the line python setup.py install. I could reproduce my error in different IDEs (PyCharm and Spyder) and in the commandline:

Python 3.8.1 (default, Jan  8 2020, 22:29:32) 
[GCC 7.3.0] :: Anaconda, Inc. on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import glmdenoise
>>> dir(glmdenoise)
['GLMdenoise', '__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__path__', '__spec__', 'cross_validate', 'defaults', 'fit_runs', 'io', 'pyGlmdenoise', 'r2_nom_denom', 'report', 'select_noise_regressors', 'utils', 'whiten_data']
>>> from glmdenoise import io
>>> dir(io)
['__builtins__', '__cached__', '__doc__', '__file__', '__loader__', '__name__', '__package__', '__path__', '__spec__', 'output']
>>> 

Please tell me if I have missed something important. Thank you.

JasperVanDenBosch commented 4 years ago

not all sub packages will be exposed as members of the import that way. If you wish to use a function from a subpackage, you would do:

from glmdenoise.io.input import load_nifti
load_nifti('bla.nii')

Perhaps I can give more specific import examples if I know which function you're trying to use from input?

adkipnis commented 4 years ago

I wanted to load bids.py. I see, from glmdenoise.io import bids works without a problem. Thanks, problem solved!