Skip to content

Commit

Permalink
fixed broken tests
Browse files Browse the repository at this point in the history
  • Loading branch information
dodu94 committed Feb 10, 2025
1 parent 07ef2d8 commit d70b1c5
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 7 deletions.
10 changes: 6 additions & 4 deletions src/jade/post/atlas_processor.py
Original file line number Diff line number Diff line change
Expand Up @@ -94,12 +94,14 @@ def process(self) -> None:
cfg.name = f"{cfg.name} {case}"
cfg.title = f"{cfg.title} - {case}"
plot = PlotFactory.create_plot(cfg, data)
fig, _ = plot.plot()
atlas.insert_img(fig)
item = plot.plot()
for fig, _ in item:
atlas.insert_img(fig)
else:
plot = PlotFactory.create_plot(plot_cfg, dfs)
fig, _ = plot.plot()
atlas.insert_img(fig)
item = plot.plot()
for fig, _ in item:
atlas.insert_img(fig)

# Save the atlas
atlas.save(self.atlas_folder_path)
6 changes: 5 additions & 1 deletion src/jade/post/excel_routines.py
Original file line number Diff line number Diff line change
Expand Up @@ -520,7 +520,11 @@ def autofit_columns(
# better to consider the 2nd layer as the first will have more space
try:
# there may be more than one layer
max_header = max(len(str(c)) for c in col[1:])
head_values = [len(str(c)) for c in col[1:]]
if len(head_values) > 0:
max_header = max(head_values)
else:
max_header = 0
except IndexError:
max_header = 0
# if the second header is empty, take the first
Expand Down
4 changes: 2 additions & 2 deletions tests/post/test_plotter.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ def test_plot(self, tmpdir):
data = [("data1", data1), ("data2", data2), ("data3", data3)]

plot = BinnedPlot(cfg, data)
fig, ax = plot.plot()
fig.savefig(tmpdir.join("test.png"))
output = plot.plot()
output[0][0].savefig(tmpdir.join("test.png"))


class TestWavesPlot:
Expand Down

0 comments on commit d70b1c5

Please sign in to comment.