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 we change file for "run_sample.py" from a pickle file to a more portable format? #48

Open
aramirezreyes opened this issue Apr 20, 2022 · 4 comments
Assignees
Labels
bug Something isn't working documentation Improvements or additions to documentation enhancement New feature or request not critical

Comments

@aramirezreyes
Copy link

When running run_sample.py on python 3.7 with:

netcdf4                   1.5.8                    pypi_0    pypi
numba                     0.55.1                   pypi_0    pypi
numpy                     1.21.6                   pypi_0    pypi
xarray                    0.20.2                   pypi_0    pypi
...PI computation complete and saved

Performing PI analyses...
Traceback (most recent call last):
  File "run_sample.py", line 148, in <module>
    ds2 = run_sample_analyses(ds,_mdrF,CKCD=0.9)
  File "run_sample.py", line 73, in run_sample_analyses
    basins = pickle.load( open( _mdrF, "rb" ) )
AttributeError: Can't get attribute 'PandasIndexAdapter' on <module 'xarray.core.indexing' from '/Users/arreyes/miniconda3/envs/mytcpypi/lib/python3.7/site-packages/xarray/core/indexing.py'>

The error occurs because the pickled file was saved with an unknown version of pickle and they are not supposed to be compatible (see e.g. pydata/xarray#5642) a better Idea could be to redistribute the file as netcdf or hdf5.

@aramirezreyes aramirezreyes changed the title A pickled file for "run_sample.py" is not a good idea. Can we change file for "run_sample.py" from a pickle file to a more portable format? May 24, 2022
@dgilford dgilford self-assigned this Aug 10, 2022
@dgilford dgilford added the enhancement New feature or request label Aug 10, 2022
@dgilford
Copy link
Owner

This is a good idea. I'll need to create the file that avoids compatibility issues as you suggest. Please stay tuned.

@aramirezreyes
Copy link
Author

Actually now that I notice, mdr.pk1 is not used anywhere as far as I can see. It is loaded in run_sample.py but its contents are never used. That line could be removed. If there is some functionality for the basins dataset we can use netCDF (I could contribute a PR if you think this is a good idea.).

@Wamashudu
Copy link

HEY PLEASE HELP I AM ENCOUNTERING THE SAME PROBLEM

@Wamashudu
Copy link

@aramirezreyes DID YOU SOLVE IT

@dgilford dgilford added bug Something isn't working documentation Improvements or additions to documentation not critical labels Feb 9, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working documentation Improvements or additions to documentation enhancement New feature or request not critical
Projects
None yet
Development

No branches or pull requests

3 participants