Changing rpc constants on proxy#214
Open
heevasti wants to merge 11 commits into
Open
Conversation
…the class constants marked with `_rpc_constants = ["constant_a", "constant_b", ...]` can be changed by calling `class_rpc_proxy_inst.constant_a(new_value)`. The new value must be of same type and length as the original value to be able to change the value. This means that e.g. `None` cannot be used to set the RPC constant as 'optional', and the constant cannot have union of types either. Need to edit the documentation about this still.
…thout a new value to return the current value.
…t value calls to be settables and gettables instead, so that they can be modified like any class attribute.
…bout using RPC constants.
… constant in help.
…QuTech-Delft/QMI into changing-rpc-constants-on-proxy
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.
Related to #213.
With this, the "RPC constants" that are class constants on a RPC object, e.g. QMI_Instrument, can now be modified so that the modifications propagate back to the actual object, and not proxy only. With this, the proxy class of the object was also made prohibitive on adding new class constants, RPC constants can only be modified with same type (and size if applicable) values, and also class constants not defined with
_rpc_constantsare not modifiable and will lead to an AttributeError.Some tutorial examples were also added to illustrate this new functionality.