Skip to content

Conversation

knutfrode
Copy link
Contributor

No description provided.

@gauteh
Copy link
Member

gauteh commented Sep 9, 2025

We have the previous fixtures here: https://github.com/OpenDrift/trajan/blob/main/tests/fixtures.py so that they are available to all tests.

# assert "obs" in result.dims


def test_distance_to_next(mock_traj):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is tested in test_interpolate

assert "cell_area" in result.data_vars


def test_crop(mock_traj):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tested in geo selection... where the test actually tests something :D


def test_contained_in(mock_traj):
result = mock_traj.contained_in(lonmin=0, lonmax=5, latmin=0, latmax=5)
assert isinstance(result, xr.Dataset)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

?

result = mock_traj.azimuth_to_next()
assert isinstance(result, xr.DataArray)
assert result.name is None
assert "obs" in result.dims
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should test the values?

result = mock_traj.index_of_last()
assert isinstance(result, xr.DataArray)
assert result.name == "index_of_last"
assert "trajectory" in result.dims
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

value?

@knutfrode knutfrode merged commit 0ccfc0c into OpenDrift:main Sep 9, 2025
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants