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

Changing multimaterial json #136

Merged
merged 16 commits into from
Apr 18, 2021
Merged

Changing multimaterial json #136

merged 16 commits into from
Apr 18, 2021

Conversation

shimwell
Copy link
Collaborator

@shimwell shimwell commented Apr 17, 2021

Relating to recent issues #135 #134 #133 #129

This PR improves and simplifies the code in a few ways. In general there were some cases where the user could do things in a couple of different ways and it would not be clear which was the final output.

For example:

  • setting desity via the density attribtue and density_euqation attribute can lead to conflicting values.
  • Making a Material with a name that matches the internal database could lead to unpredicatble results

Removes unused keys in the database for packable and enrichable
Removes density_equation attribute and allows density to accept a string input which is evaluated as an equation
Adds the nmm.Material.from_library() method for clearing making materials from the internal dictionary / database. This can be extented to be enhanced in the future regarding which database to retrieve.
Removes MultiMaterial() class and replaces it with nmm.Material.from_mixutre()

TODO

  • The docs will need updating after this goes into the main branch
  • new video for the docs
  • refactor methods of reading in material files and add tests

@codecov
Copy link

codecov bot commented Apr 17, 2021

Codecov Report

❗ No coverage uploaded for pull request base (develop@22be01e). Click here to learn what that means.
The diff coverage is 71.42%.

Impacted file tree graph

@@            Coverage Diff             @@
##             develop     #136   +/-   ##
==========================================
  Coverage           ?   91.44%           
==========================================
  Files              ?        3           
  Lines              ?      538           
  Branches           ?        0           
==========================================
  Hits               ?      492           
  Misses             ?       46           
  Partials           ?        0           
Impacted Files Coverage Δ
neutronics_material_maker/utils.py 82.48% <24.00%> (ø)
neutronics_material_maker/material.py 94.31% <84.88%> (ø)
neutronics_material_maker/__init__.py 100.00% <100.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 22be01e...032d679. Read the comment docs.

@shimwell shimwell merged commit 4618f9f into develop Apr 18, 2021
@shimwell shimwell deleted the changing_multimaterial_json branch April 18, 2021 01:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant