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

CoolProp not imported #27

Open
RemDelaporteMathurin opened this issue Jun 20, 2022 · 1 comment
Open

CoolProp not imported #27

RemDelaporteMathurin opened this issue Jun 20, 2022 · 1 comment

Comments

@RemDelaporteMathurin
Copy link
Member

With NMM 1.1.1, running this produces a ModuleNotFoundError.

I suppose it's somehow related to #26

import neutronics_material_maker as nmm

entry = {
    "chemical_equation": "H2O",
    "density": "PropsSI('D', 'T', temperature, 'P', pressure, 'Water')/1000.",
    "density_unit": "g/cm3",
    "comment": "CoolProp python package",
    "percent_type": "ao",
    "material_id": None,
}
nmm.Material(name="H2O", **entry)

running pip install CoolProp seems to fix it.

But then, I have the following error:

  File "/home/fusion-neutronics-workflow/MWE.py", line 11, in <module>
    nmm.Material(name="H2O", **entry)
  File "/opt/conda/lib/python3.9/site-packages/neutronics_material_maker/material.py", line 199, in __init__
    self._make_openmc_material()
  File "/opt/conda/lib/python3.9/site-packages/neutronics_material_maker/material.py", line 645, in _make_openmc_material
    openmc_material = self._add_density(openmc_material)
  File "/opt/conda/lib/python3.9/site-packages/neutronics_material_maker/material.py", line 768, in _add_density
    raise ValueError(
ValueError: Material.temperature is needed to calculate the density

I suppose that's normal though

@shimwell
Copy link
Member

Might be solved by a modified pip install

Pip install neutronics-material-maker[density]

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

No branches or pull requests

2 participants