Skip to content

Commit

Permalink
Update Stub Files
Browse files Browse the repository at this point in the history
  • Loading branch information
ax3l authored and github-actions[bot] committed May 17, 2024
1 parent 28f37f8 commit f0ea24c
Show file tree
Hide file tree
Showing 4 changed files with 120 additions and 9 deletions.
17 changes: 8 additions & 9 deletions src/python/impactx/__init__.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -17,28 +17,26 @@ from __future__ import annotations
import os as os

from amrex import space3d as amr
from impactx.extensions.ImpactXParIter import register_ImpactXParIter_extension
from impactx.extensions.ImpactXParticleContainer import (
register_ImpactXParticleContainer_extension,
)
from impactx.impactx_pybind import (
Config,
CoordSystem,
ImpactX,
ImpactXParConstIter,
ImpactXParIter,
ImpactXParticleContainer,
RefPart,
coordinate_transformation,
distribution,
elements,
push,
)
from impactx.ImpactXParIter import register_ImpactXParIter_extension
from impactx.ImpactXParticleContainer import register_ImpactXParticleContainer_extension
from impactx.madx_to_impactx import read_beam, read_lattice

from . import (
ImpactXParIter,
ImpactXParticleContainer,
MADXParser,
impactx_pybind,
madx_to_impactx,
)
from . import MADXParser, extensions, impactx_pybind, madx_to_impactx

__all__ = [
"Config",
Expand All @@ -54,6 +52,7 @@ __all__ = [
"cxx",
"distribution",
"elements",
"extensions",
"impactx_pybind",
"madx_to_impactx",
"os",
Expand Down
69 changes: 69 additions & 0 deletions src/python/impactx/extensions/ImpactXParIter.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
"""
This file is part of ImpactX
Copyright 2023 ImpactX contributors
Authors: Axel Huebl
License: BSD-3-Clause-LBNL
"""

from __future__ import annotations

__all__ = [
"register_ImpactXParIter_extension",
"soa",
"soa_int_comps",
"soa_real_comps",
]

def register_ImpactXParIter_extension(impactx_pybind):
"""
ImpactXParIter helper methods
"""

def soa(self):
"""
Get the StructOfArrays on the current tile
Parameters
----------
self : ImpactXParIter or ImpactXParConstIter
used to query particle container component names
"""

def soa_int_comps(pti, num_comps):
"""
Name the ImpactX int components in SoA.
Parameters
----------
pti : ImpactXParIter or ImpactXParConstIter
used to query particle container component names
num_comps : int
number of components to generate names for.
Returns
-------
A list of length num_comps with values.
"""

def soa_real_comps(pti, num_comps):
"""
Name the ImpactX ParticleReal components in SoA.
Parameters
----------
pti : ImpactXParIter or ImpactXParConstIter
used to query particle container component names
num_comps : int
number of components to generate names for.
Returns
-------
A list of length num_comps with values.
"""
38 changes: 38 additions & 0 deletions src/python/impactx/extensions/ImpactXParticleContainer.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
"""
This file is part of ImpactX
Copyright 2023 ImpactX contributors
Authors: Axel Huebl
License: BSD-3-Clause-LBNL
"""

from __future__ import annotations

__all__ = ["ix_pc_plot_mpl_phasespace", "register_ImpactXParticleContainer_extension"]

def ix_pc_plot_mpl_phasespace(self, num_bins=50, root_rank=0):
"""
Plot the longitudinal and transverse phase space projections with matplotlib.
Parameters
----------
self : ImpactXParticleContainer_*
The particle container class in ImpactX
num_bins : int, default=50
The number of bins for spatial and momentum directions per plot axis.
root_rank : int, default=0
MPI root rank to reduce to in parallel runs.
Returns
-------
A matplotlib figure with containing the plot.
For MPI-parallel ranks, the figure is only created on the root_rank.
"""

def register_ImpactXParticleContainer_extension(ixpc):
"""
ImpactXParticleContainer helper methods
"""
5 changes: 5 additions & 0 deletions src/python/impactx/extensions/__init__.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
from __future__ import annotations

from . import ImpactXParIter, ImpactXParticleContainer

__all__ = ["ImpactXParIter", "ImpactXParticleContainer"]

0 comments on commit f0ea24c

Please sign in to comment.