Skip to content

Assert that field names have to valid Python attributes #2101

@VeckoTheGecko

Description

@VeckoTheGecko

This enables us to consistently use attribute access such as fieldset.U

  • use assert_valid_python_varname function already in particle.py (move out to _core.utils.common)
  • Add call to this function in VectorField, and Field init, and into Fieldset.add_constant. Try and except, catching and rewriting the error message
  • Add tests

Metadata

Metadata

Assignees

Labels

hackathon2025Good issues for the hackathon at the Parcels anniversary event in 2025.v4

Type

No type

Projects

Status

Done

Status

Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions