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

Read only values in Field #1686

Closed
VeckoTheGecko opened this issue Sep 4, 2024 · 3 comments
Closed

Read only values in Field #1686

VeckoTheGecko opened this issue Sep 4, 2024 · 3 comments

Comments

@VeckoTheGecko
Copy link
Contributor

VeckoTheGecko commented Sep 4, 2024

Lets make the following read only (so that users don't try to edit it expecting it to propagate to the grid

Parcels/parcels/field.py

Lines 192 to 197 in 93cc635

# self.lon, self.lat, self.depth and self.time are not used any more in parcels.
# self.grid should be used instead.
# Those variables are still defined for backwards compatibility with users codes.
self.lon = self.grid.lon
self.lat = self.grid.lat
self.depth = self.grid.depth

cc: @sruehs

@erikvansebille
Copy link
Member

In fact, we could even deprecate the field.lon, field.lat and field.depth attributes; I left them in for backward compatibility when we moved to a GridSet structure back in v2.0. So it's really old, redundant code that's there just for convenience.

@VeckoTheGecko
Copy link
Contributor Author

Yes, thats also a possibility. Let's save this particular discussion for down the line where I review all attributes/methods and suggest actions to take (deprecate to make private, make read only, etc)

@VeckoTheGecko
Copy link
Contributor Author

Done in #1709

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

2 participants