Skip to content
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

API changes: particlefile.py and other touchups #1727

Merged
merged 11 commits into from
Oct 22, 2024
Merged

API changes: particlefile.py and other touchups #1727

merged 11 commits into from
Oct 22, 2024

Conversation

VeckoTheGecko
Copy link
Contributor

@VeckoTheGecko VeckoTheGecko commented Oct 9, 2024

Contributes to #1695

Changes

  • API changes

This PR makes many of the names in particlefile.py (and some other files):

  • private - in the case where users are not expected to use them (attributes and methods),
  • read only where edits to said variables would provide unexpected behaviour/side effects (attributes), or
  • removed (where they are either legacy code, or there are better mechanisms to achieve the same result)

All privatisations/removals are done in a non-breaking way, raising a deprecation warning.

The method/attributes affected are:

Class Method/Attribute Action
ParticleSet iterator() remove
ParticleData iterator() remove
ParticleFile add_metadata() remove
ParticleFile write_once() make_private
ParticleFile create_new_zarrfile read_only
ParticleFile outputdt read_only
ParticleFile chunks read_only
ParticleFile particleset read_only
ParticleFile fname read_only
ParticleFile vars_to_write read_only
ParticleFile time_origin read_only
ParticleFile parcels_mesh make_private
ParticleFile maxids make_private
ParticleFile pids_written make_private
ParticleFile mpi_rank make_private
ParticleFile fill_value_map make_private
ParticleFile analytical make_private (+rename)
Grid lon_grid_to_target() remove
Grid lon_remapping remove
Grid lon_grid_to_source() remove
Grid lon_particle_to_target() remove
Variable name read_only

@VeckoTheGecko VeckoTheGecko changed the title [WIP] API changes API changes: particlefile.py and other touchups Oct 14, 2024
@VeckoTheGecko VeckoTheGecko marked this pull request as ready for review October 14, 2024 10:16
@VeckoTheGecko
Copy link
Contributor Author

VeckoTheGecko commented Oct 14, 2024

Once this is merged, I'll do some testing with the team, and then we're good to do a release (from the API POV)

parcels/kernel.py Outdated Show resolved Hide resolved
VeckoTheGecko and others added 11 commits October 22, 2024 10:31
mark ParticleFile.add_metadat() for removal
mark ParticleFile.write_once() as private
create_new_zarrfile
outputdt
chunks
particleset
fname
vars_to_write
time_origin
parcels_mesh
maxids
pids_written
mpi_rank
fill_value_map
analytical
lon_grid_to_target()
lon_remapping
lon_grid_to_source()
lon_particle_to_target()
@VeckoTheGecko VeckoTheGecko merged commit aa716e4 into master Oct 22, 2024
14 checks passed
@VeckoTheGecko VeckoTheGecko deleted the v/api branch October 22, 2024 09:05
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.

2 participants