Skip to content
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

Fixed italicised Units in sdec_plot #1446

Merged
merged 3 commits into from
Feb 12, 2021

Conversation

DhruvSondhi
Copy link
Contributor

This PR tries to Fix #1445

Description

Changed the labels to as to match the comment as mentioned

Motivation and Context

Fixes #1445

How Has This Been Tested?

  • Testing pipeline
  • Reference Data Comparison following these instructions
  • Other (please describe)

Local Changes

Screenshots (if appropriate):

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • None of the above (please describe)

Checklist:

  • My code follows the code style of this project
  • My change requires a change to the documentation
  • I have updated the documentation accordingly
  • I have built the documentation on my fork following these instructions
  • I have assigned and requested two reviewers for this pull request

@codecov
Copy link

codecov bot commented Feb 2, 2021

Codecov Report

Merging #1446 (7947f9a) into master (b9ab7c8) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1446   +/-   ##
=======================================
  Coverage   71.13%   71.13%           
=======================================
  Files          67       67           
  Lines        5523     5523           
=======================================
  Hits         3929     3929           
  Misses       1594     1594           
Impacted Files Coverage Δ
tardis/tardis/widgets/sdec_plot.py 16.28% <0.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update b9ab7c8...7947f9a. Read the comment docs.

@jaladh-singhal
Copy link
Member

@DhruvSondhi thanks for this - can you show the screenshots comparing how plot looks like before & after these changes?

@DhruvSondhi
Copy link
Contributor Author

DhruvSondhi commented Feb 2, 2021

Hello @jaladh-singhal ... I am afraid that I don't know the code where I can check this plot ... Can you please share a boilerplate test code or please guide me where I can find the same so that I can plot this graph 😄
PS: I ran the tests & reformated code & hence found not issues :)

@DhruvSondhi
Copy link
Contributor Author

DhruvSondhi commented Feb 3, 2021

Hello, I found the way to make the plot but I am facing an issue with the quickstart data set & representation. The error seems to be something related to Pandas not able to pass a key in a list format. [Check this link for the error which is KeyError]
Check this Gist out ... Please do advise how I can rectify this? 🤔

@jaladh-singhal
Copy link
Member

jaladh-singhal commented Feb 3, 2021

Hello @jaladh-singhal ... I am afraid that I don't know the code where I can check this plot ... Can you please share a boilerplate test code or please guide me where I can find the same so that I can plot this graph smile

Sorry for late reply. I'm actually working on adding a demo notebook for SDEC plot, you can download and use it from here

Hello, I found the way to make the plot but I am facing an issue with the quickstart data set & representation. The error seems to be something related to Pandas not able to pass a key in a list format. [Check this link for the error which is KeyError]
Check this Gist out ... Please do advise how I can rectify this?

@DhruvSondhi this seems strange. I hope you're using the latest tardis codebase and using development installation by python setup.py develop? Also if you have ran quickstart notebook before sucessfully, can you compare between what is different in your development environment now?

@DhruvSondhi
Copy link
Contributor Author

DhruvSondhi commented Feb 3, 2021

Thank you very much @jaladh-singhal for the reply 😄 ... Yes I do seem so this is a problem and I have opened an issue #1447 ... Please check this issue out :)
Update: Fixed by downgrading Python version to 3.7 ... Thanks to @jamesgillanders :)

@DhruvSondhi
Copy link
Contributor Author

Also, I have found some more issues which are not that important but are present so I will discuss in another issue 😉

@DhruvSondhi

This comment has been minimized.

@DhruvSondhi
Copy link
Contributor Author

DhruvSondhi commented Feb 4, 2021

@jaladh-singhal Also, there is a minor change in the notebook
Instead of

from tardis.widgets import SEDecPlotter

It should be

from tardis.widgets import SDECPlotter

in this notebook

@DhruvSondhi
Copy link
Contributor Author

DhruvSondhi commented Feb 6, 2021

Hello @jaladh-singhal, I got it working at last ... I do suggest a change which is that this line:
image
be at the top of the cell execution than at the bottom of the execution as it is very easy to skim over unnoticed 😄
{PS: Please change the virt_packet_logging: True to virtual_packet_logging: True in the above code snippet }

@DhruvSondhi
Copy link
Contributor Author

DhruvSondhi commented Feb 6, 2021

So atlas, @jaladh-singhal these are the screenshots (And yes they are awesome 😉 , thanks to @jamesgillanders)

[Luminosity]
Before:
image
After:
image

[Flux]
Before:
image
After:
image

