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

Palmer Drought Severity Index #539

Merged

Conversation

nnayda
Copy link
Contributor

@nnayda nnayda commented Dec 12, 2023

@monocongo I had some time so I took the bait and worked on the Palmer Drought Severity Index. I took the existing Fortran code from NOAA and parsed it to Python. I tried to keep the process flow the same and just change the syntax so that it would be easy to reference back. Therefore, the resulting code is not very pythonic. I think later on some enhancements and efficiencies could be gained, but at least it works.

I developed a suite of tests by running the Fortran code on all the available climate division data (downloaded from NOAA here), and then extracting the results. Some tweaks had to be made to the original Fortran code in order to get around differences in rounding errors. I stored these in fixture files to use in the pytests. These are the bulk of the file changes. I'm not sure what style preferences you have so I'm happy to restructure this - this just seemed the most logical layout to me.

Please let me know if I need to do anything else to support the pull request.

Copy link

sonarcloud bot commented Dec 13, 2023

Quality Gate Passed Quality Gate passed

The SonarCloud Quality Gate passed, but some issues were introduced.

5 New issues
0 Security Hotspots
No data about Coverage
2.0% Duplication on New Code

See analysis details on SonarCloud

@monocongo
Copy link
Owner

@nnayda This is huge, thanks so much for your effort. I'm very busy at my day job now but I should have time to review soon. THANK YOU!

@monocongo
Copy link
Owner

I will add this to the next release on PyPI. Again, this is a significant contribution, the code here looks much better than the version I had before, and it seems to match the NOAA results. Thank you big time @nnayda

BTW I'll eventually use this to process nclimgrid and various other large, gridded datasets to see how they look using this implementation. What are the other Palmer indices implementations and/or datasets in the wild that we can compare against next?

@monocongo monocongo merged commit d108eee into monocongo:master Feb 14, 2024
6 checks passed
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

Successfully merging this pull request may close these issues.

2 participants