idaholab / raven

RAVEN is a flexible and multi-purpose probabilistic risk analysis, validation and uncertainty quantification, parameter optimization, model reduction and data knowledge-discovering framework.
https://raven.inl.gov/
Apache License 2.0
217 stars 133 forks source link

[TASK] Add additional error handling for C++ module imports to be able to run RAVEN without building RAVEN #2220

Open j-bryan opened 9 months ago

j-bryan commented 9 months ago

Issue Description

Is your feature request related to a problem? Please describe. With recent changes to RAVEN to decrease dependence on certain C++ modules, it should be possible to run many RAVEN capabilities without building RAVEN. However, some module imports break when RAVEN is run without building. It would be nice to be able to use RAVEN capabilities that are pure Python without needing to build RAVEN first.

Describe the solution you'd like Add additional handling of imports that fail when RAVEN hasn't been built. Crow imports appear to be the most common problem, but other modules (e.g. AMSC) may cause similar issues. Additional handling of crow imports in the relevant util functions should handle the failing crow imports throughout RAVEN.

Describe alternatives you've considered Lazy imports could be used instead of top-level imports so that the import fails only when the module would be used in a class or function. This type of handling must be done at every instance of failing imports.


For Change Control Board: Issue Review

This review should occur before any development is performed as a response to this issue.


For Change Control Board: Issue Closure

This review should occur when the issue is imminently going to be closed.