parcels icon indicating copy to clipboard operation
parcels copied to clipboard

Refactoring of FieldSet field store

Open VeckoTheGecko opened this issue 6 months ago • 2 comments

https://github.com/OceanParcels/Parcels/blob/595b7a94cdf97182df53c88fa99cf05646f07346/parcels/fieldset.py#L162-L197

I don't like the current implementation of .add_field() calling set_attr(self, name, field). Programmatically storing these fields messes with static typecheckers, and it would be clearer if this was handled another way (either a list of fields, a dictionary, or something else). We can set __getattr__ so users can still do fieldset.U

VeckoTheGecko avatar Aug 20 '24 18:08 VeckoTheGecko