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

Addressed warnings, fixed raster zonal stats tests, and general cleanup #247

Merged
merged 9 commits into from
Aug 13, 2024

Conversation

joshuacortez
Copy link
Member

@joshuacortez joshuacortez commented Aug 13, 2024

I made some edits throughout the scripts and notebooks to minimize the warnings when running pytest. This can help future-proof the repo against upcoming deprecations

Pandas Related

  1. Address pandas' SettingWithCopyWarning warning by creating a copy when applicable
  2. Replacing instances of using pandas operations that use inplace to use instead use standard assignment for consistency since some instances of using inplace are deprecated
  3. Replaced usage of np.array_split on a dataframe to be a straightforward list comprehension due to a pandas/geopandas warning

Raster Zonal Stats Related

  1. Added a CRS check for both the rasterstats and exactextract implementations of raster zonal stats
  2. Made new tests and fixed existing tests in test_raster_zonal_stats.py

Overall cleanup

  1. Used nbdev_clean to remove metadata from notebooks (that's why so many notebooks are affected lol)
  2. Slight edits for readability (e.g. .format to f-string etc.)

How to check for reviewers

  1. As for the scripts, you only need to check test_raster_zonal_stats.py and test_raster_process.py
  2. For the notebooks, use ReviewNB to review so it's easier since it skips notebooks with only metadata edits from nbdev_clean

Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

@butchtm butchtm merged commit af4b191 into thinkingmachines:master Aug 13, 2024
1 check passed
@butchtm
Copy link
Collaborator

butchtm commented Aug 13, 2024

lgtm!

@joshuacortez joshuacortez deleted the chore/fixing_warnings branch August 13, 2024 06:46
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