10000 specify input range in logs when image data must be clipped by MarcBresson · Pull Request #26802 · matplotlib/matplotlib · GitHub
[go: up one dir, main page]

Skip to content

specify input range in logs when image data must be clipped #26802

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

Merged
merged 1 commit into from
Sep 18, 2023
Merged

specify input range in logs when image data must be clipped #26802

merged 1 commit into from
Sep 18, 2023

Conversation

MarcBresson
Copy link
Contributor

PR summary

When matplotlib clip image data because it is out of range, it could be useful to know what range was actually inputted. This PR print the given range in the logs.

PR checklist

Copy link
@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Thank you for opening your first PR into Matplotlib!

If you have not heard from us in a week or so, please leave a new comment below and that should bring it to our attention. Most of our reviewers are volunteers and sometimes things fall through the cracks.

You can also join us on gitter for real-time discussion.

For details on testing, writing docs, and our review process, please see the developer guide

We strive to be a welcoming and open project. Please follow our Code of Conduct.

@oscargus oscargus added this to the v3.9.0 milestone Sep 18, 2023
Copy link
Member
@rcomer rcomer left a comment

Choose a reason for hiding this comment

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

This seems reasonable to me. I have to admit I didn't know we used logging warnings anywhere... 👀

@rcomer rcomer merged commit 6fa5045 into matplotlib:main Sep 18, 2023
@rcomer
Copy link
Member
rcomer commented Sep 18, 2023

Congratulations on your first PR in Matplotlib @MarcBresson! We hope to hear from you again.

@MarcBresson
Copy link
Contributor Author

You are welcome!

I discovered warnings when my log file was a few mega bytes large.

There are 48 different warnings in matplotlib, but some of them are in not accessed functions (which is strange).

Here is an instance of not accessed function according to my pylance:

def _init_tests():
# The version of FreeType to install locally for running the
# tests. This must match the value in `setupext.py`
LOCAL_FREETYPE_VERSION = '2.6.1'
from matplotlib import ft2font
if (ft2font.__freetype_version__ != LOCAL_FREETYPE_VERSION or
ft2font.__freetype_build_type__ != 'local'):
_log.warning(
f"Matplotlib is not built with the correct FreeType version to "
f"run tests. Rebuild without setting system_freetype=1 in "
f"mplsetup.cfg. Expect many image comparison failures below. "
f"Expected freetype version {LOCAL_FREETYPE_VERSION}. "
f"Found freetype version {ft2font.__freetype_version__}. "
"Freetype build type is {}local".format(
"" if ft2font.__freetype_build_type__ == 'local' else "not "))

@QuLogic
Copy link
Member
QuLogic commented Sep 18, 2023

That is only accessible in certain build configurations.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0