Skip to content

Commit 1127b55

Browse files
Jammy2211claude
authored andcommitted
Fix circular import in imaging_plots by using lazy imports
Move `from autoarray.plot.array import plot_array` inside each function body instead of at module level to break the circular import chain: imaging_plots → plot.array → plot/__init__.py → imaging_plots. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 5024c24 commit 1127b55

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

autoarray/dataset/plot/imaging_plots.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import matplotlib.pyplot as plt
44

5-
from autoarray.plot.array import plot_array
65
from autoarray.plot.utils import subplot_save
76

87

@@ -47,6 +46,8 @@ def subplot_imaging_dataset(
4746
grid, positions, lines
4847
Optional overlays forwarded to every panel.
4948
"""
49+
from autoarray.plot.array import plot_array
50+
5051
fig, axes = plt.subplots(3, 3, figsize=(21, 21))
5152
axes = axes.flatten()
5253

@@ -167,6 +168,8 @@ def subplot_imaging(
167168
except Exception:
168169
pass
169170

171+
from autoarray.plot.array import plot_array
172+
170173
n = len(panels)
171174
fig, axes = plt.subplots(1, n, figsize=(7 * n, 7))
172175
axes_flat = list(axes.flatten()) if n > 1 else [axes]
@@ -201,6 +204,8 @@ def subplot_imaging_dataset_list(
201204
if isinstance(output_format, (list, tuple)):
202205
output_format = output_format[0]
203206

207+
from autoarray.plot.array import plot_array
208+
204209
n = len(dataset_list)
205210
fig, axes = plt.subplots(n, 3, figsize=(21, 7 * n))
206211
if n == 1:

0 commit comments

Comments
 (0)