Skip to content

Conversation

@peterhollender
Copy link
Contributor

@peterhollender peterhollender commented Mar 18, 2025

Closes #230

@peterhollender peterhollender linked an issue Mar 18, 2025 that may be closed by this pull request
@peterhollender
Copy link
Contributor Author

I feel like SolutionAnalysis should probably get rewritten at some point so that instead of a bunch of loose attributes + a parameter_constraints dict + hard coded formatting info, it has a dictionary of SolutionAnalysisAttribute objects, each of which contains the information needed to apply the constraints, format display, etc. Then we could have @property methods for convenient access, fancier retrieval of values (specify alternative output units for example), etc. But this is working, so we can handle that later

@ebrahimebrahim
Copy link
Collaborator

Agreed about your SolutionAnalysisAttribute proposal.

Once this is ready you can tag @arhowe00 for review please, since he will work on OpenwaterHealth/SlicerOpenLIFU#98

(feel free to tag for review without fixing the units tests or whatever is failing, we can look at that after and handle it)

We have the tabular output working in SlicerOpenLIFU by the way (in one of Andrew's topic branches I think), but it shows raw floats with full precision, so this will help to format things!

@ebrahimebrahim
Copy link
Collaborator

Oh I wrote that before realizing you've already tagged me to review. Bringing in Andrew 😄

@ebrahimebrahim ebrahimebrahim requested a review from arhowe00 March 18, 2025 20:46
@arhowe00 arhowe00 force-pushed the 230-add-tabluar-output-from-solution-analysis branch from 192a918 to b8826e0 Compare March 25, 2025 18:41
@arhowe00
Copy link
Contributor

arhowe00 commented Mar 25, 2025

@peterhollender FYI I rebased to main because there were some merge conflicts. Still working on review

@arhowe00 arhowe00 force-pushed the 230-add-tabluar-output-from-solution-analysis branch from b8826e0 to e9a5351 Compare March 25, 2025 18:53
@arhowe00 arhowe00 force-pushed the 230-add-tabluar-output-from-solution-analysis branch 2 times, most recently from d8f8ed1 to 14c3128 Compare April 3, 2025 18:34
Copy link
Contributor

@arhowe00 arhowe00 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I rebased this to the main branch and looked at the changes. For the most part, things make sense, there were some changes I made to satisfy the linter (some of these were more important than others, like passing a list to a tuple). There were some things that needed imports, such as PARAM_STATUS_SYMBOLS, etc.

If you want @peterhollender I can apply most of these changes in batch, just reply to what you think about each of them if you have any points of contention and I'll decide what to commit based on that.

arhowe00 pushed a commit that referenced this pull request Apr 14, 2025
Addresses comments on [SlicerOpenLIFU PR#250
review](#250 (review))
@arhowe00 arhowe00 force-pushed the 230-add-tabluar-output-from-solution-analysis branch from c7de2ed to 579bf96 Compare April 14, 2025 17:45
arhowe00 added a commit that referenced this pull request Apr 14, 2025
Adds suggestions made in [a review of SlicerOpenLIFU
PR#250](#250 (review))
@arhowe00 arhowe00 force-pushed the 230-add-tabluar-output-from-solution-analysis branch from c4364fe to 7aeeee5 Compare April 14, 2025 20:38
arhowe00 pushed a commit that referenced this pull request Apr 14, 2025
Addresses comments on [SlicerOpenLIFU PR#250
review](#250 (review))
arhowe00 added a commit that referenced this pull request Apr 14, 2025
Adds suggestions made in [a review of SlicerOpenLIFU
PR#250](#250 (review))
arhowe00 pushed a commit that referenced this pull request Apr 14, 2025
Addresses comments on [SlicerOpenLIFU PR#250
review](#250 (review))
arhowe00 added a commit that referenced this pull request Apr 14, 2025
Adds suggestions made in [a review of SlicerOpenLIFU
PR#250](#250 (review))
@arhowe00 arhowe00 force-pushed the 230-add-tabluar-output-from-solution-analysis branch from 7aeeee5 to a66abcc Compare April 14, 2025 20:50
Copy link
Contributor

@arhowe00 arhowe00 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is close to being merged, I just rebased again to main and still have a comment below that needs to be addressed.

Edit: This comment no longer needs to be addressed.

@arhowe00
Copy link
Contributor

arhowe00 commented Apr 21, 2025

I'll rebase and merge this afternoon.

Refactored pressure unit from Pa to MPa; added to_table method for
tabular output; introduced ParameterConstraint class for status
evaluation; updated test data accordingly.
- Introduced ParameterConstraint class for validating and evaluating
  analysis parameters.
- Integrated constraint handling into Protocol.calc_solution and
  Solution.analyze.
- Updated SolutionAnalysis.to_table to include constraint status.
- Modified example_protocol.json to define parameter constraints.
- Added param_constraint.py and corresponding test notebook.
Added from __future__ import annotations across modules to resolve CI
issues; updated type annotations for ParameterConstraint references to
eliminate forward declarations.
Replaced is_sorted checks with explicit tuple order comparisons; removed
unused import from more_itertools.
peterhollender and others added 9 commits April 22, 2025 00:44
 - Added check for param_constraints being a dict
 - Adjusted type assertions for other fields in
   test_solution_analyze_data_types
Replace default None with field(default_factory=dict) for
param_constraints in Solution.analyze; formatting-only change in
test_solution.py.
Replaces field(default_factory=dict) with plain {} as default for
param_constraints in Solution.analyze.
Standardized coordinate dimension names (x, y, z → lat, ele, ax);
adjusted test inputs and protocol serialization; changed MI calculation
to use max value; updated parameter formatting for MI.
 - Add optional focus_index param to SolutionAnalysis.to_table to select
   value per focus
 - Updated logic to handle per-focus values vs aggregated
 - Modified formatting and constraint evaluation accordingly
 - Adjusted test notebook to use focus_index with constraints
Update db_dvc.dvc to contain the updated class fields by running the
command at the state of the current revision:

```
python scripts/standardize_database.py db_dvc
```
Addresses comments on [SlicerOpenLIFU PR#250
review](#250 (review))
Adds suggestions made in [a review of SlicerOpenLIFU
PR#250](#250 (review))
@arhowe00 arhowe00 force-pushed the 230-add-tabluar-output-from-solution-analysis branch from a66abcc to 4b52c6f Compare April 22, 2025 04:45
@arhowe00 arhowe00 merged commit 9b26f46 into main Apr 22, 2025
9 checks passed
arhowe00 pushed a commit that referenced this pull request Apr 22, 2025
Addresses comments on [SlicerOpenLIFU PR#250
review](#250 (review))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add tabluar output from solution analysis

4 participants