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

Restructure Custom Abundance Widget code #1784

Merged
merged 3 commits into from
Sep 17, 2021

Conversation

yuyizheng1112
Copy link
Contributor

@yuyizheng1112 yuyizheng1112 commented Aug 24, 2021

This PR aims to restructure the code of custom abundance widget as mentioned in #1777.

Description

  • Added CustomAbundanceWidgetData class to store the data which will be edited in the widget.
  • Used data attribute, a CustomAbundanceWidgetData instance, to organize data in CustomAbundanceWidget and DensityEditor.
  • Generated the CustomAbundanceWidget instance from a CustomAbundanceWidgetData instance.
  • Edited docstrings to fix docstring warnings in documentation building.
  • Fixed step graph for newly added element.

Motivation and context

Since the widget has integrated more information than before, the separation of the data and the widget enables the module more organized and easier to be developed and maintained. Also, it would be easier to implement tests as well as new TARDIS model in the future.

How has this been tested?

  • Testing pipeline.
  • Other.

Examples

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.

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

@codecov
Copy link

codecov bot commented Aug 24, 2021

Codecov Report

Merging #1784 (39d735f) into master (575002c) will decrease coverage by 0.06%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #1784      +/-   ##
==========================================
- Coverage   58.42%   58.35%   -0.07%     
==========================================
  Files          66       66              
  Lines        6684     6702      +18     
==========================================
+ Hits         3905     3911       +6     
- Misses       2779     2791      +12     
Impacted Files Coverage Δ
...s/tardis/visualization/widgets/custom_abundance.py 14.43% <0.00%> (+0.59%) ⬆️

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 575002c...39d735f. Read the comment docs.

@jamesgillanders jamesgillanders self-requested a review September 3, 2021 14:36
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.

LGTM - thanks for restructuring it.

The notebook works fine too, the error messages just don't show up correctly - not sure if it's related to 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.

I think it breaks add shells functionality

@jaladh-singhal jaladh-singhal merged commit fa42fbc into tardis-sn:master Sep 17, 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.

4 participants