Skip to content

003 feature nearest neighbour sampler#20

Merged
oj-tooth merged 17 commits into
mainfrom
003-feature-nearest-neighbour-sampler
Jul 3, 2026
Merged

003 feature nearest neighbour sampler#20
oj-tooth merged 17 commits into
mainfrom
003-feature-nearest-neighbour-sampler

Conversation

@b-barton

Copy link
Copy Markdown
Collaborator

Fixes issue #3 . I've started off 1-feature-initial-oceanosse-workflow-skeleton so should be merged after. This branch bring in a sampler that simply finds the nearest neighbour on the model grid to a profile location. There are test to accompany it. At the moment it expects the model dataset to have lat and lon variables, i and j coordinates. It expects the profile dataset to have profile_id as a coordinate.
Fixed a profile which is tied for finding the nearest neighbour gives inconsistent test results.

@b-barton b-barton requested a review from oj-tooth June 26, 2026 14:26
@b-barton b-barton self-assigned this Jun 26, 2026
@b-barton b-barton linked an issue Jun 26, 2026 that may be closed by this pull request
Comment thread OceanOSSE/sampling/sampler_nearest_neighbour.py
Comment thread tests/unit/test_sampler.py Outdated

@oj-tooth oj-tooth left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nice work here! Two comments:

  • Should we use xarray internal geographical indexing to identify model grid points by longitude and latitude? Shailee is also doing this, so seems like we could be more closely aligned here.

  • Suggestion on testing - using fixtures for synthetic testing data structures.

@b-barton b-barton added the mod:sampler Relates to sampling modules. label Jun 29, 2026
@b-barton

Copy link
Copy Markdown
Collaborator Author

I've added in the time of the profile here now too. So this fixes #7 .

@oj-tooth oj-tooth left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

  • Nice work, let's get this merged into main and we can always iron out any performance challenges once we get to the first integration test: upper 2000m slab replacement.

@oj-tooth oj-tooth merged commit 85bd371 into main Jul 3, 2026
1 check passed
@oj-tooth oj-tooth deleted the 003-feature-nearest-neighbour-sampler branch July 3, 2026 13:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

mod:sampler Relates to sampling modules.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[feature] Create simple nearest neighbour sampler

2 participants