Skip to content

[WIP] Adopt pydantic-based PICMI standard#5639

Draft
chillenzer wants to merge 9 commits intoComputationalRadiationPhysics:devfrom
chillenzer:picmi-standard-pydantic-refactoring
Draft

[WIP] Adopt pydantic-based PICMI standard#5639
chillenzer wants to merge 9 commits intoComputationalRadiationPhysics:devfrom
chillenzer:picmi-standard-pydantic-refactoring

Conversation

@chillenzer
Copy link
Copy Markdown
Contributor

@chillenzer chillenzer commented Mar 3, 2026

  • This is WIP, based on my on-going refactoring of the PICMI standard to use pydantic. Point pyproject.toml to the first pydantic-based PICMI version once that is released.
  • Rebase onto latest dev.

Pydantic-based PICMI

This PR starts the process of converging our PICMI implementation to the standard (and correspondingly the standard to our PICMI interface). It's foremost goal is to be a testbed for the changes in the PICMI standard (see here). However, as a side effect, there are quite adjustments to the interface and/or test coverage going on and a number of open issues addressed.

Pydantic-focused changes

The main changes happening here are

  • inheriting from the PICMI standard (if that's not already happening), particularly from PICMI_Extension in cases that are PIConGPU specific
  • overriding typehints and defaults: Narrowing down typehints is a convenient way to signal unsupported arguments/values/...
  • adjusting some tests to assertRaises(ValidationError) instead of manually thrown errors and some minor interface changes.

Standard-convergence changes

Some minor to moderate steps to a more conformant implementation have been taken in the process:

  • Our GriddedLayout now conforms to the standard (BREAKING CHANGE!) and I've added OnePosition as a new layout. There would be better names/interfaces for this but those would not be standard conforming. This will be addressed within the PICMI standard team later. I've also added tests for all supported layouts.
  • Replace the binomial_current_interpolation switch with a standard-conformant BinomialSmoother class added to the ElectromagneticSolver.

@chillenzer chillenzer added this to the 0.9.0 / next stable milestone Mar 3, 2026
@chillenzer chillenzer requested a review from ikbuibui March 3, 2026 12:41
@chillenzer chillenzer added refactoring code change to improve performance or to unify a concept but does not change public API CI:no-compile CI is skipping compile/runtime tests but runs PICMI tests PICMI pypicongpu and picmi related labels Mar 3, 2026
@chillenzer chillenzer force-pushed the picmi-standard-pydantic-refactoring branch from 6d9d7fe to 929d950 Compare March 3, 2026 13:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI:no-compile CI is skipping compile/runtime tests but runs PICMI tests PICMI pypicongpu and picmi related refactoring code change to improve performance or to unify a concept but does not change public API

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant