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

Can't import wodnc #37

Open
BecCowley opened this issue Aug 24, 2023 · 6 comments
Open

Can't import wodnc #37

BecCowley opened this issue Aug 24, 2023 · 6 comments
Assignees

Comments

@BecCowley
Copy link
Member

BecCowley commented Aug 24, 2023

@BillMills Maybe a bug, maybe something I've done wrong, but getting the following when trying to import the wodnc from wodpy:

from wodpy import wodnc
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.8/lib/python3.8/code.py", line 90, in runcode
exec(code, self.locals)
File "", line 1, in
ImportError: cannot import name 'wodnc' from 'wodpy' (/Users/xxx/venvs/iquod/lib/python3.8/site-packages/wodpy/init.py)

Tried in python3.8 and 3.10
Any help appreciated!

@BecCowley
Copy link
Member Author

BecCowley commented Aug 24, 2023

I think it didn't install at all - perhaps an issue at the pip install side of things which I know nothing about!
I got around it by manually adding the wodnc.py to the library folder.

@bkatiemills
Copy link
Member

Hi @BecCowley, sorry for the super slow reply here - can you show me the result of your pip freeze? This functionality isn't in the releases on pypi since there's still some issues to sort out before this is 100% ready for production (see the points in https://github.com/IQuOD/wodpy/releases/tag/2.0.0b0, would love your input there). For now, you can install the 2.0.0 beta by cloning this repo and doing:

cd dist
pip install wodpy-2.0.0b0.tar.gz

and then all should be well. Let me know if not?

@BecCowley
Copy link
Member Author

Hi @BillMills - I understand now!
Output from pip freeze:

aiobotocore==2.5.4
aiohttp==3.8.5
aioitertools==0.11.0
aiosignal==1.3.1
async-timeout==4.0.3
attrs==23.1.0
botocore==1.31.17
certifi==2023.7.22
cftime==1.0.3.4
charset-normalizer==3.2.0
contourpy==1.1.0
cycler==0.11.0
exceptiongroup==1.1.3
fonttools==4.42.1
frozenlist==1.4.0
fsspec==2023.6.0
idna==3.4
importlib-resources==6.0.1
iniconfig==2.0.0
jmespath==1.0.1
kiwisolver==1.4.5
matplotlib==3.7.2
multidict==6.0.4
netCDF4==1.6.4
numpy==1.24.4
packaging==23.1
pandas==2.0.3
Pillow==10.0.0
pluggy==1.3.0
pyparsing==3.0.9
pytest==7.4.0
python-dateutil==2.8.2
pytz==2023.3
s3fs==2023.6.0
six==1.16.0
tomli==2.0.1
typing_extensions==4.7.1
tzdata==2023.3
urllib3==1.26.16
wodpy==1.6.2
wrapt==1.15.0
yarl==1.9.2
zipp==3.16.2

I ended up adding the code to my forked version and made my own branch. I've made some improvements (or created new bugs?).
Happy to contribute these edits. I think I accidentally pushed my branch to the iquod repo before I'd forked. If you can advise me how best you would like me to share, that would be great.

@bkatiemills
Copy link
Member

right, the wodpy=1.6.2 there doesn't have the nc functionality, is why you saw what you saw. In future if you want a smoother experience, you can install the beta per my comment above.

Great, I'd love to see what you were working on! I generally get the best results from a fork-and-pull workflow:

  • fork the repo (you already did this, no need to do it ever again)
  • push your feature branch to your fork (sounds like you pushed IQUODflagTesting here and to your fork - that's fine, but I would normally just push your feature branch to your fork, and keep the main repo tidy with to-be-released content).
  • set up a PR from your fork's feature branch to the IQuOD repo's main branch and tag me in it so I can give feedback before we merge. You very nearly did this in your PR Specify integer type for offset and nentries to allow for zero levels… #38, but you merged your fork's IQUODflagTesting into IQuOD's IQUODflagTesting rather than main.

Not the only way to do it, but that keeps things nice and tidy and is how I manage my other projects, let me know any questions.

@BecCowley
Copy link
Member Author

OK - I did stuff around a bit with the branch in the iquod repo. I wasn't sure if it could be just deleted?

I'll do a PR now from my fork to iquod's main.

@mylesmc123
Copy link

mylesmc123 commented Nov 14, 2024

Hello, just tacking on my recent experience. I installed the 2.0 release in a conda environment, by cloning the repo and following the steps:

cd dist
pip install wodpy-2.0.0b0.tar.gz 

However, I then got errors related to HDF5, and then netCDF4 complained about not having a path variable. So I ran the following sequence to get everything up and running:

conda install hdf5
conda install netcdf4
cd dist
pip install wodpy-2.0.0b0.tar.gz

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants