diff options
author | 2022-08-11 19:00:35 -0600 | |
---|---|---|
committer | 2022-08-11 18:00:35 -0700 | |
commit | 64d89befdfd86fc44efe3bcd3a15c31d86181edc (patch) | |
tree | f365c640119227427b8a6dbdaaacc6dca313cd69 | |
parent | b4686616d884e11f4a624989d370b3c032d0c1c4 (diff) | |
download | WarpX-64d89befdfd86fc44efe3bcd3a15c31d86181edc.tar.gz WarpX-64d89befdfd86fc44efe3bcd3a15c31d86181edc.tar.zst WarpX-64d89befdfd86fc44efe3bcd3a15c31d86181edc.zip |
`isort`: AMReX, WarpX, etc. as First Party (#3307)
* `isort`: AMReX, WarpX, etc. as First Party
Mark the `amrex` and `pywarpx`, `picmistandard`, ... imports as first
party, so that they do not change if run locally or remotely pre/post
install.
12 files changed, 15 insertions, 3 deletions
diff --git a/.editorconfig b/.editorconfig index adc5a1c59..301392b54 100644 --- a/.editorconfig +++ b/.editorconfig @@ -35,3 +35,4 @@ indent_size = unset [*.py] # isort config force_sort_within_sections = true +known_first_party = amrex,impactx,picmistandard,pywarpx,warpx diff --git a/Examples/Modules/embedded_boundary_python_API/PICMI_inputs_EB_API.py b/Examples/Modules/embedded_boundary_python_API/PICMI_inputs_EB_API.py index 4619defe1..c0907d677 100755 --- a/Examples/Modules/embedded_boundary_python_API/PICMI_inputs_EB_API.py +++ b/Examples/Modules/embedded_boundary_python_API/PICMI_inputs_EB_API.py @@ -1,5 +1,6 @@ #!/usr/bin/env python3 import numpy as np + from pywarpx import fields, picmi max_steps = 1 diff --git a/Examples/Physics_applications/capacitive_discharge/PICMI_inputs_1d.py b/Examples/Physics_applications/capacitive_discharge/PICMI_inputs_1d.py index 709fefd22..5eac1e172 100644 --- a/Examples/Physics_applications/capacitive_discharge/PICMI_inputs_1d.py +++ b/Examples/Physics_applications/capacitive_discharge/PICMI_inputs_1d.py @@ -8,10 +8,11 @@ import argparse import sys import numpy as np -from pywarpx import callbacks, fields, picmi from scipy.sparse import csc_matrix from scipy.sparse import linalg as sla +from pywarpx import callbacks, fields, picmi + constants = picmi.constants diff --git a/Examples/Physics_applications/capacitive_discharge/PICMI_inputs_2d.py b/Examples/Physics_applications/capacitive_discharge/PICMI_inputs_2d.py index 8b4a625ef..d5a18071a 100755 --- a/Examples/Physics_applications/capacitive_discharge/PICMI_inputs_2d.py +++ b/Examples/Physics_applications/capacitive_discharge/PICMI_inputs_2d.py @@ -6,10 +6,11 @@ # --- used for the field solve step. import numpy as np -from pywarpx import callbacks, fields, picmi from scipy.sparse import csc_matrix from scipy.sparse import linalg as sla +from pywarpx import callbacks, fields, picmi + constants = picmi.constants ########################## diff --git a/Examples/Tests/Langmuir/PICMI_inputs_langmuir_rz_multimode_analyze.py b/Examples/Tests/Langmuir/PICMI_inputs_langmuir_rz_multimode_analyze.py index ae94f1dd3..a515797e3 100755 --- a/Examples/Tests/Langmuir/PICMI_inputs_langmuir_rz_multimode_analyze.py +++ b/Examples/Tests/Langmuir/PICMI_inputs_langmuir_rz_multimode_analyze.py @@ -9,6 +9,7 @@ import matplotlib matplotlib.use('Agg') import matplotlib.pyplot as plt import numpy as np + from pywarpx import fields, picmi constants = picmi.constants diff --git a/Examples/Tests/ParticleDataPython/PICMI_inputs_2d.py b/Examples/Tests/ParticleDataPython/PICMI_inputs_2d.py index 40d0b49ad..c93b84f1f 100755 --- a/Examples/Tests/ParticleDataPython/PICMI_inputs_2d.py +++ b/Examples/Tests/ParticleDataPython/PICMI_inputs_2d.py @@ -3,6 +3,7 @@ import argparse import sys import numpy as np + from pywarpx import callbacks, picmi # Create the parser and add the argument diff --git a/Examples/Tests/ParticleDataPython/PICMI_inputs_prev_pos_2d.py b/Examples/Tests/ParticleDataPython/PICMI_inputs_prev_pos_2d.py index 9cfe669ce..0e988f0fe 100755 --- a/Examples/Tests/ParticleDataPython/PICMI_inputs_prev_pos_2d.py +++ b/Examples/Tests/ParticleDataPython/PICMI_inputs_prev_pos_2d.py @@ -3,6 +3,7 @@ # --- Input file to test the saving of old particle positions import numpy as np + from pywarpx import picmi constants = picmi.constants diff --git a/Examples/Tests/PythonWrappers/PICMI_inputs_2d.py b/Examples/Tests/PythonWrappers/PICMI_inputs_2d.py index 80574ff94..2301a558b 100755 --- a/Examples/Tests/PythonWrappers/PICMI_inputs_2d.py +++ b/Examples/Tests/PythonWrappers/PICMI_inputs_2d.py @@ -3,6 +3,7 @@ import matplotlib.pyplot as plt from mpl_toolkits.axes_grid1.axes_divider import make_axes_locatable import numpy as np + from pywarpx import picmi # Number of time steps diff --git a/Examples/Tests/pass_mpi_communicator/PICMI_inputs_2d.py b/Examples/Tests/pass_mpi_communicator/PICMI_inputs_2d.py index b97905ee0..bdca7ab08 100755 --- a/Examples/Tests/pass_mpi_communicator/PICMI_inputs_2d.py +++ b/Examples/Tests/pass_mpi_communicator/PICMI_inputs_2d.py @@ -6,6 +6,7 @@ # --- if the correct amount of processors are initialized in AMReX. from mpi4py import MPI + from pywarpx import picmi constants = picmi.constants diff --git a/Examples/Tests/restart/PICMI_inputs_runtime_component_analyze.py b/Examples/Tests/restart/PICMI_inputs_runtime_component_analyze.py index bd618dfa1..8843b5dee 100755 --- a/Examples/Tests/restart/PICMI_inputs_runtime_component_analyze.py +++ b/Examples/Tests/restart/PICMI_inputs_runtime_component_analyze.py @@ -7,6 +7,7 @@ import sys import numpy as np + from pywarpx import callbacks, picmi ########################## diff --git a/Python/pywarpx/WarpInterface.py b/Python/pywarpx/WarpInterface.py index 0a1899389..dc80e4bc9 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 pywarpx import PGroup + from . import fields # The particle weight is always the first pid diff --git a/Python/pywarpx/picmi.py b/Python/pywarpx/picmi.py index be227e182..a9a8f80af 100644 --- a/Python/pywarpx/picmi.py +++ b/Python/pywarpx/picmi.py @@ -13,6 +13,7 @@ import re import numpy as np import periodictable + import picmistandard import pywarpx |