diff --git a/.github/workflows/ci_with_install.yml b/.github/workflows/ci_with_install.yml index 649fbc0..d0e503c 100644 --- a/.github/workflows/ci_with_install.yml +++ b/.github/workflows/ci_with_install.yml @@ -27,7 +27,7 @@ jobs: image: openmc/openmc:develop steps: - name: Checkout repository - uses: actions/checkout@v2 + uses: actions/checkout@v4 - name: install package run: | diff --git a/tests/test_core_with_model.py b/tests/test_core_with_model.py index 5478187..396c70f 100644 --- a/tests/test_core_with_model.py +++ b/tests/test_core_with_model.py @@ -3,6 +3,7 @@ sample_initial_particles, plot_source_energy, plot_source_position, + plot_source_direction ) import numpy as np import plotly.graph_objects as go diff --git a/tests/test_core_with_source.py b/tests/test_core_with_source.py index 6bf6145..69f3ba2 100644 --- a/tests/test_core_with_source.py +++ b/tests/test_core_with_source.py @@ -31,7 +31,7 @@ def test_source(): def test_sample_initial_particles(test_source): - particles = test_source.sample_initial_particles(n_samples=42) + particles = sample_initial_particles(this=test_source, n_samples=42) for particle in particles: assert particle.E == 14e6 assert str(particle.particle) == "neutron" @@ -40,7 +40,8 @@ def test_sample_initial_particles(test_source): def test_energy_plot_with_bins(test_source): - plot = test_source.plot_source_energy( + plot = plot_source_energy( + this=test_source, n_samples=10, energy_bins=np.linspace(0, 20e6, 100), ) @@ -48,46 +49,50 @@ def test_energy_plot_with_bins(test_source): def test_energy_plot(test_source): - plot = test_source.plot_source_energy(n_samples=10) + plot = plot_source_energy(this=test_source, n_samples=10) assert isinstance(plot, go.Figure) assert len(plot.data[0]["x"]) == 1 def test_energy_plot_axis(test_source): - plot = test_source.plot_source_energy( - n_samples=10, xaxis_type="log", yaxis_type="linear", xaxis_units="eV" + plot = plot_source_energy( + this=test_source, + n_samples=10, + xaxis_type="log", + yaxis_type="linear", + xaxis_units="eV" ) - plot = test_source.plot_source_energy( - n_samples=10, xaxis_type="linear", yaxis_type="log", xaxis_units="MeV" + plot = plot_source_energy( + this=test_source, n_samples=10, xaxis_type="linear", yaxis_type="log", xaxis_units="MeV" ) assert isinstance(plot, go.Figure) assert len(plot.data[0]["x"]) == 1 def test_position_plot(test_source): - plot = test_source.plot_source_position(n_samples=10) + plot = plot_source_position(this=test_source, n_samples=10) assert isinstance(plot, go.Figure) def test_direction_plot(test_source): - plot = test_source.plot_source_direction(n_samples=10) + plot = plot_source_direction(this=test_source, n_samples=10) assert isinstance(plot, go.Figure) def test_energy_plot_with_figure(test_source): base_figure = go.Figure() - plot = test_source.plot_source_energy(figure=base_figure, n_samples=10) + plot = plot_source_energy(this=test_source, figure=base_figure, n_samples=10) assert isinstance(plot, go.Figure) assert len(plot.data[0]["x"]) == 1 def test_position_plot_with_figure(test_source): base_figure = go.Figure() - plot = test_source.plot_source_position(figure=base_figure, n_samples=10) + plot = plot_source_position(this=test_source, figure=base_figure, n_samples=10) assert isinstance(plot, go.Figure) def test_direction_plot_with_figure(test_source): base_figure = go.Figure() - plot = test_source.plot_source_direction(figure=base_figure, n_samples=10) + plot = plot_source_direction(this=test_source, figure=base_figure, n_samples=10) assert isinstance(plot, go.Figure)