-
Notifications
You must be signed in to change notification settings - Fork 18
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🩹 Add number_of_clps to result and correct degrees_of_freedom calcula…
…tion (#1249) This PR adds the number of conditionally linear parameters and the correct degrees of freedom to the optimization results. Also, we previously reported the the number of residuals rather than data points, and there is a (small) difference. Now we are just reporting the (correct) number of residuals. * 🗑️ Deprecated Result.number_of_data_points in favor of Result.number_of_residuals * ✨ Add number_of_clps property to MatrixProvider's and OptimizationGroup * 👌 Add number_of_clps to result and adjust degrees_of_freedom calculation * 🧪 Add number_of_clps unit tests for relation, constraints and penalties 👌🧪 Changed relation and constraints unit tests to use intervals * 🧪 Added number_of_clps unit test for full model * 🧹 Fix typos in error docstrings * 🚧📚 Added change to changelog
- Loading branch information
Showing
12 changed files
with
179 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
"""Test deprecations for ``glotaran.project.project``.""" | ||
|
||
from __future__ import annotations | ||
|
||
from pathlib import Path | ||
|
||
import pytest | ||
|
||
from glotaran.deprecation import GlotaranApiDeprecationWarning | ||
from glotaran.optimization.optimize import optimize | ||
from glotaran.testing.simulated_data.sequential_spectral_decay import SCHEME | ||
|
||
|
||
def test_project_generate_model(): | ||
"""Trow deprecation warning on accessing ``Result.number_of_data_points``.""" | ||
print(SCHEME.data["dataset_1"]) | ||
result = optimize(SCHEME, raise_exception=True) | ||
with pytest.warns(GlotaranApiDeprecationWarning) as records: | ||
result.number_of_data_points | ||
|
||
assert len(records) == 1 | ||
assert Path(records[0].filename) == Path( | ||
__file__ | ||
), f"{Path(records[0].filename)=}, {Path(__file__)=}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters