-
-
Notifications
You must be signed in to change notification settings - Fork 7.9k
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
base: main
Are you sure you want to change the base?
Conversation
This PR is ready for review! |
There was a problem hiding this 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.
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 |
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. |
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. |
Agreed, the code is somewhat simpler than |
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? |
@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. |
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 |
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 |
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
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:
|
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? |
Just go for it |
There was a problem hiding this 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....
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