Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[TST] Bump pytest>=8 and resolve deprecations #514

Merged
merged 5 commits into from
May 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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()
Loading