diff options
Diffstat (limited to 'Python/pywarpx')
-rw-r--r-- | Python/pywarpx/Bucket.py | 1 | ||||
-rw-r--r-- | Python/pywarpx/Constants.py | 1 | ||||
-rw-r--r-- | Python/pywarpx/PGroup.py | 2 | ||||
-rw-r--r-- | Python/pywarpx/WarpInterface.py | 3 | ||||
-rw-r--r-- | Python/pywarpx/WarpX.py | 18 | ||||
-rw-r--r-- | Python/pywarpx/WarpXPIC.py | 2 | ||||
-rw-r--r-- | Python/pywarpx/__init__.py | 17 | ||||
-rwxr-xr-x | Python/pywarpx/_libwarpx.py | 10 | ||||
-rw-r--r-- | Python/pywarpx/callbacks.py | 6 | ||||
-rw-r--r-- | Python/pywarpx/fields.py | 1 | ||||
-rw-r--r-- | Python/pywarpx/picmi.py | 7 | ||||
-rw-r--r-- | Python/pywarpx/timestepper.py | 3 |
12 files changed, 40 insertions, 31 deletions
diff --git a/Python/pywarpx/Bucket.py b/Python/pywarpx/Bucket.py index 3a0d2862c..917bf47f2 100644 --- a/Python/pywarpx/Bucket.py +++ b/Python/pywarpx/Bucket.py @@ -7,6 +7,7 @@ import numpy as np + class Bucket(object): """ The purpose of this class is to be a named bucket for holding attributes. diff --git a/Python/pywarpx/Constants.py b/Python/pywarpx/Constants.py index abc0c3e87..e899fa255 100644 --- a/Python/pywarpx/Constants.py +++ b/Python/pywarpx/Constants.py @@ -8,6 +8,7 @@ import re from .Bucket import Bucket + class Constants(Bucket): """ The purpose of this class is to be hold user defined constants diff --git a/Python/pywarpx/PGroup.py b/Python/pywarpx/PGroup.py index ad6b4b878..f19c0d079 100644 --- a/Python/pywarpx/PGroup.py +++ b/Python/pywarpx/PGroup.py @@ -5,8 +5,10 @@ # License: BSD-3-Clause-LBNL import numpy as np + from . import _libwarpx + class PGroup(object): """Implements a class that has the same API as a warp ParticleGroup instance. """ diff --git a/Python/pywarpx/WarpInterface.py b/Python/pywarpx/WarpInterface.py index 46c38ffdc..0a1899389 100644 --- a/Python/pywarpx/WarpInterface.py +++ b/Python/pywarpx/WarpInterface.py @@ -14,9 +14,10 @@ # The class WarpX_EM3D inherits from Warp's EM3D class. It primarily provides # access to the field plotting routines. +from pywarpx import PGroup import warp + from . import fields -from pywarpx import PGroup # The particle weight is always the first pid warp.top.wpid = 1 diff --git a/Python/pywarpx/WarpX.py b/Python/pywarpx/WarpX.py index 232550764..8c4900fab 100644 --- a/Python/pywarpx/WarpX.py +++ b/Python/pywarpx/WarpX.py @@ -5,22 +5,20 @@ # # License: BSD-3-Clause-LBNL +from . import Particles, _libwarpx +from .Algo import algo +from .Amr import amr +from .Boundary import boundary from .Bucket import Bucket +from .Collisions import collisions, collisions_list from .Constants import my_constants -from .Amr import amr +from .Diagnostics import diagnostics from .Geometry import geometry -from .Boundary import boundary -from .Algo import algo -from .Langmuirwave import langmuirwave from .Interpolation import interpolation +from .Langmuirwave import langmuirwave from .Lasers import lasers, lasers_list -from . import Particles -from .Particles import particles, particles_list -from .Collisions import collisions, collisions_list from .PSATD import psatd -from .Diagnostics import diagnostics - -from . import _libwarpx +from .Particles import particles, particles_list class WarpX(Bucket): diff --git a/Python/pywarpx/WarpXPIC.py b/Python/pywarpx/WarpXPIC.py index e98ff823d..a2efaffbd 100644 --- a/Python/pywarpx/WarpXPIC.py +++ b/Python/pywarpx/WarpXPIC.py @@ -12,8 +12,10 @@ # able to run a customized PIC simulation with that code. from warp.run_modes.timestepper import PICAPI + from ._libwarpx import libwarpx + class WarpXPIC(PICAPI): def get_time(self): diff --git a/Python/pywarpx/__init__.py b/Python/pywarpx/__init__.py index fb671915e..8751b07ff 100644 --- a/Python/pywarpx/__init__.py +++ b/Python/pywarpx/__init__.py @@ -4,18 +4,17 @@ # # License: BSD-3-Clause-LBNL -from .WarpX import warpx -from .Constants import my_constants +from .Algo import algo from .Amr import amr from .Boundary import boundary +from .Collisions import collisions +from .Constants import my_constants +from .Diagnostics import diagnostics from .Geometry import geometry -from .Algo import algo -from .Langmuirwave import langmuirwave from .Interpolation import interpolation -from .Particles import particles, electrons, positrons, protons, newspecies -from .Collisions import collisions -from .PSATD import psatd +from .Langmuirwave import langmuirwave from .Lasers import lasers -from .Diagnostics import diagnostics - +from .PSATD import psatd +from .Particles import electrons, newspecies, particles, positrons, protons +from .WarpX import warpx from ._libwarpx import * # noqa diff --git a/Python/pywarpx/_libwarpx.py b/Python/pywarpx/_libwarpx.py index 2c942c49d..84e13d1af 100755 --- a/Python/pywarpx/_libwarpx.py +++ b/Python/pywarpx/_libwarpx.py @@ -5,13 +5,14 @@ # # License: BSD-3-Clause-LBNL -# --- This defines the wrapper functions that directly call the underlying compiled routines -import os -import sys -import platform import atexit import ctypes from ctypes.util import find_library as _find_library +# --- This defines the wrapper functions that directly call the underlying compiled routines +import os +import platform +import sys + import numpy as np from numpy.ctypeslib import ndpointer as _ndpointer @@ -21,6 +22,7 @@ try: # --- If mpi4py is going to be used, this needs to be imported # --- before libwarpx is loaded, because mpi4py calls MPI_Init from mpi4py import MPI + # --- Change MPI Comm type depending on MPICH (int) or OpenMPI (void*) if MPI._sizeof(MPI.Comm) == ctypes.sizeof(ctypes.c_int): _MPI_Comm_type = ctypes.c_int diff --git a/Python/pywarpx/callbacks.py b/Python/pywarpx/callbacks.py index 49d0c3db2..35cc51894 100644 --- a/Python/pywarpx/callbacks.py +++ b/Python/pywarpx/callbacks.py @@ -53,15 +53,17 @@ installafterstep(myplots) """ from __future__ import generators -import types import copy -import time import ctypes import sys +import time +import types + import numpy from ._libwarpx import libwarpx + class CallbackFunctions(object): """ Class to handle call back function lists. diff --git a/Python/pywarpx/fields.py b/Python/pywarpx/fields.py index 6f4ec1c43..85b0f2f23 100644 --- a/Python/pywarpx/fields.py +++ b/Python/pywarpx/fields.py @@ -14,6 +14,7 @@ JxWrapper, JyWrapper, JzWrapper """ import numpy as np + try: from mpi4py import MPI as mpi comm_world = mpi.COMM_WORLD diff --git a/Python/pywarpx/picmi.py b/Python/pywarpx/picmi.py index 677253405..cbe01baa6 100644 --- a/Python/pywarpx/picmi.py +++ b/Python/pywarpx/picmi.py @@ -8,12 +8,13 @@ """Classes following the PICMI standard """ -import re import os -import picmistandard +import re + import numpy as np -import pywarpx import periodictable +import picmistandard +import pywarpx codename = 'warpx' picmistandard.register_codename(codename) diff --git a/Python/pywarpx/timestepper.py b/Python/pywarpx/timestepper.py index f75bc8c2b..de341097a 100644 --- a/Python/pywarpx/timestepper.py +++ b/Python/pywarpx/timestepper.py @@ -12,8 +12,7 @@ # Note that this is intended to be an example only and may not be functional. The # onestep routine as written here is out of date and is not consistent with WarpX::Evolve. -from . import libwarpx -from . import callbacks +from . import callbacks, libwarpx class TimeStepper(object): |