Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 10 additions & 11 deletions kda/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -77,17 +77,16 @@ def __init__(self, K=None, G=None):
RuntimeError
If both ``K`` and ``G`` are ``None``.
"""
if G is None or K is None:
if K is not None:
# if only K is input create the diagram
G = nx.MultiDiGraph()
graph_utils.generate_edges(G=G, vals=K)
elif G is not None:
# if only G is input create the kinetic rate matrix
K = graph_utils.retrieve_rate_matrix(G)
else:
msg = "To create a `KineticModel`, K or G must be input."
raise RuntimeError(msg)
if K is not None:
# if only K is input create the diagram
G = nx.MultiDiGraph()
graph_utils.generate_edges(G=G, vals=K)
elif G is not None:
# if only G is input create the kinetic rate matrix
K = graph_utils.retrieve_rate_matrix(G)
else:
msg = "To create a `KineticModel`, K or G must be input."
raise RuntimeError(msg)

self.K = K
self.G = G
Expand Down