-
-
Notifications
You must be signed in to change notification settings - Fork 409
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
Grotrian Diagram Plot Appearance #2313
Grotrian Diagram Plot Appearance #2313
Conversation
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
*beep* *bop* Hi, human. I'm the @tardis-bot and couldn't find your records in my database. I think we don't know each other, or you changed your credentials recently. Please add your name and email to In case you need to map an existing alias, follow this example. |
c424c4e
to
913f8a1
Compare
Some comments on the current behaviour:
|
6b3fc35
to
fe72017
Compare
Although I have marked this ready to review, the code for shell-wise populations/transition depends on changes in MontecarloTransport to track last line interaction shell IDs. These changes make the shell ID information flow more naturally for our use. Once that PR gets merged to master, then it's just a matter of rebasing this work on master. Meanwhile, reviewers please review the files |
Codecov Report
@@ Coverage Diff @@
## master #2313 +/- ##
==========================================
- Coverage 72.02% 70.52% -1.50%
==========================================
Files 137 138 +1
Lines 12463 12800 +337
==========================================
+ Hits 8976 9027 +51
- Misses 3487 3773 +286
... and 1 file with indirect coverage changes 📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
…d of global min and max
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.
Nice work Ayushi! I've left a few comments that I think should be addressed before we merge. Some more points below.
-
My main comment is that there are still some hard coded options, e.g. He, and this causes the diagram to crash when that ion isn't in the model. We need to remove all hard coded things like that and make it so that the user is required to input an ion when making the plot. We can't assume any ion will be present in the model.
-
Running the diagram locally, I also get an issue with the arrows not rendering correctly. A screenshot is attached here.
-
I tried changing the y_scale option between linear and log for He I using e.g.
diag.y_scale = 'Log'
diag.display()
The figure didn't update though. Either that or the changes were very small? It did update for O I. Can you have a look into that? -
Updating the colour scale using "diag.colorscale = ..." only changes the colour bar, not the arrows. Similarly, if I set e.g. max_wavelength first, before setting the ion, the colours don't take it into account.
-
Some other options I think are currently set up to work with the widgets in the future, but don't work right now. Maybe I'm wrong, but I couldn't see a way to change e.g. max_levels. This functionality should still be in there so one could set it manually.
@MarkMageeAstro Thanks for the detailed review! 😄 Here are my responses to some of your comments:
Sure, I'll make it mandatory to set the ion, otherwise diag.diaplay() will just throw an appropriate error message.
This is quite weird. I looked into this and it seems that this happens when I run the notebook on VSCode. However, when I start a Jupyter server and run on browser, the arrowheads render as expected. Is this issue happening with you on VSCode (or your IDE) as well?
It is updating, the changes are just very small for He I.
My bad! I'll check this right away!
Yeah I intend to integrate all options with widgets eventually. And yes, you're right, changing the options you mentioned doesn't work right now. I'll make changes so that the user can change these options by settings them directly for now. |
@AyushiDaksh, thanks for the quick response.
Yes, this is with VSCode, but it's a new issue. Older versions seemed to be fine. I ran previous versions of the code in VSCode and the arrows rendered fine there. You can see in some of the older screenshots I sent to the slack
Okay, good, thanks for checking. |
Hmm, then maybe some of my recent changes caused that, and the issue went unnoticed by me because I was using browser for my Jupyter notebooks. Will check this out.
This was intended. Because going forward, the ion selection and wavelength setting will be part of widgets. And I was of the opinion that if the user changes the ion, the wavelength range should reset to default (and the user can set that again if they want). |
- Allow 'colorscale' to be changed by user - Fixed the access specifiers of editable attributes vs non-editable attributes
This has been fixed. User is required to set the ion explicitly now, otherwise plotting will throw an appropriate error.
This has been fixed. |
Hi @MarkMageeAstro ! |
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.
Fantastic work as always @AyushiDaksh! Mark has done a thorough review and you have implemented everything needed to resolve these -- I have added a few minor comments regarding your code comments, but the code itself is done in my opinion!
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 great work Ayushi! I am happy with all the updates and resolutions to all the comments raised by me and the other reviewers. Approved!
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.
Great work @AyushiDaksh ! I really like the result!
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.
Thanks for making the changes, @AyushiDaksh. I think you addressed all of the previous comments I had. I do have one more that I found from running the latest version of the code.
Say I make a diagram for an ion that's in the model. If I then try to change it to an ion that isn't in the model, it crashes. That's fine. After that though, if I run diag.display() again the old ion is shown, but the title changes to the new ion (that isn't in the model). I could imagine this could cause some confusion or inconsistencies. Maybe we should add something so that in the event that it crashes (i.e. by selecting an ion that isn't in the model) then it resets/removes all the plot data? Basically you'd be starting over the next time you run it then.
For example:
diag = GrotrianWidget.from_simulation(sim)
diag.set_ion(2, 0) # He I
diag.display()
Running
diag.set_ion(23, 0) # V I (which isn't in the model)
diag.display()
crashes the code, but then running display again produces the sample plot, except for the title.
Head branch was pushed to by a user without write access
@MarkMageeAstro I have made all such operations atomic now. If an error is thrown while setting any physical property (like atomic_number, ion_number, shell), an appropriate error message is shown, and the settings revert to the previous settings |
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.
Thanks @AyushiDaksh, this fixed my previous comment
📝 Description
This PR is part of the Grotrian Diagram project, part of Google Summer of Code 2023. Project description and related PRs/Issues can be found on the project page.
This PR aims to discuss and finalize the look and feel of the Grotrian Diagram plot. Discussions/commits related to the appearance of the plot should be placed here.
Type: 🚀
feature
📌 Resources
Project Link: https://github.com/users/AyushiDaksh/projects/1
Idea Link: https://tardis-sn.github.io/gsoc_2023/ideas/
GSoC Project Link: https://summerofcode.withgoogle.com/programs/2023/projects/HxymUMRe
🚦 Testing
How did you test these changes?
☑️ Checklist
build_docs
label