Skip to content

Commit

Permalink
Follow Robert's suggestion
Browse files Browse the repository at this point in the history
  • Loading branch information
dachengx committed Jan 7, 2024
1 parent b624acc commit aca3c84
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions alea/parameters.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,10 +54,7 @@ def __init__(
self.ptype = ptype
self.relative_uncertainty = relative_uncertainty
self.uncertainty = uncertainty
if isinstance(blueice_anchors, str):
self.blueice_anchors = evaluate_numpy_scipy_expression(blueice_anchors).tolist()
else:
self.blueice_anchors = blueice_anchors
self.blueice_anchors = blueice_anchors
self.fit_limits = fit_limits
self.parameter_interval_bounds = parameter_interval_bounds
self.fit_guess = fit_guess
Expand Down Expand Up @@ -98,6 +95,22 @@ def uncertainty(self, value: Optional[Union[float, str]]) -> None:
)
self._uncertainty = value

@property
def blueice_anchors(self) -> Any:
"""Return the blueice_anchors of the parameter.
If the blueice_anchors is a string, it will be evaluated as a numpy or scipy function.
"""
if isinstance(self._blueice_anchors, str):
return evaluate_numpy_scipy_expression(self._blueice_anchors).tolist()
else:
return self._blueice_anchors

@blueice_anchors.setter
def blueice_anchors(self, value: Optional[Union[list, str]]) -> None:
self._blueice_anchors = value

@property
def fit_guess(self) -> Optional[float]:
"""Return the initial guess for fitting the parameter."""
Expand Down

0 comments on commit aca3c84

Please sign in to comment.