You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
There are a couple of simplifications I think that could be made to improve accessing materials. I think if the user wants to access a specific material contained in one of the json files included in the repo they should do so through a class method on Material rather than through the constructor itself. This would more or less work like so: import neutronics_material_maker as nmm eurofer = nmm.Material.from_library(material_name='eurofer', library='pnnl')
I think this would help make it clear that the material is coming from an external dataset. You could also make the default library='all' which would allow a user to only specify the material_name and search all the libraries by default.
Likewise, I think it would help to create constants in the nmm module like so `nmm.LIBRARIES = {dict with keys as library names and values as dictionaries of materials}.
Methods like nmm.get_available_materials() could be used to return a list of names or something
The last few points here are just thoughts and I'm happy to discuss it more, but the main point is separating the library access and constructor functions.
The text was updated successfully, but these errors were encountered:
Thanks Ethan, really appreciate the suggestions, it has been a while since this code was refactored and these are really nice suggestions. I shall get them done soon
There are a couple of simplifications I think that could be made to improve accessing materials. I think if the user wants to access a specific material contained in one of the json files included in the repo they should do so through a class method on
Material
rather than through the constructor itself. This would more or less work like so:import neutronics_material_maker as nmm eurofer = nmm.Material.from_library(material_name='eurofer', library='pnnl')
I think this would help make it clear that the material is coming from an external dataset. You could also make the default
library='all'
which would allow a user to only specify thematerial_name
and search all the libraries by default.Likewise, I think it would help to create constants in the
nmm
module like so `nmm.LIBRARIES = {dict with keys as library names and values as dictionaries of materials}.Methods like
nmm.get_available_materials()
could be used to return a list of names or somethingThe last few points here are just thoughts and I'm happy to discuss it more, but the main point is separating the library access and constructor functions.
The text was updated successfully, but these errors were encountered: