openmc-data-storage / openmc_data_downloader

A Python package for downloading h5 cross section files for use in OpenMC.
MIT License
11 stars 2 forks source link

now raising import errors #18

Closed shimwell closed 3 years ago

shimwell commented 3 years ago

Some functions (expand_materials_to_sabs and expand_materials_to_isotopes make use of openmc.

They currently continue and return None when the import openmc fails

This PR makes use of those function fail with Import Errors when openmc is not found

The PR also reduces the calling of these functions so that they are not called when not needed by the just_in_time_library_generator function. Currently they are always called even if there are no materials to expand

codecov[bot] commented 3 years ago

Codecov Report

Merging #18 (ca8308b) into main (59f4070) will not change coverage. The diff coverage is 0.00%.

:exclamation: Current head ca8308b differs from pull request most recent head 7c7abb9. Consider uploading reports for the commit 7c7abb9 to get more accurate results Impacted file tree graph

@@           Coverage Diff           @@
##             main      #18   +/-   ##
=======================================
  Coverage   94.87%   94.87%           
=======================================
  Files           4        4           
  Lines         371      371           
=======================================
  Hits          352      352           
  Misses         19       19           
Impacted Files Coverage Δ
openmc_data_downloader/utils.py 92.30% <0.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 59f4070...7c7abb9. Read the comment docs.