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

python run_sample.py ERROR #68

Open
Wamashudu opened this issue Feb 9, 2023 · 3 comments
Open

python run_sample.py ERROR #68

Wamashudu opened this issue Feb 9, 2023 · 3 comments
Assignees
Labels
bug Something isn't working documentation Improvements or additions to documentation duplicate This issue or pull request already exists enhancement New feature or request not critical
Projects

Comments

@Wamashudu
Copy link

Performing PI analyses...
Traceback (most recent call last):

File "/home/wamashudu/Videos/Potnetail intensity/tcpyPI-master/run_sample.py", line 148, in
ds2 = run_sample_analyses(ds,_mdrF,CKCD=0.9)
File "/home/wamashudu/Videos/Potnetail intensity/tcpyPI-master/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 '/home/wamashudu/anaconda3/lib/python3.9/site-packages/xarray/core/indexing.py'>

@dgilford dgilford self-assigned this Feb 9, 2023
@dgilford dgilford added bug Something isn't working not critical documentation Improvements or additions to documentation labels Feb 9, 2023
@dgilford
Copy link
Owner

dgilford commented Feb 9, 2023

Hello,

I looked more closely and see where the error is occurring now, in the run_sample_analyses() function. This function is meant as general set of interesting post-calculation analyses to show pyPI example applications. As such, it is not critical to the calculation of potential intensity. In that sense, it’s worth noting that you should still be getting valid outputs in your ds dataset, and raw_sample_output.nc will still have all of the output from the pi.py module. If you plan to use tcpyPI to calculate potential intensity with your own input data, then this error will not be directly relevant for your application.

That said, it's useful to get this up and running for general education and understanding of how the package works, so I'll get to work fixing it!

The “AttributeError” we are running into is related to a mismatch in the version of pickle used to save out the original mdr.pk1 pickle file, and the version of xarray we are using to load in the file. See a related problem here.

I will plan to change the source of the mdr data to a more stable file type and push the change to the package soon.

In the meantime, please let me know if you encounter other errors that are outside code problematic calls for the mdr.pk1 (e.g. in this sample analysis)

@dgilford dgilford added the enhancement New feature or request label Feb 9, 2023
@dgilford
Copy link
Owner

dgilford commented Feb 9, 2023

Duplicate of #48

@dgilford dgilford marked this as a duplicate of #48 Feb 9, 2023
@Wamashudu
Copy link
Author

Wamashudu commented Feb 9, 2023 via email

@dgilford dgilford added the duplicate This issue or pull request already exists label 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 duplicate This issue or pull request already exists enhancement New feature or request not critical
Projects
Fix mdr.pk1
Awaiting triage
Development

No branches or pull requests

2 participants