Skip to content

Commit

Permalink
Allow no graphviz in .transport.build.get_computer()
Browse files Browse the repository at this point in the history
  • Loading branch information
khaeru committed Dec 4, 2024
1 parent dc6d805 commit 2cc9159
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion message_ix_models/model/transport/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
from message_ix_models.model import bare, build
from message_ix_models.util import minimum_version
from message_ix_models.util._logging import mark_time
from message_ix_models.util.graphviz import HAS_GRAPHVIZ

from . import Config
from .structure import get_technology_groups
Expand Down Expand Up @@ -460,7 +461,7 @@ def get_computer(
# Add tasks for debugging the build
add_debug(c)

if visualize:
if visualize and HAS_GRAPHVIZ:

Check warning on line 464 in message_ix_models/model/transport/build.py

View check run for this annotation

Codecov / codecov/patch

message_ix_models/model/transport/build.py#L464

Added line #L464 was not covered by tests
path = context.get_local_path("transport", "build.svg")
path.parent.mkdir(exist_ok=True)
c.visualize(filename=path, key="add transport data")
Expand Down

0 comments on commit 2cc9159

Please sign in to comment.