-
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
Added support for lists in tripper.convert #129
Conversation
Codecov ReportPatch coverage:
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the GitHub App Integration for your organization. Read more. Additional details and impacted files@@ Coverage Diff @@
## master #129 +/- ##
==========================================
- Coverage 76.11% 75.67% -0.44%
==========================================
Files 17 17
Lines 1348 1402 +54
==========================================
+ Hits 1026 1061 +35
- Misses 322 341 +19
☔ View full report in Codecov by Sentry. |
value = OWL.Nothing | ||
|
||
def get_obj_iri(obj, uuid): | ||
"""Return IRI for Python object `obj`. The `uuid` argument is |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please explain why this method returns either an IRI or a list
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The nested help-function get_obj_iri() will only return an IRI. I updated its docstring to explain that it also populates the list of triples (built up in the outer function from_container()) with a representation of obj
.
The reason for introducing a nested function is to support arbitrary nested containers through recursion.
from_container()
will always return a list of triples.
# Description Example with OTEAPI and OTELib using TEM data. This example currently depends on a set of other PRs: * #633 (already merged into this branch) * EMMC-ASBL/oteapi-core#318 * EMMC-ASBL/tripper#129 * EMMC-ASBL/oteapi-dlite#163 ## Type of change - [ ] Bug fix & code cleanup - [ ] New feature - [x] Documentation update - [ ] Test update ## Checklist for the reviewer This checklist should be used as a help for the reviewer. - [ ] Is the change limited to one issue? - [ ] Does this PR close the issue? - [ ] Is the code easy to read and understand? - [ ] Do all new feature have an accompanying new test? - [ ] Has the documentation been updated as necessary?
Description:
The
save_dict()
andload_dict()
in the tripper.convert module saves and loads dicts as their name indicate. However, we also need support for lists, since OTEAPI represents mappings as a list in the configurations.This PR generalises the above functions to also support lists. To reflect that, has the names of the functions also been changed to
save_container()
andload_container()
. The old function names still exists, but are deprecated.We have also removed the
bases
argument, since the base (superclass) is now used and can therefore not be allowed to be changed by the user.A bug in parse_literal() has also been fixed.
Type of change:
Checklist for the reviewer:
This checklist should be used as a help for the reviewer.