You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Oct 5, 2020. It is now read-only.
dsl_parser/framework/parser.py between line 207 to 242
def _calculate_element_graph(self):
self.element_graph = nx.DiGraph(self._element_tree)
for element_type, _elements in self.element_type_to_elements.items():
requires = element_type.requires
for requirement, requirement_values in requires.items():
requirement_values = [
Requirement(r) if isinstance(r, basestring)
else r for r in requirement_values]
if requirement == 'inputs':
continue
if requirement == 'self':
requirement = element_type
dependencies = self.element_type_to_elements.get(
requirement, [])
predicates = [r.predicate for r in requirement_values
if r.predicate is not None]
if not predicates:
dep = _BatchDependency(element_type, requirement)
for dependency in dependencies:
self.element_graph.add_edge(dep, dependency)
for element in _elements:
self.element_graph.add_edge(element, dep)
continue
for dependency in dependencies:
for element in _elements:
add_dependency = all([
predicate(element, dependency)
for predicate in predicates])
if add_dependency:
self.element_graph.add_edge(element, dependency)
# we reverse the graph because only netorkx 1.9.1 has the reverse
# flag in the topological sort function, it is only used by it
# so this should be good
self.element_graph.reverse(copy=False)
I think can create a map to cache the element which is most used. This can accelerate the speed of parsing blueprint.
The text was updated successfully, but these errors were encountered:
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
dsl_parser/framework/parser.py between line 207 to 242
def _calculate_element_graph(self):
self.element_graph = nx.DiGraph(self._element_tree)
for element_type, _elements in self.element_type_to_elements.items():
requires = element_type.requires
for requirement, requirement_values in requires.items():
requirement_values = [
Requirement(r) if isinstance(r, basestring)
else r for r in requirement_values]
if requirement == 'inputs':
continue
if requirement == 'self':
requirement = element_type
dependencies = self.element_type_to_elements.get(
requirement, [])
predicates = [r.predicate for r in requirement_values
if r.predicate is not None]
I think can create a map to cache the element which is most used. This can accelerate the speed of parsing blueprint.
The text was updated successfully, but these errors were encountered: