feos-org / feos

FeOs - A Framework for Equations of State and Classical Density Functional Theory
Other
110 stars 22 forks source link

Make constructors in Parameter trait fallible #161

Closed g-bauer closed 1 year ago

g-bauer commented 1 year ago

Changes return types for constructor methods of Parameter to results. This is useful for parameters that contain assertions or have multiple, incompatible variants. Existing assertions/unwraps in implemented parameters have not been changed in this PR.

Since Parameter::subset is called on parameters that are usually created via the (now fallible) constructors, the method still returns the parameters without a results to keep the interfaces for property calculations clean. Added panic section to the doc strings.

prehner commented 1 year ago

Since these are breaking changes, it should be merged into development rather than main.