Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Rename evans_test.py example for Foo units class and conversion #30104

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

Open
wants to merge 2 commits into
base: main
Choose a base branch
Loading
from

Conversation

livlutz
Copy link

@livlutz livlutz commented May 24, 2025

PR summary

This pull request includes changes in a test file previously named evans_test.py, now renamed to test_evans.py so it is in a more acceptable format for pytest while keeping its headings and purpose.

closes #23281

PR checklist

@github-actions github-actions bot added the Documentation: examples files in galleries/examples label May 24, 2025
@livlutz
Copy link
Author

livlutz commented May 24, 2025

This PR is ready for review!

Copy link
Member

@jklymak jklymak left a comment

Choose a reason for hiding this comment

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

I agree this name is pretty mysterious, but it is not a pytest test so this change isn't any better. I would consider naming it something like Unit Conversion for a Class.

@livlutz
Copy link
Author

livlutz commented May 24, 2025

Thanks for the feedback and yes it is indeed not a pytest test so I decided to name it like the suggestion, please do tell me if it is alright now or if I need to come up with a better name

@rcomer
Copy link
Member

rcomer commented May 25, 2025

My reading of the issue is that we should remove this file, and the other two examples with "test" in the filename. But before removing them, we should check if they are actually testing anything that is not covered by our unit tests, and if so adapt them into unit tests.

@story645
Copy link
Member

story645 commented May 25, 2025

is that we should remove this file

I really don't think we should remove this file b/c it's probably the cleanest example of writing a custom unit (data type) convertor.

I think maybe all the other units examples use basic_units.py, which is a toy units library, to demo the units functionality rather than show how to write units.

@timhoffm
Copy link
Member

it's probably the cleanest example of writing a custom unit (data type) convertor.

Agreed, the code is somewhat simpler than basic_units.py, but that's a very low bar. Frankly, from reading the text I only get a very vague idea on what the example may be about and that does not include "writing a custom unit (data type) convertor." There's a lot of implied knowledge. Title and text would need a complete overhaul. I may also a good idea to turn this more into a tutorial.

@livlutz
Copy link
Author

livlutz commented May 25, 2025

Should we change it into a tutorial then? If so how exactly would that work? Or maybe we should keep it as it is and just add a few comments just for clarification?

@story645
Copy link
Member

story645 commented May 25, 2025

@livlutz by tutorial, it would be breaking up that example into sections and explaining each piece - this piece is writing a custom unit, this piece is writing a custom convertor, this is how it's put together, which makes it so you can write the plotting commands at the bottom.

But also, I think next steps here might have to be taken by someone who understands the somewhat niche topic of our unit conversion system. If you'd like to work on an example, I think #30026 might be more accessible. Just tag me and I'll review it.

@jklymak
Copy link
Member

jklymak commented May 25, 2025

This could still be renamed and retitled - both would be an improvement over "Evan's Test" (no disrespect to whoever Evan is) even if the example should be fixed or moved

@livlutz
Copy link
Author

livlutz commented May 25, 2025

oh no I am sorry for the last commits, I started to work on the issue @story645 suggested and I think it all ended up here, I'm looking for a way to reverse it...or maybe someone could take a look at both changes or maybe help me out with this

@story645
Copy link
Member

story645 commented May 25, 2025

I'm looking for a way to reverse it

There's probably a more streamlined way to do this but this is I think the most straightforward:

git checkout upstream main
git checkout -B histogram_colorgram
git cherry-pick c81072f5c296f303f02164b84db72032c14f9f7f
git push

What's happening in the above is you're making a new feature branch off main for the histogram colormap and then moving just the commit making that example to the histogram_colormap branch.

Then you can checkout this branch again and push. You may need to also drop this commit from this branch, which then means

git checkout main
git rebase -i upstream main

and depending on your code editor you'll see an option to drop this commit.

Also, strongly urge you to read our contributor guide, particularly on:

@livlutz
Copy link
Author

livlutz commented May 25, 2025

thanks a lot, I already found a way to do it btw if I want to open a PR to the other issue should I just do it from the other branch or should I wait until this PR is finished?

@story645
Copy link
Member

should I just do it from the other branch or should I wait until this PR is finished?

Just go for it

Copy link
Member

@jklymak jklymak left a comment

Choose a reason for hiding this comment

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

The title of the actual example should also be changed....

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Documentation: examples files in galleries/examples
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[MNT]: Remove examples with test in name and create actual tests if useful
5 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.