-
Notifications
You must be signed in to change notification settings - Fork 20
Fix scenario and alternative filtering for Entity table, improve default values on empty rows #3228
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
Merged
Conversation
This file contains hidden or 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
The action tried to clear auto filter menus on empty models which don't have them. Re #3216
Simplify the collection of entity ids which have visible parameter values; rename things to better reflect their use-cases. Re #3216
A new class, FilterSelection, now handles changes in Entity tree selections regarding filtering of Stacked and Graph views. All the code is now in one place. Re #3216
This simplifies code paths a little bit. Re #3216
Moved some code where it belongs. Re #3216
We don't store the ids of selected entities in the widget anymore. Re #3216
The additional entity selection from Graph view that affect the stacked tables only is now handled through the FilterSelection instance in SpineDBEditor. Re #3216
Similarly to how we now deal with filtering by entity and entity class selections, alternative selections in Alternative and Scenario trees are now handled and dispatched in a single location in DB editor. Re #3216
Entities don't have an alternative field so filtering by alternative makes no sense. Re #3216
Opening scenario generator was broken since the management of alternative selections was moved into AlternativeSelectionForFiltering. Re #3216
A new class, ScenarioSelectionForFiltering, calculates selected scenario ids similarly to the corresponding classes for Entity and Alternative trees. Re #3216
When selecting scenarios from the scenario tree, do not select the scenario's alternatives. Re #3216
The table now shows the entities that would be visible in the seleceted scenario(s) according to entity alternatives and active_by_defaults. Re #3216
- Empty row defaults are now handled in a new class, DefaultRowGenerator - Concerted selection clearing of Entity, Alternative and Scenario trees is now handled solely by SpineDBEditor. - EntityTreeView now relies less on directly calling SpineDBEditor; rather, it uses signals. In the long run, we should remove all references to spine_db_editor from all views and models to make the code more modular and less spaghetti. Re #3216
7b9d5a9 to
2a6cf9c
Compare
- Improve entity selections with multiple databases - Update default row values when data, e.g. selected class name, changes - Fix unit tests Re #3216
d45f3f1 to
7d869e3
Compare
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## master #3228 +/- ##
==========================================
+ Coverage 69.05% 69.78% +0.73%
==========================================
Files 199 201 +2
Lines 38656 39048 +392
Branches 4634 4729 +95
==========================================
+ Hits 26693 27250 +557
+ Misses 10654 10492 -162
+ Partials 1309 1306 -3 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
The main user-facing changes in this PR are:
A lot of of DB Editor code has been refactored. The main goal was to gather code that was scattered all over the DB editor mixins and views into a single place (see
selection_for_filtering.pyanddefault_row_generator.py) which can be unit tested in isolation.Resolves #3216
Checklist before merging