Skip to content

Commit

Permalink
Merge pull request #1649 from Anselmoo/Anselmoo/issue1648
Browse files Browse the repository at this point in the history
fix: ✏️ correct spelling of 'computional' to 'computational' in multiple files
  • Loading branch information
Anselmoo authored Oct 15, 2024
2 parents 9c2920a + 88e2691 commit b27b1a9
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 17 deletions.
4 changes: 2 additions & 2 deletions spectrafit/api/report_model.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,9 +107,9 @@ class SolverAPI(BaseModel):
default={},
description="Error bar comment if values reach initial value or boundary",
)
computional: Dict[str, Any] = Field(
computational: Dict[str, Any] = Field(
...,
description="Computional information like number of function evaluations",
description="Computational information like number of function evaluations",
)


Expand Down
6 changes: 3 additions & 3 deletions spectrafit/plugins/notebook.py
Original file line number Diff line number Diff line change
Expand Up @@ -652,13 +652,13 @@ def get_linear_correlation(self) -> Dict[str, Any]:
return self.args_out["linear_correlation"]

@property
def get_computional(self) -> Dict[str, Any]:
def get_computational(self) -> Dict[str, Any]:
"""Get the computational time.
Returns:
Dict[str, Any]: Computational time as dictionary.
"""
return self.args_out["fit_insights"]["computional"]
return self.args_out["fit_insights"]["computational"]

@property
def settings_conf_interval(self) -> Union[bool, Dict[str, Any]]:
Expand Down Expand Up @@ -793,7 +793,7 @@ def make_solver_contribution(self) -> SolverAPI:
covariance_matrix=self.get_covariance_matrix,
variables=self.get_variables,
errorbars=self.get_errorbars,
computional=self.get_computional,
computational=self.get_computational,
)

@property
Expand Down
2 changes: 1 addition & 1 deletion spectrafit/plugins/test/test_notebook.py
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ def args_out_fixture() -> Dict[str, Any]:
"error_a": {"value": 1, "std": 2},
"error_b": {"value": 3, "std": 4},
},
"computional": {"optmizer": "leastsq", "nfev": 1000},
"computational": {"optmizer": "leastsq", "nfev": 1000},
},
"descriptive_statistic": pd.DataFrame({"mean": [1, 2], "std": [1, 2]}).to_dict(
orient="list"
Expand Down
22 changes: 11 additions & 11 deletions spectrafit/report.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,13 +210,13 @@ def fit_report_as_dict(
"errorbars": {},
"correlations": {},
"covariance_matrix": {},
"computional": {},
"computational": {},
}

result, buffer, params = _extracted_gof_from_results(
result=result, buffer=buffer, params=params
)
buffer = _extracted_computional_from_results(
buffer = _extracted_computational_from_results(
result=result, settings=settings, buffer=buffer
)
for name in parnames:
Expand Down Expand Up @@ -281,10 +281,10 @@ def get_init_value(
return f"As fixed value: {param.value}"


def _extracted_computional_from_results(
def _extracted_computational_from_results(
result: minimize, settings: Minimizer, buffer: Dict[str, Any]
) -> Dict[str, Any]:
"""Extract the computional from the results.
"""Extract the computational from the results.
Args:
result (minimize): Input Parameters from a fit or the Minimizer results
Expand All @@ -297,15 +297,15 @@ def _extracted_computional_from_results(
Returns:
Dict[str, Any]: The buffer with updated results.
"""
buffer["computional"]["success"] = result.success
buffer["computational"]["success"] = result.success
if hasattr(result, "message"):
buffer["computional"]["message"] = result.message
buffer["computional"]["errorbars"] = result.errorbars
buffer["computional"]["nfev"] = result.nfev
buffer["computational"]["message"] = result.message
buffer["computational"]["errorbars"] = result.errorbars
buffer["computational"]["nfev"] = result.nfev

buffer["computional"]["max_nfev"] = settings.max_nfev
buffer["computional"]["scale_covar"] = settings.scale_covar
buffer["computional"]["calc_covar"] = settings.calc_covar
buffer["computational"]["max_nfev"] = settings.max_nfev
buffer["computational"]["scale_covar"] = settings.scale_covar
buffer["computational"]["calc_covar"] = settings.calc_covar

return buffer

Expand Down

0 comments on commit b27b1a9

Please sign in to comment.