{Fixed this in the commit below PS: that italics F(lambda) & L(lambda) are due to that lambda passed ... I can try to fix them too but I am not sure about them 😓 }

@jaladh-singhal
Copy link
Member

@DhruvSondhi regarding your suggestions of SDECPlotter and of virtual_packet_logging, good catch! They have already been accounted in #1438 since I told you I was working on this notebook - you can access them if you re-download the notebook now.

@jaladh-singhal
Copy link
Member

Hello @jaladh-singhal, I got it working at last ... I do suggest a change which is that this line:
image
be at the top of the cell execution than at the bottom of the execution as it is very easy to skim over unnoticed 😄

@jamesgillanders @ycamacho do you think we should move it above, i.e. before run_tardis() cell?

@jaladh-singhal
Copy link
Member

@DhruvSondhi the screenshots look good. @jamesgillanders can you double check that you wanted Luminosity instead of L_{\lambda} and same for flux (rest looks good to me)?

@jaladh-singhal
Copy link
Member

Note: @jamesgillanders don't merge it until #1438 is merged and @DhruvSondhi rebases this PR

@DhruvSondhi
Copy link
Contributor Author

Note: @jamesgillanders don't merge it until #1438 is merged and @DhruvSondhi rebases this PR

Sure I can do that ... No issues 😄

Copy link
Member

@jamesgillanders jamesgillanders left a comment

Choose a reason for hiding this comment

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

See comments in code - the only that this PR should be changing is the italicised units in the x and y axes. Leave the F_lambda and L_lambda as is

@@ -876,10 +876,14 @@ def generate_plot_mpl(
self.ax.set_xlabel(r"Wavelength $[\AA]$", fontsize=12)
Copy link
Member

Choose a reason for hiding this comment

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

this x-axis unit is still italicised

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, I will do that too but the problem didn't seem to occur in the X-axis though I will hard code it that way :)

@@ -876,10 +876,14 @@ def generate_plot_mpl(
self.ax.set_xlabel(r"Wavelength $[\AA]$", fontsize=12)
if distance: # Set y-axis label for flux
self.ax.set_ylabel(
r"$F_{\lambda}$ [erg/s/cm^{2}/$\AA$]", fontsize=12
r"Flux [erg $\mathrm{s^{-1}}$ $\mathrm{cm^{-2}}$ $\mathrm{\AA^{-1}}$]",
fontsize=12,
Copy link
Member

Choose a reason for hiding this comment

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

There seems to be some confusion about what to change on the axis labels - I didn't help things with a vague comment, but I am not proposing any change to the actual label - just that the Angstrom unit is no longer italicised. The comment posted was just grabbed from one of my programs illustrating how to use mathrm. Can this be reverted back to F_lambda?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, No Issues but the F_lambda & L_lambda will be italicised ... I will update the screenshots with the same :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Flux
image

self.ax.set_ylabel(
r"Luminosity [erg $\mathrm{s^{-1}}$ $\mathrm{\AA^{-1}}$]",
fontsize=12,
)
Copy link
Member

Choose a reason for hiding this comment

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

Same as above - roll back to L_lambda

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sure, No problems :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Luminosity
image

@jamesgillanders
Copy link
Member

@jaladh-singhal - I have no strong opinions on where exactly the virtual_packet_logging flag should appear. Whatever you think is most suitable is fine.

@DhruvSondhi
Copy link
Contributor Author

DhruvSondhi commented Feb 8, 2021

Just pushing changes ... this looks awesome & good to go :)
{PS: Do I need to squash the chances? 🤔}

Copy link
Member

@jamesgillanders jamesgillanders left a comment

Choose a reason for hiding this comment

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

the code modifications fix the flagged issue - happy for it to be merged, pending second review

@DhruvSondhi
Copy link
Contributor Author

DhruvSondhi commented Feb 12, 2021

Hello @jamesgillanders & @jaladh-singhal , I have rebased this branch upon the updated master ... Please check & confirm the same 😄

Copy link
Member

@jaladh-singhal jaladh-singhal left a comment

Choose a reason for hiding this comment

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

Looks good to me!

@jaladh-singhal jaladh-singhal merged commit b2b6a6f into tardis-sn:master Feb 12, 2021
@DhruvSondhi DhruvSondhi deleted the italics-unit branch March 11, 2021 05:59
atharva-2001 pushed a commit to atharva-2001/tardis that referenced this pull request Oct 1, 2021
* Fixed italicised Units in sdec_plot

* Fixed Italics Luminosity & Flux Lambda representation

* Reverted back to old notation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove italicised units in labels of SDEC plot in matplotlib
3 participants