-
Notifications
You must be signed in to change notification settings - Fork 137
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
New and updated reprs
for Variable, ParticleFile, Field, VectorField, and ParticleSet
#1743
Conversation
reprs
for reprs
for Variable, ParticleFile, Field, and ParticleSet
234bacf
to
fd7db3a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice start to better printing! See below a few comments. I'll also trigger them in the Parcels tutorial notebook, so that users see these print statements in action
docs/examples/parcels_tutorial.ipynb
Outdated
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The _warn_outputdt_release_desync()
call should be fixed by #1744
But it would be nice if the particles are listed one per line in the other cells?
Multiline particle printing Update function naming FieldSet repr
5283cc6
to
7db3d62
Compare
return textwrap.dedent(out).strip() | ||
|
||
|
||
def fieldset_repr(fieldset: FieldSet) -> str: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The fields now don't print their own name; that would be the most important information?
return f"[\n{items_str}\n{indentation_str_end}]" | ||
|
||
|
||
def particleset_repr(pset: ParticleSet) -> str: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
`default_repr` doesn't play well with None types
reprs
for Variable, ParticleFile, Field, and ParticleSetreprs
for Variable, ParticleFile, Field, VectorField, and ParticleSet
New/updated reprs for:
contributes to #1693