nata icon indicating copy to clipboard operation
nata copied to clipboard

Cannot import parts of modules ('GridArray' and 'examples')

Open mtrocadomoreira opened this issue 2 years ago • 2 comments

Hello!

I was trying to run the "Grids" example notebook, but I get an import error in the first cell: ImportError: cannot import name 'GridArray' from 'nata.containers'

image

I did some tests in the interactive shell, and from nata.containers import * works fine, but it apparently doesn't import the GridArray class:

image

I noticed the same kind of error with from nata import examples, by the way.

Any idea what this could be about? Thank you!

mtrocadomoreira avatar Oct 19 '23 15:10 mtrocadomoreira

Hi @mtrocadomoreira! I think this may be because we have decided to expose the containers differently, through

from nata import GridArray

Unfortunately, I think we forgot to update the examples...

Can you give the import above a try?

I do think now we should keep the imports from the submodules, though, e.g. from nata.containers import ....

fabiocruz avatar Nov 07 '23 09:11 fabiocruz

Hi @fabiocruz!

I tried your import, but I got the same error :/ ImportError: cannot import name 'GridArray' from 'nata' (/Users/Mariana/.venv/venv-nata-python3.8/lib/python3.8/site-packages/nata/__init__.py)

It's simply not importing GridArray, I don't understand why... When I try this: import nata dir(nata.containers) I can see 'GridDataset' in there, but not 'GridArray', which seems very strange.

mtrocadomoreira avatar Nov 13 '23 14:11 mtrocadomoreira