Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Adding PowerScale for PowerNorm #20355#20532
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 ourterms of service andprivacy 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?
Uh oh!
There was an error while loading.Please reload this page.
Conversation
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.
Thank you for opening your first PR into Matplotlib!
If you have not heard from us in a while, please feel free to ping@matplotlib/developers
or anyone who has commented on the PR. Most of our reviewers are volunteers and sometimes things fall through the cracks.
You can also join uson gitter for real-time discussion.
For details on testing, writing docs, and our review process, please seethe developer guide
We strive to be a welcoming and open project. Please follow ourCode of Conduct.
Hi@yacth. Thanks for contributing. As you can see, some of your tests are failing. To begin with, the test is complaining about formatting - clik on Linting/flake8 (pull_request) for more details. From thecontributing documents it recommends to do the following to your code:
which ensures formatting is done correctly. Secondly, its also complaining about needing tests for the added features, as per the website linked above:
Its also important to make sure you run some tests before to make sure your changes are not breaking other features, seetesting. For the implementation details, you will have to wait for some of the other developers to review it. But it greatly helps to make sure the previous tests passed, so the conversation can focus on implementation itself. |
Thank you for your review. Actually since it is rewritting the original feature in another way I thought that letting the old tests should be good enough. |
@yacth if the old tests fail then you changed the behaviour with your changes and the new code needs to be fixed, or you need to argue that the changes you made are an improvement and rewrite the tests. |
I am working on the code, but I am stuck. I am trying some testings using a simple code : importmatplotlib.scaleasscalescale.PowerScale(10,0.5) I get the following error : TypeError:__init__()takes2positionalargumentsbut3weregiven Which I don't understand. |
Uh oh!
There was an error while loading.Please reload this page.
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 did the changes to solve the errors related to thePowerNorm
calculations even if there is still theset_default_locators_and_formatters
in thePowerScale
class is still to be determined.
I had this error:
lib/matplotlib/tests/test_axes.py::test_pcolor_regression
But by running what is inside line by line on my local environment I don't have a failure, I don't get it:
frompandas.plottingimport (register_matplotlib_converters,deregister_matplotlib_converters, )fig=plt.figure()ax=fig.add_subplot(111)times= [datetime.datetime(2021,1,1)]whilelen(times)<7:times.append(times[-1]+datetime.timedelta(seconds=120))y_vals=np.arange(5)time_axis,y_axis=np.meshgrid(times,y_vals)shape= (len(y_vals)-1,len(times)-1)z_data=np.arange(shape[0]*shape[1])z_data.shape=shapetry:register_matplotlib_converters()im=ax.pcolormesh(time_axis,y_axis,z_data)# make sure this does not raise!fig.canvas.draw()finally:deregister_matplotlib_converters()
this might be silly, but can you double check which version of matplotlib and which branch you're testing against? |
@yacth, this is looking close. Suggest you rebase on master, that should fix your build error. This does need tests and documentation as well if you are up for it. It is hard to tell if it is working without those. |
I did a rebase, hope this will solve the failing tests. Sure I will investigate the tests. But first I have some questions about the |
@yacth I've not been following this PR closely. Did you spell out the locator/formatter issues? I can imagine they are a bit thorny as there is not a natural locator for the Power Scale. Perhaps best so see how it has been used in other contexts and copy. |
Hi@yacth - are you interested in continuing this work? If so, please mark the PR as ready for review and let us know if you need help with the rebase, we haveinstructions for that here. Thanks! |
Uh oh!
There was an error while loading.Please reload this page.
PR Summary
As per the issue#20355 requirements, I added the
PowerScale
andPowerTransform
andInvertedPowerTransform
in thescale.py
file following the architecture of the log norm.I am willing to discuss the
sef_default_locators_and_formatters
function to set the right Locator and Formatter of the scale.I am waiting for a review on my code and improve it if needed.
PR Checklist
pytest
passes).flake8
on changed files to check).flake8-docstrings
and runflake8 --docstring-convention=all
).doc/users/next_whats_new/
(follow instructions in README.rst there).doc/api/next_api_changes/
(follow instructions in README.rst there).