Skip to content

Conversation

@tibisabau
Copy link

Description

Removed the FieldSet.add_constant() method from Parcels v4 as it is no longer necessary without JIT compilation. In v4, kernel functions can directly inherit variables from their enclosing scope, eliminating the need for an explicit method to add constants to the fieldset.

The implementation maintains backward compatibility for internal use by keeping the constants dictionary and updating internal kernel initialization code to use direct dictionary assignment (fieldset.constants[key] = value) instead of the removed method. Warning messages were updated to guide users toward the new approach.

Closes #2337.

The code in this pull request was generated by GitHub Copilot with the Claude Sonnet 4.5 model.

Checklist if Applicable

  • The tests passed – pytest tests
  • Linting passed
  • Documentation has been added
  • CHANGELOG.md has been updated

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

Labels

None yet

Projects

Status: Backlog

Development

Successfully merging this pull request may close these issues.

Remove FieldSet.add_constant() method?

1 participant