-
Notifications
You must be signed in to change notification settings - Fork 5
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
Parse pools in a Step as dict #16
Conversation
Also fix a few bug associated with the editing of dictionaries
1 similar comment
@@ -292,6 +292,8 @@ def _setitem(self, key, value): | |||
self._elems[0].attrib[key] = value | |||
|
|||
def _delitem(self, key): | |||
if key in ['artifact', 'step', 'rework-step']: | |||
key = key + '-uri' |
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.
Deleting any of ['artifact', 'step', 'rework-step']
's key would have resulted in KeyError
elem1 = node | ||
break | ||
if elem1: | ||
self.rootnode(self.instance).remove(elem1) |
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.
Creating a placement was working however overwriting was resulting in a new placement being created and the old one left intact
pyclarity_lims/descriptors.py
Outdated
node = ElementTree.SubElement(self.rootnode(self.instance), 'pool') | ||
node.attrib['name'] = key | ||
node.attrib['uri'] = pool.uri | ||
for input in list_input: |
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.
Should perhaps not be an already defined Python function (input)
pyclarity_lims/descriptors.py
Outdated
node = ElementTree.SubElement(self.rootnode(self.instance), 'pool') | ||
node.attrib['name'] = key | ||
node.attrib['uri'] = pool.uri | ||
for input in list_input: |
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.
Shadows builtin name input
break | ||
|
||
def _parse_element(self, element, **kwargs): | ||
from pyclarity_lims.entities import Artifact |
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.
Does Artifact
take long enough to import that we need to lazy-load it?
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.
This is not about lazy loading but is meant to avoid import cyclic dependencies.
Fix documentation
Add XmlPooledInputDict that parses the pools from a Step
Also fix a few bug associated with the editing of dictionaries