-
Notifications
You must be signed in to change notification settings - Fork 18
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor Element Result Saving #1534
base: staging
Are you sure you want to change the base?
Conversation
🧙 Sourcery has finished reviewing your pull request! Tips
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We've reviewed this pull request using the Sourcery rules engine. If you would also like our AI-powered code review then let us know.
I have checked the sonar cloud issues, this will be fixed in the cleanup when I add doc etc. |
from glotaran.model.experiment_model import ExperimentModel | ||
from glotaran.typing.types import ArrayLike | ||
|
||
|
||
def add_svd_to_result_dataset(dataset: xr.Dataset, global_dim: str, model_dim: str): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please use glotaran.io.prepare_dataset.add_svd_to_dataset
where the issue that causes the CI to fail was already fixed on staging.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I rather like to move the function from io to here to avoid dependency of optimization to anything other than model.
I will copy the code from io with the fixes of course. This was just a quick fix to get IO out of the equation for dev.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please keep in mind that you can't just move the function completely (needs re import or deprecation), since we use it down stream.
Forward port of 🩹 Fix prepare_dataset's add_svd_to_dataset function (glotaran#1522)
by making each init use named arguments
This fix relies on assert to narrow down types. However using more uniform interfaces would be a more desirable way to solve this, but this is out of scope for a review fix.
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## staging #1534 +/- ##
=========================================
- Coverage 85.3% 85.3% -0.1%
=========================================
Files 91 91
Lines 3752 3746 -6
Branches 734 719 -15
=========================================
- Hits 3203 3197 -6
- Misses 438 445 +7
+ Partials 111 104 -7 ☔ View full report in Codecov by Sentry. |
_associated_amplitude_ -> _associated_amplitudes_ _associated_concentration_ -> _associated_concentrations_
After internal discussions we decided to pivot on how to save results, see my summarizing comment on the issue. |
for more information, see https://pre-commit.ci
for more information, see https://pre-commit.ci
Also fixes #1537 now |
Quality Gate passedIssues Measures |
This PR refactors the way element results are stored. Now every element stores it's own items. They return
The Kinetic element eg, stores amplitudes and contractions each with key "species" and "decay". This means in the final result this will be stored as eg
species_associated_amplitude_ELEMENTNAME
. K matrices etc are part of extra and only get the element name suffixed.IMPORTANT To avoid collisions, all coords which are not the model or the global dim also get suffixed with the name,
species
coord will be renamend tospecies_ELEMENTNAME
.Checklist
Closes issues
closes #1498