Skip to content

Conversation

tlambert03
Copy link
Member

@tlambert03 tlambert03 commented Jul 7, 2025

#452 has gotten massive, since it has gain a lot of features. So this PR is just to pull out some of the code that kind of stands on its own, to test it in isolation, before returning to #452.

The biggest change here is that I've decided to use our own internal python model for config groups, rather than using the dataclasses provided by pymmcore_plus.models. They are largely the same (though these are based on pydantic rather than dataclasses), but I found myself wanting to modify the models too much and I don't want to do the two-repo game. This does mean that some of the widgets here (namely, the hardware wizard) use the model over there, and some will use the internal one... but that will be temporary. Both can coexist, though it does add to confusion and should be unified again in the near future. (I've learned so much on the QAbstractItemModel thing here that I will want to bring it back over to the hardware wizard again anyway).

It also updates the icon pattern to use StandardIcon

This PR lets me focus on what needs testing for the changes, before merging back into 452

Copy link

codecov bot commented Jul 7, 2025

Codecov Report

Attention: Patch coverage is 91.50780% with 49 lines in your changes missing coverage. Please review.

Project coverage is 87.43%. Comparing base (2a79de5) to head (3bdfc07).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/pymmcore_widgets/_models/_core_functions.py 69.23% 16 Missing ⚠️
src/pymmcore_widgets/_models/_py_config_model.py 89.62% 11 Missing ⚠️
...ets/config_presets/_views/_config_presets_table.py 80.00% 7 Missing ⚠️
src/pymmcore_widgets/_models/_q_config_model.py 94.54% 6 Missing ⚠️
...mcore_widgets/_models/_config_group_pivot_model.py 95.96% 5 Missing ⚠️
src/pymmcore_widgets/_models/_base_tree_model.py 94.73% 4 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #453      +/-   ##
==========================================
+ Coverage   87.39%   87.43%   +0.04%     
==========================================
  Files         100      105       +5     
  Lines       11122    11472     +350     
==========================================
+ Hits         9720    10031     +311     
- Misses       1402     1441      +39     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@marktsuchida
Copy link

Is it #451 rather than #452?

@tlambert03
Copy link
Member Author

Lol, yes

@tlambert03 tlambert03 changed the title refactor: pull in just the model from 452 refactor: pull in just the model from 451 Jul 7, 2025
@tlambert03 tlambert03 merged commit 129fa1f into pymmcore-plus:main Jul 8, 2025
23 checks passed
@tlambert03 tlambert03 deleted the update-model branch July 8, 2025 15:02
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.

2 participants