Skip to content

Allow setting of ParticleClass variable data after initialisation #2186

@VeckoTheGecko

Description

@VeckoTheGecko

On the Particle class level, we should support the modifying of variable data (to_write status, dtype, initial).

These modifications should be validated (i.e., have setters) to avoid unsupported input


I think it was because I think that I think that set_variable_write_status should be removed from ParticleSet, and instead should be defined on the particle itself

my_particle = get_default_particle(np.float64)
my_particle.variables['depth'].to_write = False

I feel it makes more sense, and also defining this before constructing the ParticleSet would prevent a class of bugs.

You're right that this shouldn't have slipped into this PR. I will add back the test and xfail it pending a future PR along the above lines.

Originally posted by @VeckoTheGecko in #2142 (comment)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    Backlog

    Status

    Backlog

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions