Skip to content
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: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@ ZOS-API can also be added in patch releases.

### Fixed

- DataFrames returned by the Wavefront Map analysis now have the same size as the requested sampling, with the first row and column containing NaN values. Row and column labels span the range [-1, 1] for the coordinates inside the pupil (#222)
Comment thread
crnh marked this conversation as resolved.

### Deprecated

### Removed
Expand Down
5 changes: 4 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,10 @@ module = ["zospy.api._ZOSAPI", "zospy.api._ZOSAPI_constants"]
ignore_errors = true

[dependency-groups]
dev = ["pytest-mock>=3.15.1"]
dev = [
"ipykernel>=7.2.0",
"pytest-mock>=3.15.1",
]
docs = [
"ipython>=8.37.0",
"myst-parser>=4.0.1",
Expand Down
20 changes: 20 additions & 0 deletions tests/analyses/test_wavefront.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,18 @@ def test_to_json(self, simple_system):
result = WavefrontMap().run(simple_system)
assert result.from_json(result.to_json()).to_json() == result.to_json()

def test_datagrid_indices(self, simple_system):
sampling = 64
result = WavefrontMap(sampling=f"{sampling}x{sampling}").run(simple_system)

step_size = result.data.index[1] - result.data.index[0]

assert result.data.index[1] == pytest.approx(-1.0)
assert result.data.columns[1] == pytest.approx(-1.0)
assert result.data.index[-1] == pytest.approx(1.0)
assert result.data.columns[-1] == pytest.approx(1.0)
assert step_size == pytest.approx(2 / (sampling - 2))

@pytest.mark.parametrize(
"sampling,use_exit_pupil", [("64x64", True), ("64x64", False), ("128x128", True), ("128x128", False)]
)
Expand All @@ -31,6 +43,14 @@ def test_wavefront_map_returns_correct_result(self, simple_system, sampling, use

assert_frame_equal(result.data, expected_data.data)

@pytest.mark.parametrize(
"sampling,use_exit_pupil", [("64x64", True), ("64x64", False), ("128x128", True), ("128x128", False)]
)
def test_wavefront_map_matches_reference_data(self, simple_system, sampling, use_exit_pupil, reference_data):
result = WavefrontMap(sampling=sampling, use_exit_pupil=use_exit_pupil).run(simple_system)

assert_frame_equal(result.data, reference_data.data)


class TestZernikeStandardCoefficients:
def test_can_run(self, simple_system):
Expand Down
Loading
Loading