Skip to content
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

Parameter type validation #2912

Merged
merged 2 commits into from
Aug 7, 2024
Merged

Parameter type validation #2912

merged 2 commits into from
Aug 7, 2024

Conversation

soininen
Copy link
Contributor

@soininen soininen commented Aug 7, 2024

This PR implements parameter type validation in Database editor. Parameter definition table now has a new column, "valid types" which lists accepted value types for the parameter. If any types are specified in the column, both values and default values are validated against the types. Invalid types are marked by an exclamation icon and a tool tip provides more information.

As much of the validation as possible has been offloaded to a worker process so the validation should not affect DB editor's responsiveness too much.

spinedb_api side PR: spine-tools/Spine-Database-API#439

Implements #2791

Checklist before merging

  • Documentation is up-to-date
  • Release notes have been updated
  • Unit tests have been added/updated accordingly
  • Code has been formatted by black & isort
  • Unit tests pass

Copy link

codecov bot commented Aug 7, 2024

Codecov Report

Attention: Patch coverage is 77.32181% with 105 lines in your changes missing coverage. Please review.

Project coverage is 66.96%. Comparing base (1b51b6a) to head (5567426).

Files Patch % Lines
...etoolbox/spine_db_editor/widgets/custom_editors.py 67.10% 22 Missing and 3 partials ⚠️
...oolbox/spine_db_editor/widgets/custom_delegates.py 45.00% 22 Missing ⚠️
spinetoolbox/parameter_type_validation.py 77.77% 16 Missing and 2 partials ⚠️
...olbox/spine_db_editor/mvcmodels/compound_models.py 50.00% 12 Missing and 4 partials ⚠️
spinetoolbox/spine_db_manager.py 76.11% 15 Missing and 1 partial ⚠️
...toolbox/spine_db_editor/mvcmodels/single_models.py 88.33% 5 Missing and 2 partials ⚠️
...oolbox/spine_db_editor/ui/parameter_type_editor.py 98.98% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2912      +/-   ##
==========================================
+ Coverage   66.90%   66.96%   +0.05%     
==========================================
  Files         187      189       +2     
  Lines       36464    36878     +414     
  Branches     6241     6312      +71     
==========================================
+ Hits        24398    24695     +297     
- Misses      10764    10871     +107     
- Partials     1302     1312      +10     

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

Parameter definition table now has a 'valid types' column that
contains parameter type information.

Re #2791
Parameter (default) values are now validated in a parallel process
in Database editor.

Re #2791
@soininen soininen merged commit 5cb26c0 into master Aug 7, 2024
0 of 20 checks passed
@soininen soininen deleted the 2791_parameter_type branch August 7, 2024 09:45
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.

1 participant