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

Convert quantities to arrays when plotting in SDEC plot #1832

Merged
merged 2 commits into from
Dec 2, 2021

Conversation

atharva-2001
Copy link
Member

@atharva-2001 atharva-2001 commented Nov 26, 2021

This fixes the docs build that was caused due to the new matplotlib release.

Description

Using quantities with matplotlib's fill_between method was causing an error. This PR changes quantities to arrays, just when plotting, everywhere in the SDEC plot so that no problems arise later as well.

Motivation and context

How has this been tested?

  • Testing pipeline.
  • Other.

Examples

Link to a failed documentation build
working docs build
Type of change

  • Bug fix.
  • New feature.
  • Breaking change.
  • None of the above.

Checklist

  • My change requires a change to the documentation.
    • I have updated the documentation accordingly.
    • (optional) I have built the documentation on my fork following the instructions.
  • I have assigned and requested two reviewers for this pull request.

@codecov
Copy link

codecov bot commented Nov 26, 2021

Codecov Report

Merging #1832 (0382a34) into master (c34beca) will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #1832   +/-   ##
=======================================
  Coverage   58.04%   58.04%           
=======================================
  Files          66       66           
  Lines        6747     6747           
=======================================
  Hits         3916     3916           
  Misses       2831     2831           

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 c34beca...0382a34. Read the comment docs.

@atharva-2001 atharva-2001 mentioned this pull request Nov 30, 2021
10 tasks
@atharva-2001 atharva-2001 changed the title Use Astropy quantity support in SDEC plots Convert quantities to arrays when plotting in SDEC plot Dec 1, 2021
@atharva-2001 atharva-2001 marked this pull request as ready for review December 1, 2021 15:17
@tardis-bot
Copy link
Contributor

Before a pull request is accepted, it must meet the following criteria:

  • Is the necessary information provided?
  • Is this a duplicate PR?
    • If a new PR is clearly a duplicate, ask how this PR is different from the original PR?
    • If this PR is about to be merged, close the original PR with a link to this new PR that solved the issue.
  • Does it pass existing tests and are new tests provided if required?
    • The test coverage should not decrease, and for new features should be close to 100%.
  • Is the code tidy?
    • No unnecessary print lines or code comments.

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.

this fixes the problem, but do we want to do this, or pin the matplotlib version?

@isaacgsmith
Copy link
Member

this fixes the problem, but do we want to do this, or pin the matplotlib version?

We definitely want this. Pinning the matplotlib version was a backup in case this problem was not easy enough to fix.

Copy link
Member

@isaacgsmith isaacgsmith left a comment

Choose a reason for hiding this comment

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

My only concern here is do we allow users to use different units when plotting? And either way, we should probably have the units printed on the axes, something like this.

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.

Thanks!

@jaladh-singhal
Copy link
Member

My only concern here is do we allow users to use different units when plotting? And either way, we should probably have the units printed on the axes, something like this.

I think that we infer unit to be shown on axes from quantity. If not, then that's case for another issue/PR @smithis7 @atharva-2001 - it's out of scope for this PR.

@isaacgsmith isaacgsmith self-requested a review December 2, 2021 18:11
Copy link
Member

@isaacgsmith isaacgsmith 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

@andrewfullard andrewfullard merged commit f52044a into tardis-sn:master Dec 2, 2021
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.

6 participants