-
Notifications
You must be signed in to change notification settings - Fork 44
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
feat: add overdetermined morphing #506
Conversation
Thanks for opening this! You can add the Lines 28 to 36 in dd223f8
There are currently a lot of empty lines getting removed, is this on purpose? It might be best to avoid this in this PR and do it separately in another one if it is a matter of just formatting. Can you reproduce the issue you saw with |
Yes, I can reproduce the error, this is the error message i got after running a new runner file in the docker environement. Code: Error: I think it can be solved by changing the utils/particle.py to a new name such as utils/particle1.py Also I realized that the morphing weights function and probably the gradient funciton also need to change due to refactor. I haven't change these functions yet, I'll try finish these tomorrow. |
The issue you see is due to running from within the from madminer.utils import morphing as m
if __name__ == "main":
a = m.PhysicsMorpher(parameter_max_power=[2, 2]) works fine. In order to be able to import the code in this fashion, while still being able to change the |
👋🏻 Hi @wangzhe04 Thank you for your contributions, they are highly appreciated :) Tuning in to ask for tests covering the modified PhysicsMorpher functions before marking this PR ready to review (as of now: |
Thank you! Thank you for your contributions as well! |
@alexander-held suggested in a meeting today that @wangzhe04 write some tests for the project that target the areas he's hoping to extend for his IRIS-HEP Fellow project in another PR. As @Sinclert has already pointed out, this will give the nice effect of both adding coverage in addition to giving a nice method to check to make sure that the changes @wangzhe04 makes are doing what are expected. 🙂 @wangzhe04 if you wanted to outline some of the ideas for this project in a GitHub Issue that might make it easier to step through some other parts later on in the review. |
Sure, I'll look into creating a Github Issue tomorrow, thanks! |
Changed to pull request#516 |
Hey @wangzhe04 . Thanks again for all the effort you are putting into this. Having tests for such a big change is crucial :) I am curious though, why are you moving changes to new branches, opening new PRs while closing previous ones? I am afraid conversation / context may be lost because of this dance. |
Oh, I saw the changes made in this PR are also showing in the new PR so I thought there is no need to keep this one. I'll reopen this one. Thank you for pointing out. |
I think this was a misunderstanding about the strategy, sorry I was probably not very clear about this. My proposal is getting tests for the existing functionality in first (which we can do via #516) and then use this PR to add the new functionality + expand the tests to cover the new additions. |
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 noticed the PR adding Morphing tests (#516) was directly merged from its draft state, so I decided to go ahead and provide feedback for this one despite its current state.
Once again, thanks for your contributions :)
I unmarked from draft before looking over it again and decided to go ahead since it was a straightforward PR in my view. If you prefer, I am happy to always wait for your explicit approval instead @Sinclert. Either way, this PR is bigger and we were planning on sending a request once all changes are done (which should be within the next day or two I think, thanks for already having a look!). |
remove accidental import on line3
Co-authored-by: Alexander Held <45009355+alexander-held@users.noreply.github.com>
Co-authored-by: Alexander Held <45009355+alexander-held@users.noreply.github.com>
Co-authored-by: Alexander Held <45009355+alexander-held@users.noreply.github.com>
Co-authored-by: Alexander Held <45009355+alexander-held@users.noreply.github.com>
Co-authored-by: Sinclert Pérez <Sinclert@hotmail.com>
Co-authored-by: Sinclert Pérez <Sinclert@hotmail.com>
Co-authored-by: Sinclert Pérez <Sinclert@hotmail.com>
In the new commit I included a function in the example notebook that it can check the minimum number of basis points input requires. Should we include that in the morphing.py as well? It's a simple function and independent function so probably can be added the easily |
That looks very useful to me! I think this would be a great addition to |
I added get_min_basis function and the tests and also updated the morphing_example.ipynb to use the built in one. There was a mistake and some format issues in the test_morphing.py I first commited but it should be fixed now. |
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.
This is probably the last batch of requested changes! I will approve this PR as soon as they are addressed.
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.
LGTM as it is! What do you think? @matthewfeickert @alexander-held
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.
This looks good to me, I have no other comments. Thank you very much for getting this ready and all the interactions on the PR!
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.
Taking a very quick look at this before lunch I think this is fine (added tests are very nice!). If I have any other comments I will open them up as separate Issues that can get resolved after this is merged. Thanks for the contributions @wangzhe04 and for @Sinclert and @alexander-held for the guidance here. 👍
Thanks everyone! I'll leave it to @Sinclert to hit merge. For future reference, @wangzhe04 will present this work done as an IRIS-HEP fellow also at a meeting tomorrow: https://indico.cern.ch/event/1195271/. |
feat: add overdetermined morphing
This pull request implements the following changes to morphing.py: