Implement unpack_self() for MultiParameter#7713
Open
thangleiter wants to merge 7 commits intomicrosoft:mainfrom
Open
Implement unpack_self() for MultiParameter#7713thangleiter wants to merge 7 commits intomicrosoft:mainfrom
thangleiter wants to merge 7 commits intomicrosoft:mainfrom
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #7713 +/- ##
==========================================
- Coverage 59.77% 58.79% -0.98%
==========================================
Files 352 352
Lines 31683 31696 +13
==========================================
- Hits 18937 18636 -301
- Misses 12746 13060 +314 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Contributor
Author
|
I've implemented the self-registering, which works as I'd expect it to work as far as I can tell. However, it required some changes to the way |
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
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.
This PR implements the
unpack_self()method forMultiParameter, extending #7346. This makes the special treatment of this type of parameter inDataSaver.add_result()redundant and should allow users to make use of the newhas_control_ofandis_controlled_byfeatures in customMultiParameterclasses.To Do
DataSet._register_multiparameter()to account forhas_control_ofandis_controlled_byattributes.Considerations
If
MultiParameteris ever going to be refactored, I think it makes sense for each result (name) that it returns to be its own parameter with validators etc. This would allow assigning correctparamtypes (currently, paramtype is basically always numeric, and hence inefficiently stored if not overridden.Similar to
unpack_self, registering a parameter in a measurement should also be delegated to the parameter itself so thatMeasurementdoes not need to be aware of the parameter's internals and make case distinctions. So something like adding aregister_selfmethod toParameterBase.