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

retreiving record using gwlevels fails with ValueError date in wrong format (using example provided online) #166

Open
Ben-Choat opened this issue Sep 30, 2024 · 6 comments

Comments

@Ben-Choat
Copy link

Using the example linked below and provided in the official documentation fails with: ValueError: time data '1945-10-12 22:35 +0000' does not match format 'ISO8601' (match).

df = dataretrieval.nwis.get_record(
sites="434400121275801", service="gwlevels"
)

https://doi-usgs.github.io/dataretrieval-python/reference/nwis.html#dataretrieval.nwis.get_record:~:text=%23%20Get%20latest%20groundwater%20level%20for%20site%20434400121275801%0A%3E%3E%3E%20df%20%3D%20dataretrieval.nwis.get_record(%0A...%20%20%20%20%20sites%3D%22434400121275801%22%2C%20service%3D%22gwlevels%22%0A...%20)

@ehinman
Copy link
Collaborator

ehinman commented Sep 30, 2024

Hi @Ben-Choat, thanks for identifying an issue. Are you using the latest version of dataretrieval-python? The gwlevels service recently changed, and we made some updates to the package. You can see details in the read me here: https://github.com/DOI-USGS/dataretrieval-python?tab=readme-ov-file#dataretrieval-download-hydrologic-data

I just ran this line of code using the latest version of the package and it worked ok for me, but please let me know if this issue persists for you. Thanks so much!

@Ben-Choat
Copy link
Author

Ben-Choat commented Sep 30, 2024

Hello @ehinman, Version seemed to be the issue. I just checked the version using dataretrieval.version and it came back as 0.0.0 which is very surprising. I just installed it this past Friday (the 27th) using conda install dataretrieval -c conda-forge.

I just tried updating using conda update dataretrieval but it still says version 0.0.0.

I tried specifying the version conda install dataretrieval=1.0.10 -c conda-forge . I received a message that it is already installed and .version still returns 0.0.0.

Running conda install conda-forge::dataretrieval had the same effect.

Building a new virtual environment with venv and installing via pip install dataretrieval seems to have done the job with .version now showing 1.0.10 and the sample code running as expected.

When I was using conda, I was trying to install in an existing conda environment, so that may have caused issues for some reason. I have not tried installing in a fresh conda environment.

@ehinman
Copy link
Collaborator

ehinman commented Oct 1, 2024

Thanks for the info, I will investigate on my machine as well.

@kallejahn
Copy link

+1 to the 0.0.0 version issue from a conda install I did yesterday.

@ehinman
Copy link
Collaborator

ehinman commented Nov 7, 2024

Huh, that's really strange. I use a miniforge installation of mamba. I just created a fresh environment and installed dataretrieval via conda-forge and it downloaded v1.0.11 (latest), with python 3.13.0. I did the same thing specifying python=3.12.0 and I received the same version of dataretrieval. That is what shows on the distribution as well. I'm wondering if there are some conflicting dependencies in your environment causing it to download v0.0.0? Sorry this is happening to people!

@thodson-usgs
Copy link
Collaborator

I'll look over the logs on the conda side. I'd hoped this was fixed with the last release, but apparently not.

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

No branches or pull requests

4 participants