joglekara / vlapy Goto Github PK
View Code? Open in Web Editor NEW1D-1V Vlasov-Poisson(-Fokker-Planck), Plasma Physics PDE Simulation Tool in NumPy and experiment management in MLFlow
License: MIT License
1D-1V Vlasov-Poisson(-Fokker-Planck), Plasma Physics PDE Simulation Tool in NumPy and experiment management in MLFlow
License: MIT License
This should be a straightforward implementation that resembles the existing 2nd order centered-difference ("cd2") implementation.
run_vlapy.py
could use some sort end-run notification on what to do next - there was no feedback that any simulation was being run, except a notification about a directory being created. A brief summary of https://vlapy.readthedocs.io/en/latest/#quick-usage could be nice - and I always recommend https://github.com/tqdm/tqdm for any simulation 😄
The core logic inside the for
loop in the manager is a bit more messy than it needs to be. Let's clean that up so that it's more legible.
Going through the JOSS review, looking at https://joss.readthedocs.io/en/latest/review_criteria.html#community-guidelines
There should be clear guidelines for third-parties wishing to:
Contribute to the software
Report issues or problems with the software
Seek support
And I'm not really seeing anything like that here. It's probably a good idea to include. Perhaps something like https://github.com/sunpy/sunpy/blob/master/CONTRIBUTING.rst could be a good idea?
VlaPy currently uses a pseudo-spectral integration scheme for the Vlasov equation. It would be interesting to implement Semi-Lagrangian schemes and compare their performance.
Use the formulation from the following paper:
Afeyan, B., Casas, F., Crouseilles, N., Dodhy, A., Faou, E., Mehrenberger, M., & Sonnendrücker, E. (2014). Simulations of kinetic electrostatic electron nonlinear (KEEN) waves with variable velocity resolution grids and high-order time-splitting. The European Physical Journal D, 68(10), 295. https://doi.org/10.1140/epjd/e2014-50212-6
Hey, I'm getting back to reviewing the project (sorry for the delay!). I got to this point:
A statement of need: Do the authors clearly state what problems the software is designed to solve and who the target audience is?
And in the documentation and README I can see only
VlaPy is a 1-spatial-dimension, 1-velocity-dimension, Vlasov-Poisson-Fokker-Planck code written in Python. The Vlasov-Poisson-Fokker-Planck system of equations is commonly used in plasma physics.
I think this could be expanded a little. The goal is stated pretty clearly, but the target audience is not mentioned, except very broadly (plasma physicists).
This termination condition will be dependent on information the outer loop stepper gets from the inner loop.
There are two integrators available, and while the signature of their call is the same, we unfortunately have two different lines corresponding to the two integrators in the time loop.
We should make it so that we can "choose an integrator" while maintaining the same for
loop over the timesteps.
Then we can easily add more integrators.
Why is the axis arbitrary in fig. 4 of the paper?
It's not clear what you mean by a "fully integrated workflow".
Add functionality such that certain information is recorded at every timestep e.g. the amount of electrostatic, thermal, or driver energy in the system.
Same as the other benchmarking-related issues. It would be good to have some data on how these solvers perform in conservation properties and speed wrt Nx and Nv.
Running $ python3 run_vlapy.py
on commit b66c674 I obtain the following error:
Traceback (most recent call last):
File "run_vlapy.py", line 84, in <module>
name=mlflow_exp_name,
TypeError: start_run() missing 1 required positional argument: 'uris'
Looking at run_vlapy.py
and vlapy/manager.py
it does appear that there's a missing argument.
Same as the other benchmarking-related issues. It would be good to have some data on how these solvers perform in conservation properties and speed wrt Nx and Nv.
Both of the currently-implemented Fokker-Planck operators, Lenard-Bernstein, lb
, and Dougherty, dg
, result in solving a tridiagonal matrix.
The Fokker-Planck operator is not coupled in x, so it is completely independent and parallelizable in x.
A simple but powerful implementation of solving independent tridiagonal systems is the TDMA algorithm e.g. https://en.wikipedia.org/wiki/Tridiagonal_matrix_algorithm
We should be able to extend this algorithm using NumPy's broadcasting rules.
Given an MLFlow run directory and experiment ID:
Provide the ability to visualize:
This will bring the landau_damping.py
file along with others into the main codebase. This allows easier running of notebooks and other examples, and increases accountability for testing.
The notebook needs a few updates:
..
to sys.path" trick at the start made my import fail. It would also fail with the notebook in any other location. I think if the setup.py install or pip install of the package goes through well, it should be unnecessary.from vlapy
import needs to be replaced with from vlapy.core
.
xarray.interactive
may soon be an option to do that). That's completely optional, though.#23 helped a ton for rendering the docstrings. However, going through them, now, I found https://vlapy.readthedocs.io/en/latest/code/fokker-planck.html#vlapy.core.lenard_bernstein.make_philharmonic_matrix and completely stumbled on vax
. It would be immensely helpful for new users to add even a few words for each argument, leaving no function undocumented. Since the arguments are often the same between multiple functions, the actual workload probably won't be that high.
Type hints are also always a great idea!
Also, I'm sorry for doing this review in this kind of staggered manner. I hope you don't mind!
Add functionality to save moments of the distribution function e.g. density, current, temperature at every time-step. This will come through storage in the sim_config
from the inner loop.
Add the ability to plot these moments as well
Extend the existing functionality for storing fields to store the moments.
Ideally, store the moments in a xarray.Dataset
object where each Dataarray
represents one of the moment quantities.
The README says "This page will look like the following", but no figure is shown.
The paper by Zaharia is missing a DOI.
Done:
Have plots of Compute_time
with respect to Nx
and Nv
for dg
, lb
, naive
, batched_tridiagonal
.
Pick a test. Suggest a finite pulse duration, linear and non-linear EPW.
Make the measurements with respect to the series quantities as well as the compute time.
I was looking through the Code section of the documentation and it seems empty. Looking at https://github.com/joglekara/VlaPy/blob/master/docs/code/fokker-planck.rst, I'm not yet sure why it doesn't include anything... https://github.com/joglekara/VlaPy/blob/master/vlapy/core/lenard_bernstein.py does have docstrings. Might be worth looking at the Sphinx build for any warnings it could be raising. I can try looking at it a bit later.
There is some disentangling still left to do. This issue will ideally address the ability to swap in a different inner loop stepper seamlessly.
VlaPy currently uses a pseudo-spectral integration scheme for the Vlasov equation. It would be interesting to implement Semi-Lagrangian schemes and compare their performance.
trying to run run_nlepw.py or any other code throw this error
.......................................................................
File "/Volumes/subodh/MS/plasma/landau/.venv/lib/python3.11/site-packages/mlflow/tracking/fluent.py", line 294, in start_run
_validate_experiment_id_type(experiment_id)
File "/Volumes/subodh/MS/plasma/landau/.venv/lib/python3.11/site-packages/mlflow/utils/validation.py", line 359, in _validate_experiment_id_type
raise MlflowException(
mlflow.exceptions.MlflowException: Invalid experiment id: <Experiment: artifact_location='file:///Volumes/subodh/MS/plasma/landau/VlaPy-master/mlruns/259967108510978607', creation_time=1700213405953, experiment_id='259967108510978607', last_update_time=1700213405953, lifecycle_stage='active', name='landau-damping', tags={}> of type <class 'mlflow.entities.experiment.Experiment'>. Must be one of str, int, or None.
.......................................................................
I ran the installation instructions but got
dpsanders$ python3 run_vlapy.py
Traceback (most recent call last):
File "run_vlapy.py", line 30, in <module>
from diagnostics import landau_damping, z_function
ModuleNotFoundError: No module named 'diagnostics'
This will modify the following:
1 - E * df/dv -- can probably just use a finite difference scheme, and possibly use a non-uniform FFT scheme
2 - collision operator -- the linear operator will have different coefficients to correspond to the different \delta v
3 - charge calculation -- Poisson solver
4 - moment calculation -- logging
There is a lot of code reuse in the testing code. This needs some refactoring so that the tests can continue to be maintained.
For example, the initializations of many of the tests is the same, but copied over from test to test. This is unnecessary and redundant. For a more general implementation, please see the test_collisions.py
.
Provide a method with which to be able to swap in and out new methods for integrating the v df/dx
or E df/dv
components of the Vlasov equation.
This will also require updating the Vlasov tests such that new additions can be easily tested in the existing framework.
This requires a few things to be implemented:
storing:
resuming:
See Joglekar2016, Epperlein1994, RidgersKinghamK22008
This should be a straightforward implementation that resembles the existing 2nd order centered difference ("cd2") edfdv implementation
I just tried to install another Python package and got the message
ERROR: vlapy 1.0 has requirement matplotlib==3.1.3, but you'll have matplotlib 3.2.1 which is incompatible.
ERROR: vlapy 1.0 has requirement numpy==1.18.1, but you'll have numpy 1.18.4 which is incompatible.
ERROR: vlapy 1.0 has requirement scipy==1.4.1, but you'll have scipy 1.1.0 which is incompatible.
So it seems like your requirements are too strict.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.