Skip to content
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

Merged
merged 2 commits into from
Dec 18, 2017
Merged

Parse pools in a Step as dict #16

merged 2 commits into from
Dec 18, 2017

Conversation

tcezard
Copy link

@tcezard tcezard commented Nov 19, 2017

Add XmlPooledInputDict that parses the pools from a Step
Also fix a few bug associated with the editing of dictionaries

Also fix a few bug associated with the editing of dictionaries
@coveralls
Copy link

coveralls commented Nov 19, 2017

Coverage Status

Coverage increased (+0.6%) to 76.336% when pulling 76378ca on parsepools into 8e44d24 on master.

1 similar comment
@coveralls
Copy link

Coverage Status

Coverage increased (+0.6%) to 76.336% when pulling 76378ca on parsepools into 8e44d24 on master.

@@ -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'
Copy link
Author

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)
Copy link
Author

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

node = ElementTree.SubElement(self.rootnode(self.instance), 'pool')
node.attrib['name'] = key
node.attrib['uri'] = pool.uri
for input in list_input:

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)

node = ElementTree.SubElement(self.rootnode(self.instance), 'pool')
node.attrib['name'] = key
node.attrib['uri'] = pool.uri
for input in list_input:
Copy link
Collaborator

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
Copy link
Collaborator

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?

Copy link
Author

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.

@coveralls
Copy link

coveralls commented Dec 18, 2017

Coverage Status

Coverage increased (+0.6%) to 76.336% when pulling 4d80ae8 on parsepools into 8e44d24 on master.

@tcezard tcezard merged commit b358a92 into master Dec 18, 2017
@tcezard tcezard deleted the parsepools branch May 11, 2018 03:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants