forked from eclipse-basyx/basyx-python-sdk
-
Notifications
You must be signed in to change notification settings - Fork 2
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
merge main
in feature/http_api
#12
Merged
Merged
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
Replace a block of text by an `attention` admonition to highlight it properly. Furthermore, add a missing comma.
...so that it can be used by the HTTP API.
The respective exception marks an error in the program, which should correctly be an `AssertionError`.
`GlobalReference` has been renamed to `ExternalReference` in V3, but this enum member has been missed in the rename.
lxml supports paths already, no modification is necessary there. However, the `lxml.etree.ElementTree.write()` function requires `BinaryIO`, i.e. files opened with the 'b' mode. While it would be possible to access the underlying binary buffer of files opened in text mode via `open()`, this isn't possible for `io.StringIO()`, as it doesn't have the `buffer` property. Thus, even if we could support files opened via `open()` in text mode, we couldn't annotate the XML serialization functions with `TextIO`, as `io.StringIO()` remains unsupported. Because of that, I decided to not support `TextIO` for the XML serialization. The builtin JSON module only supports file handles, with the `json.dump()` method only supporting `TextIO` and `json.load()` supporting `TextIO` and `BinaryIO`. Thus, the JSON adapter is modified to `open()` given paths, while the JSON serialization is additionally modified to wrap `BinaryIO` with `io.TextIOWrapper`. Fix #42
... by using `StringIO` instead of `BytesIO`.
Resolution of id_short paths is added via `UniqueIdShortNamespace.get_referable()`, such that it can be used on every object, that spans such a namespace. `ModelReference.resolve()` is simplified to make use of this new functionality. Furthermore, tests for this are added.
Show the object, where the resolution failed, in the error messages.
A duplicate test is replaced by this test.
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 should be merged after eclipse-basyx#249 and eclipse-basyx#251 have been merged, as the HTTP API can make use of this new functionality.