aboutsummaryrefslogtreecommitdiff
path: root/Examples/Tests/ParticleDataPython/PICMI_inputs_2d.py (follow)
AgeCommit message (Collapse)AuthorFilesLines
2022-12-02Clean up examples folders (#3545)Gravatar Edoardo Zoni 1-160/+0
* Clean up examples folders * Use `snake_case` names * Rename `nci_corrector` as `nci_fdtd_stability`
2022-08-11`isort`: AMReX, WarpX, etc. as First Party (#3307)Gravatar Axel Huebl 1-0/+1
* `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.
2022-01-20Fix unstable Python_particle_attr_access CI tests (#2766)Gravatar Roelof Groenewald 1-3/+5
* explicitly set the numpy random seed in Python_particle_attr_access tests * also shrink boundaries in which particles are injected for good measure * also explicitly set the numpy random seed in Python_restart_runtime_components CI test
2021-12-22Change _libwarpx.py functions to LibWarpX class methods (#2696)Gravatar Peter Scherpelz 1-8/+7
* Initial attempt at moving function into LibWarpX * Bugfix - undefined structs in get_particle_theta This is untested, identified by IDE/visual inspection only * Unify newlines * Delete libwarpx.clight (duplicated picmi.py) See picmi.constants.c * Change function descriptive comment to docstring Also remove extra newline in __init__ beginning. * Replace pywarpx/_libwarpx calls appropriately * Fix atexit register of finalize function * Reorder WarpX.py imports for pre-commit * Use picmi.Simulation.extension = libwarpx alias This will hopefully preempt user script changes if we restructure things to allow multiple WarpX runs to be done within a single Python script. * Fix libwarpx ref in WarpX.getProbLo/getProbHi * Update get_particle_boundary_buffer doc reference
2021-12-21pre-commit: Python imports (#2686)Gravatar Axel Huebl 1-1/+2
* pre-commit: Python imports Add two new Python rules to: - remove unused imports - sort imports according to PEP8 * pre-commit: Python imports Add two new Python rules to: - remove unused imports - sort imports according to PEP8 `.editorconfig`: isort options https://github.com/PyCQA/isort/wiki/isort-Settings * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * move import os (mpl) * move import yt (mpl) * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Cleanup around matplotlib.use * [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci * Cleaning: double np and lib Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
2021-12-16Wrap shared object in a class to control its loading (#2637)Gravatar David Grote 1-12/+10
* Wrap shared object in a class to control its loading * Fix libwarpx attribute references * Updated callbacks.py for updated libwarpx * Removed the wx module plus other clean up * Further revision of how to use the pywarpx module. Now, _libwarpx should not be imported by external scripts except in special circumstances. * Updated documentation * Clean up end of line whitespace * Added more wrapping routines plus some clean up * Fixed use of pywarpx in two examples * Fix for getistep * Fixed for the EB Python interface * Silence a warning for our wrapper Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja>
2021-12-15Examples: Python ShellBang & Executable (#2673)Gravatar Axel Huebl 1-0/+2
* Examples: Python ShellBang & Executable Make sure that all PICMI scripts and all analysis Python scripts in `Examples/` are: - executable (`chmod a+x`) - start with a shell-bang to `python3` Now, all scripts can be run directly without a `python3 ...` prefix and also default to the only right executable of Python on older systems. (New systems always have a `python3` alias, too.) * Revert a moved numpy
2021-11-19Mini-PR: Improve Python particle attribute access CI test (#2581)Gravatar Roelof Groenewald 1-22/+22
* updated the Python particle attribute access CI test * additional fixes needed for tests to pass * changes requested by Axel during code review * Apply suggestions from code review Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja>
2021-08-02Allow extra particle attributes (besides ux, uy, uz and w) to be set at ↵Gravatar Roelof Groenewald 1-0/+157
particle creation in AddNParticles() (#2115) * exposes AddRealComp to Python to allow extra particle attributes to be added at runtime; also includes a new function to grab a particle data array from the name of the component rather than the index * added functionality to AddNParticles() to allow extra particle attributes to also be set during particle creation * added function to get index of a particle component given the PID name * changed new get component index and get_particle_arrays_from_comp_name functions to take species name as argument rather than species id * changed warpx_addRealComp to accept a species name as input and only add the new component for that species * added a test of the pywarpx bridge to get particle data and add new particle attributes at runtime * changed all particle interacting functions in libwarpx to use the species name rather than id, also changed the functions to get particle array data to use the component name rather than index * updated test according to PR #2119 changes * removed unneeded BL_ASSERT(nattr == 1) statement * fixed bug in add_particles to correctly determine the number of extra attributes * fixed bug in AddNParticles if fewer attribute values are passed than the number of extra arrays for the species * use isinstance(attr, ndarray) rather than type(attr) is np.ndarray * generalize_runtime_comps_io * fix OpenPMD * fix OpenPMD * fix plot flags in WritePlotFile * fix offset and comment * changed extra pid test to not use an underscore in the pid name * switched _libwarpx.py::add_particles to use kwargs to accept the weight and extra attribute arrays * License update in test file Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja> * fix typo * added a test with unique_particles=False * Apply suggestions from code review Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja> * updated docstring and comments Co-authored-by: atmyers <atmyers2@gmail.com> Co-authored-by: Axel Huebl <axel.huebl@plasma.ninja>