Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
KADMOS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LR-FPP-MDO
KADMOS
Commits
8cdc878c
Commit
8cdc878c
authored
8 years ago
by
imcovangent
Browse files
Options
Downloads
Patches
Plain Diff
Merge functions - updates - adjusted input assertions and interpretation.
Former-commit-id: 4408e23257b97b3f1d2b3fd43197080751202d4a
parent
8df77257
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
pyKADMOS/sample/graph.py
+10
-10
10 additions, 10 deletions
pyKADMOS/sample/graph.py
with
10 additions
and
10 deletions
pyKADMOS/sample/graph.py
+
10
−
10
View file @
8cdc878c
...
...
@@ -1291,13 +1291,13 @@ class KadmosGraph(nx.DiGraph):
"""
# Handle the fact that the *args could also be a list or tuple directly
if len(args) == 1 and isinstance(args[0], tuple):
if len(args) == 1 and
(
isinstance(args[0], tuple)
or isinstance(args[0], list))
:
args = list(args[0])
# Input assertions
assert len(args) > 1
assert len(args) > 1
, 'More than 1 input argument is required.'
for arg in args:
assert isinstance(arg, basestring)
assert isinstance(arg, basestring)
, 'Input arguments should be strings.'
# Get subgraph of functions and their (variable) neighbours
subgraph = self.get_subgraph_by_function_nodes(args)
...
...
@@ -1348,13 +1348,13 @@ class KadmosGraph(nx.DiGraph):
"""
# Handle the fact that the *args could also be a list or tuple directly
if len(args) == 1 and isinstance(args[0], tuple):
if len(args) == 1 and
(
isinstance(args[0], tuple)
or isinstance(args[0], list))
:
args = list(args[0])
# Input assertions
assert len(args) > 1
assert len(args) > 1
, 'More than 1 input is required for this function.'
for arg in args:
assert isinstance(arg, basestring)
assert isinstance(arg, basestring)
, 'Arguments should be strings.'
# Get subgraph of functions and their (variable) neighbours
subgraph = self.get_subgraph_by_function_nodes(args)
...
...
@@ -1418,13 +1418,13 @@ class KadmosGraph(nx.DiGraph):
"""
# Handle the fact that the *args could also be a list or tuple directly
if len(args) == 2 and isinstance(args[0], basestring) and isinstance(args[1], tuple):
if len(args) == 2 and isinstance(args[0], basestring) and
(
isinstance(args[1], tuple)
or isinstance(args[1], list))
:
args = list(args[0]) + [arg for arg in args[1]]
# Input assertions
assert len(args) > 2, 'At least three arguments are required for a function mode merge.'
for arg in args:
assert isinstance(arg, basestring)
assert isinstance(arg, basestring)
, 'All arguments should be strings.'
# Create function-mode strings and check them
function_nodes = list()
for arg in args[1:]:
...
...
@@ -2830,7 +2830,7 @@ class KadmosGraph(nx.DiGraph):
"""
# Input assertions
assert type(filename) is str
if filename[-
7
:] != '.kdms':
if filename[-
5
:] != '.kdms':
filename += '.kdms'
if destination_folder:
assert type(destination_folder) is str
...
...
@@ -4174,7 +4174,7 @@ def open_kdms(filename, source_folder=None):
"""
# Input assertions
assert type(filename) is str, 'File name should be a string.'
if filename[-
7
:] != '.kdms':
if filename[-
5
:] != '.kdms':
filename += '.kdms'
if source_folder:
if source_folder[-1] == '/':
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment