Various small fixes - #2876
Merged
Merged
Conversation
This folder of scripts doesnt exist in v4
This now works with xdim=1 and ydim=1 (when it comes to ingestion of SGRID, and when testing alongside `test_moving_eddy`). xref https://github.com/Parcels-code/Parcels/pull/2135/changes#r2256749529
VeckoTheGecko
commented
Sep 2, 2026
|
|
||
| def __repr__(self): | ||
| return f"Field(name={self.name}, model={self.model})" | ||
| return f"Field(name={self.name!r}, model={self.model})" |
Contributor
Author
There was a problem hiding this comment.
Ensures quotes. i.e., Field(name='U', ... instead of Field(name=U
| outputdt : {pfile.outputdt!r} | ||
| metadata : | ||
| {_format_list_items_multiline(pfile.metadata, level=2, with_brackets=False)} | ||
| metadata : {_format_list_items_multiline(pfile.metadata, level=2, with_brackets=False)} |
Contributor
Author
There was a problem hiding this comment.
formatting fix
Comment on lines
+86
to
+87
| [feature.test.pypi-dependencies] | ||
| re-assert = "*" |
Contributor
Author
There was a problem hiding this comment.
Makes it very easy to test strings against regexes in Pytest.
https://github.com/asottile/re-assert
with
def test_field_repr(fieldset):
- Matches(r"Field\(name=.*, model=.*\)").assert_matches(repr(fieldset.U))
+ Matches(r"Field\(field_name=.*, model=.*\)").assert_matches(repr(fieldset.U))
def test_vectorfield_repr(fieldset):
it gives failure of
E AssertionError: regex failed to match at:
E
E > Field(name='U', model=<parcels._core.model.StructuredModelData object at 0x333847110>)
E ^
.pixi/envs/default/lib/python3.14/site-packages/re_assert.py:63: AssertionError
As opposed to a generic uninformative "regex failed to match" error that we'd get from the re library directly
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Changes:
tests-v3/test_reprs.pyinto the main test suite, and deletingtests-v3See comments on individual commits for more info
Checklist
mainfor normal development,v3-supportfor v3 support)AI Disclosure
None used