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
chg: usr: Add support for subnodes #92
Conversation
lib/topology/graph/__init__.py
Outdated
from .graph import TopologyGraph | ||
|
||
|
||
__all__ = ["TopologyGraph", "Link", "Node", "Port"] |
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.
__all__ = ["TopologyGraph", "Link", "Node", "Port"] | |
__all__ = ['TopologyGraph', 'Link', 'Node', 'Port'] |
""" | ||
Raised when there are inconsistencies in the topology. | ||
""" | ||
pass |
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.
pass | |
pass | |
__all__ = [ | |
'NotFound', | |
'AlreadyExists', | |
'Inconsistent', | |
] |
lib/topology/graph/graph.py
Outdated
from typing_extensions import Self | ||
from warnings import warn | ||
|
||
from .exceptions import Inconsistent, NotFound, AlreadyExists |
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.
Narrow to large or large to narrow, choose one and stick with it. Use narrow to large.
lib/topology/graph/graph.py
Outdated
""" | ||
if node.identifier in self._nodes: | ||
raise AlreadyExists( | ||
f"Node {node.identifier} already exists in the topology") |
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.
f"Node {node.identifier} already exists in the topology") | |
f'Node {node.identifier} already exists in the topology' | |
) |
lib/topology/graph/graph.py
Outdated
""" | ||
if link.identifier in self._links: | ||
raise AlreadyExists( | ||
f"Link {link.identifier} already exists in the topology") |
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.
f"Link {link.identifier} already exists in the topology") | |
f'Link {link.identifier} already exists in the topology' | |
) |
lib/topology/graph/graph.py
Outdated
:param port_id: The id of the port to return. | ||
""" | ||
if port_id not in self._ports: | ||
raise NotFound(f"Port {port_id} not found in the topology") |
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.
raise NotFound(f"Port {port_id} not found in the topology") | |
raise NotFound(f'Port {port_id} not found in the topology') |
lib/topology/graph/graph.py
Outdated
This method exists for backwards compatibility. Use links() instead. | ||
""" | ||
warn( | ||
"TopologyGraph.bilinks() is deprecated. Use links() instead.", |
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.
"TopologyGraph.bilinks() is deprecated. Use links() instead.", | |
'TopologyGraph.bilinks() is deprecated. Use links() instead.', |
lib/topology/graph/graph.py
Outdated
f"{link.node2.identifier}") | ||
|
||
|
||
__all__ = ["TopologyGraph"] |
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.
__all__ = ["TopologyGraph"] | |
__all__ = ['TopologyGraph'] |
lib/topology/graph/link.py
Outdated
return (node_id, port_id) in self.identifier | ||
|
||
|
||
__all__ = ["Link"] |
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.
__all__ = ["Link"] | |
__all__ = ['Link'] |
requirements.txt
Outdated
@@ -8,3 +8,5 @@ pexpect>=4.6 | |||
pyparsing | |||
pynml | |||
pyszn>=1.4.0 | |||
objns | |||
typing_extensions |
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.
Really really needed?
1d0f871
to
77b5e15
Compare
- Replace NMLExtendedManager by a new TopologyGraph class and other classes for Node, Link and Port. - Drop supports for NML and graphviz plot output which implies removing these pytest plugin flags: - --topology-nml-dir - --topology-plot-dir - --topology-plot-format
77b5e15
to
8c94199
Compare
mkpath(args.nml_dir) | ||
|
||
# Determine NML export directory and create it if required | ||
if args.nml_dir: |
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.
❤️
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.
❤️
Love to deprecate old things nobody uses.
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.
Great job. Love the modernization of core concepts of Topology. Great job.
mkpath(args.nml_dir) | ||
|
||
# Determine NML export directory and create it if required | ||
if args.nml_dir: |
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.
❤️
Love to deprecate old things nobody uses.
warn( | ||
"nml attribute is obsolete and will be removed in future " | ||
"versions. Use graph attribute instead.", | ||
DeprecationWarning | ||
) |
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.
Love it.
@@ -8,3 +8,5 @@ pexpect>=4.6 | |||
pyparsing | |||
pynml | |||
pyszn>=1.4.0 | |||
typing_extensions |
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.
I still think this isn't required.
Great job! Merging without waiting for CI as Travis blocked our account. Migrating to CircleCI or other in another PR. |
No description provided.