Skip to content

Cleanup skipped and xfailed unittests - #3008

Merged
erikvansebille merged 20 commits into
Parcels-code:mainfrom
erikvansebille:cleanup-particlefile-unittests
Oct 28, 2026
Merged

erikvansebille merged 20 commits into
Parcels-code:mainfrom
erikvansebille:cleanup-particlefile-unittests

Conversation

@erikvansebille

@erikvansebille erikvansebille commented Oct 23, 2026 •

Copy link
Copy Markdown
Member

Description

This PR cleans up some of the (failing/skipped) unit tests - thereby also making some small fixes to src. Somewhat tangentially, it also renames the .localize function to .localise, as we (try to) adhere to UK spelling in Parcels.

Checklist

AI Disclosure

None

@erikvansebille erikvansebille changed the title Cleanup particlefile unittests Cleanup skipped and xfailed unittests Oct 26, 2026
@pytest.mark.skip(reason="Pending ParticleFile refactor; see issue #2386")
@pytest.mark.parametrize("dt", [-np.timedelta64(1, "s"), np.timedelta64(1, "s")])
@pytest.mark.parametrize("maxvar", [2, 4, 10])
def test_pset_repeated_release_delayed_adding_deleting(fieldset, tmp_parquet, dt, maxvar):

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I spent quite some time on making this test work for v4, but then decided that it was too complex because the parquet format and the kernel loop have changed so much. So I suggest to remove it - we test/check output in tutorials and on other places

Comment thread tests/test_xgrid.py
@pytest.mark.skip(
"Needs updating after refactoring from https://github.com/Parcels-code/Parcels/pull/2646"
) # TODO: I think we can just rely on the SGRID metadata for this (which already has robust error messaging). How should discrepencies between SGRID and axis attr be handled?
def test_dim_with_duplicate_axis():

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

This test now seems to pass. Parcels doesn't throw an error when a Variable has two dimensions with the same axis. Is that expected?

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.

Hmmm. Its not expected. Perhaps this should be picked up during a metadata validation step by cross-referencing with SGRID. At the moment SGRID is used as the source of truth, potentially ignoring axis metadata attrs in some cases

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Fixed in a76f618. it turned out to be a commented-out assert-function. Could you quickly check if you agree with this solution?

Since it failed on min-versions test
@erikvansebille
erikvansebille marked this pull request as ready for review October 27, 2026 07:52

@VeckoTheGecko VeckoTheGecko 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.

Looks good. A question, but no blockers

Comment thread src/parcels/_core/particlefile.py Resolved
Comment thread tests/test_xgrid.py
@pytest.mark.skip(
"Needs updating after refactoring from https://github.com/Parcels-code/Parcels/pull/2646"
) # TODO: I think we can just rely on the SGRID metadata for this (which already has robust error messaging). How should discrepencies between SGRID and axis attr be handled?
def test_dim_with_duplicate_axis():

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.

Hmmm. Its not expected. Perhaps this should be picked up during a metadata validation step by cross-referencing with SGRID. At the moment SGRID is used as the source of truth, potentially ignoring axis metadata attrs in some cases

And fixing _core under the hood
@erikvansebille
erikvansebille enabled auto-merge (squash) October 28, 2026 16:01
@erikvansebille
erikvansebille merged commit b5c39b5 into Parcels-code:main Oct 28, 2026
19 of 20 checks passed
@github-project-automation github-project-automation Bot moved this from Backlog to Done in Parcels development Oct 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Go through all skipped and xfailed pytest tests

2 participants