Skip to content

Commit 56546ec

Browse files
authored
don't depend on matplotlib unless -svg is passed on command line (#376)
* Suppress wrong import position warnings * don't depend on matplotlib unless -svg is passed on command line cc @tomaird
1 parent c35a8ed commit 56546ec

2 files changed

Lines changed: 5 additions & 3 deletions

File tree

.pylintrc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,8 @@ disable=
1818
too-many-statements,
1919
# Handled by Black.
2020
line-too-long,
21+
# Conditional dependence on matplotlib
22+
import-outside-toplevel,
2123
# This is technically correct but not that important.
2224
logging-fstring-interpolation,
2325
# TODO: These should be enabled but writing documentation for

svg_utils.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,6 @@
22
import pprint
33
from typing import Dict, List, NamedTuple
44

5-
from matplotlib import patches
6-
from matplotlib import pyplot as plt
7-
85
from rv_colors import palette
96
from shared_utils import InstrDict, instr_dict_2_extensions
107

@@ -77,6 +74,9 @@ def plot_image(
7774
) -> None:
7875
"""Plot the instruction rectangles using matplotlib."""
7976

77+
from matplotlib import patches
78+
from matplotlib import pyplot as plt
79+
8080
def get_readable_font_color(bg_hex: str) -> str:
8181
"""Determine readable font color based on background color."""
8282

0 commit comments

Comments
 (0)