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

DOC: document pytest-mpl update workflow #4418

Merged
merged 3 commits into from
Jan 4, 2024

Conversation

neutrinoceros
Copy link
Member

PR Summary

Complements #4122, partially adresses #4415

note to reviewers: this workflow may seem very cumbersome (it is), but it's not new.
In fact it is extremely close to what we were doing even before #4122, it just happens that this process was never properly documented.

Opening as a draft for now because I need to come back and update the How to Write Image Comparison Tests section too.

Comment on lines 354 to 372
There are 3 situations where updating baseline images may be necessary

- bugfixes
- intentional change of style in yt
- old baseline fails with a new version of matplotlib, but changes are not noticeable to the human eye
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm blanking this morning and can't remember... do you also do all this when adding a new answer test? or is this only when modifying existing answer tests?

Copy link
Member Author

@neutrinoceros neutrinoceros Nov 16, 2023

Choose a reason for hiding this comment

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

The process is intentionally very similar indeed. Adding new answers or updating existing one is basically the same workflow.

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh -- my initial question was vague. What I meant to ask was whether you need to submit the PR to the answer repo when adding a new image test (since this section is about "updating" images). And the answer is obviously yes now that I've done that :) I assume that'll be mentioned up above in the TODO section? Or maybe this section should change from "Updating Image Baselines" to "Updating or Adding New Image Baselines"?

Copy link
Member Author

Choose a reason for hiding this comment

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

yes this is what I intended to write where the TODO placeholder is, but I think I could never decide what to do about the generic_image documentation that we have now, because I never used it and I generally would like to stay away from answer tests as I've had bad experiences trying to debug some.
Anyway, it's a shame that I could never finish this PR as it's clearly needed. If you'd like to take over, be my guest. At a minimum I would need some feedback about my TODO (@matthewturk ?).

@@ -287,6 +287,8 @@ Answer test examples can be found in ``yt/frontends/enzo/tests/test_outputs.py``
How to Write Image Comparison Tests
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

TODO(#4415): update this section (maybe keep the old content but add a note for why it's out of date)
Copy link
Member

Choose a reason for hiding this comment

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

I think that would be great. Even just a warning callout with a link to the section below would work.

Copy link
Member Author

Choose a reason for hiding this comment

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

I just realised that generic_image is actually not used at all anymore. I think we should just deprecate it, so I'll write the warning accordingly.

@neutrinoceros neutrinoceros added the deprecation deprecate features or remove deprecated ones label Dec 20, 2023
@neutrinoceros neutrinoceros added this to the 4.4.0 milestone Dec 20, 2023
@neutrinoceros
Copy link
Member Author

@yt-fido test this please

@neutrinoceros neutrinoceros marked this pull request as ready for review December 21, 2023 12:26
@neutrinoceros
Copy link
Member Author

@matthewturk and @chrishavlin, I hope you're up to review this

@chrishavlin chrishavlin self-requested a review December 21, 2023 17:26
Copy link
Contributor

@chrishavlin chrishavlin left a comment

Choose a reason for hiding this comment

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

Looks good to me.

But how about moving the new "Creating and Updating Image Baselines ..." section up above the now deprecated "How to Write Image Comparison Tests" section so that the current approach shows up first?

doc/source/developing/testing.rst Outdated Show resolved Hide resolved
chrishavlin
chrishavlin previously approved these changes Jan 2, 2024
@chrishavlin
Copy link
Contributor

@matthewturk , you wanna take another look at this one? IMO it's ready to be merged.

matthewturk
matthewturk previously approved these changes Jan 3, 2024
Copy link
Member

@matthewturk matthewturk left a comment

Choose a reason for hiding this comment

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

only one optional comment

doc/source/developing/testing.rst Show resolved Hide resolved
@neutrinoceros neutrinoceros dismissed stale reviews from matthewturk and chrishavlin via 31c43a4 January 4, 2024 08:08
@matthewturk matthewturk merged commit a2d49ea into yt-project:main Jan 4, 2024
14 checks passed
@neutrinoceros neutrinoceros deleted the doc_pytest_mpl branch January 4, 2024 12:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
deprecation deprecate features or remove deprecated ones docs
Projects
Development

Successfully merging this pull request may close these issues.

3 participants