-
Notifications
You must be signed in to change notification settings - Fork 70
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
Some random cleanups #162
Merged
Merged
Some random cleanups #162
+123
−79
Conversation
This file contains 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
`ByteString` is [considered harmful](python/mypy#4871) Signed-off-by: Andreas Lauser <[email protected]> Signed-off-by: Gerrit Ecke <[email protected]>
mypy treats `bytearray` as a sub-class of `bytes`, so allowing `bytes` wherever possible/convenient makes for a more general solution. Signed-off-by: Andreas Lauser <[email protected]> Signed-off-by: Gerrit Ecke <[email protected]>
now, there is a `AtomicOdxType` type alias for primitive types like strings, integers, floats and byte arrays and a `ParameterType` alias for all values which a parameter can exhibit. (Note that there are parameters for composite types like structures, `ParameterType` is recursive.) Signed-off-by: Andreas Lauser <[email protected]> Signed-off-by: Gerrit Ecke <[email protected]>
… conversion functions i.e., `convert_physical_to_internal()`, `convert_physical_to_internal()` and `convert_bytes_to_physical()`. Signed-off-by: Andreas Lauser <[email protected]> Signed-off-by: Gerrit Ecke <[email protected]>
this is basically just good style: it might be that the attribute has been defined but evaluates to `False`... Signed-off-by: Andreas Lauser <[email protected]> Signed-off-by: Gerrit Ecke <[email protected]>
this was a remnant of changing the name of all ODXLINK id attributes from `id` to `odx_id` using search and replace... Signed-off-by: Andreas Lauser <[email protected]> Signed-off-by: Gerrit Ecke <[email protected]>
Signed-off-by: Andreas Lauser <[email protected]> Signed-off-by: Gerrit Ecke <[email protected]>
this is completely analogos to `OdxLinkDatabase.resolve()`... Signed-off-by: Andreas Lauser <[email protected]> Signed-off-by: Gerrit Ecke <[email protected]>
python 3.8 does not like `OrderedDict` and we still support this python version. While the practical consequences of this are likely minimal, this increases the difficulty of accessing a parameter by position from "hard" to "impossible"... Signed-off-by: Andreas Lauser <[email protected]> Signed-off-by: Gerrit Ecke <[email protected]>
kayoub5
reviewed
Jul 18, 2023
thanks! Signed-off-by: Andreas Lauser <[email protected]> Signed-off-by: Gerrit Ecke <[email protected]>
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 contains a scattershot of smaller cleanups which improve the esthetics and convenience of the code, but should change nothing to little functionality-wise.
Be aware that it is probably easier to review the patches here individually because they are all focused on a single issue instead of colluding everything together...
Andreas Lauser <[email protected]>, on behalf of MBition GmbH.
Provider Information