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

Hide geopandas warning #1116

Merged
merged 3 commits into from
Oct 6, 2022

Conversation

carlfischerjba
Copy link
Contributor

Hide geopandas compatibility warnings from logs

Fixes #1115.
Hide numerous messages like the following from the logs:

...lib64/python3.8/site-packages/geopandas/_compat.py:112: UserWarning: The Shapely GEOS version (3.8.0-CAPI-1.13.1 ) is incompatible with the GEOS version PyGEOS was compiled with (3.10.3-CAPI-1.16.1). Conversions between both will be slow.

warnings.warn(
f"imports from 'oasislmf.{deprecated}' are deprecated. Import by using 'oasislmf.{self.depricated_modules[deprecated]}' instead."
)
with warnings.catch_warnings():
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not entirely sure this is necessary and haven't taken the time to confirm that it matters but if I've understood the Python docs this should prevent all warnings being reactivated across the entire application on the next line.

@sambles sambles self-requested a review October 6, 2022 10:05
@sambles sambles merged commit a48c6f8 into OasisLMF:develop Oct 6, 2022
@awsbuild awsbuild added this to the 1.27.0rc1 milestone Oct 6, 2022
sambles added a commit that referenced this pull request Jan 12, 2023
* Hide geopandas warning

* Wrap warning filter with catch_warnings

Co-authored-by: sambles <sambles@users.noreply.github.com>
@awsbuild awsbuild modified the milestones: 1.27.0rc1, 1.27.0 Jan 12, 2023
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.

Logs cluttered with warnings from geopandas about GEOS versions
3 participants