Skip to content

Commit

Permalink
Merge pull request #514 from drewejohnson/test-deps/436
Browse files Browse the repository at this point in the history
[TST] Bump pytest>=8 and resolve deprecations
  • Loading branch information
drewejohnson authored May 16, 2024
2 parents ec46c96 + 6a0539d commit 3260a70
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 8 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ dependencies = [

[project.optional-dependencies]
extras = ["pandas>1", "scipy"]
test = ["pytest>=6", "pytest-cov", "coverage"]
test = ["pytest>=8", "pytest-cov", "coverage"]
ci = ["jupyter"]

[tool.setuptools]
Expand Down
2 changes: 1 addition & 1 deletion src/serpentTools/detectors.py
Original file line number Diff line number Diff line change
Expand Up @@ -1359,7 +1359,7 @@ def hexPlot(self,
if val <= thresh:
continue
values.append(val)
h = RegularPolygon(xy, 6, radius, rotation, **kwargs)
h = RegularPolygon(xy, 6, radius=radius, orientation=rotation, **kwargs)
verts = h.get_verts()
vmins = verts.min(0)
vmaxs = verts.max(0)
Expand Down
Binary file added tests/plots/result_images/testHexPlot.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 12 additions & 6 deletions tests/plots/test_detectors.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
import pytest
from serpentTools.data import readDataFile

from . import compare_or_update_plot
Expand All @@ -11,15 +10,22 @@ def testSpectrumPlot():


@compare_or_update_plot
def testBwrMeshPlot():
def testBwrMeshPlot(recwarn):
reader = readDataFile("bwr_det0.m")
# Ensure that fix for #414 in in: matplotlib colorbar norm
with pytest.warns(None) as record:
reader["xymesh"].meshPlot(fixed={"energy": 0})
assert len(record) == 0

reader["xymesh"].meshPlot(fixed={"energy": 0})
assert len(recwarn) == 0

@compare_or_update_plot
def testSpectrumJustNormPerLethargy():
reader = readDataFile("bwr_det0.m")
reader["spectrum"].spectrumPlot(by=None, fixed={"reaction": 1})


@compare_or_update_plot
def testHexPlot():
reader = readDataFile("hexplot_det0.m")
h2 = reader["hex2"]
h2.pitch = 1
h2.hexType = 2
h2.hexPlot()

0 comments on commit 3260a70

Please sign in to comment.