Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable different types of diagnostics for ParticleDiagnostic() in Python #4720

Open
wants to merge 4 commits into
base: development
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion Python/pywarpx/picmi.py
Original file line number Diff line number Diff line change
Expand Up @@ -2383,6 +2383,9 @@ class ParticleDiagnostic(picmistandard.PICMI_ParticleDiagnostic, WarpXDiagnostic
warpx_format: {plotfile, checkpoint, openpmd, ascent, sensei}, optional
Diagnostic file format

warpx_diag_type: {Full, BoundaryScraping, BackTransformed}, 'Full' by default, optional
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hm, allowing BackTransformed makes it confusing, since this seems to duplicate the capability of LabFrameParticleDiagnostic... We can discuss this in more detail.

Diagnostic type

warpx_openpmd_backend: {bp, h5, json}, optional
Openpmd backend file format

Expand All @@ -2404,6 +2407,7 @@ class ParticleDiagnostic(picmistandard.PICMI_ParticleDiagnostic, WarpXDiagnostic
def init(self, kw):

self.format = kw.pop('warpx_format', 'plotfile')
self.type = kw.pop('warpx_diag_type', 'Full')
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Awesome, great work!

Can you please just a few lines above, in the documentation string, add an entry for the new warpx_diag_type option? That way it will be shown in our manual automatically and users will find it.
https://warpx.readthedocs.io/en/latest/usage/python.html#diagnostics

self.openpmd_backend = kw.pop('warpx_openpmd_backend', None)
self.file_prefix = kw.pop('warpx_file_prefix', None)
self.file_min_digits = kw.pop('warpx_file_min_digits', None)
Expand All @@ -2426,7 +2430,7 @@ def diagnostic_initialize_inputs(self):

self.add_diagnostic()

self.diagnostic.diag_type = 'Full'
self.diagnostic.diag_type = self.type
self.diagnostic.format = self.format
self.diagnostic.openpmd_backend = self.openpmd_backend
self.diagnostic.file_min_digits = self.file_min_digits
Expand Down
Loading