Giter VIP home page Giter VIP logo

vlapy's People

Contributors

arfon avatar dpsanders avatar joglekara avatar kyleniemeyer avatar stanczakdominik avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

vlapy's Issues

Modularize the component-integrators of the Vlasov equation

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.

invalide experiment id

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.

.......................................................................

Updates for the `Landau_damping` notebook

The notebook needs a few updates:

  • The "add .. 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.
  • The from vlapy import needs to be replaced with from vlapy.core.
  • The notebook - especially the "Initialize and run" part - could definitely use some more breaking up to explain the defined variables, especially the commented out sets of those. Drop some more narrative in!
  • A question, because the docs weren't really clear on that - what's the connection between the notebook and the MLFlow style run? does the notebook implement the same sort of simulation?
  • A stretch goal - I would have loved an animation to go along with the 2D plot (xarray.interactive may soon be an option to do that). That's completely optional, though.

Bring diagnostics into the main codebase

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.

Benchmark the edfdv solvers

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.

Semi-Lagrangian velocity advection

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.

Implement a batched tridiagonal solver using broadcasting and the TDMA algorithm

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.

TypeError: start_run() missing 1 required positional argument: 'uris'

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.

Comments on paper

  • Why is the axis arbitrary in fig. 4 of the paper?

  • It's not clear what you mean by a "fully integrated workflow".

Implement resume/restart functionality

This requires a few things to be implemented:

storing:

  • dump the full distribution function

resuming:

  • resetting/starting the outer loop timers correctly
  • resetting/starting the storage mechanisms correctly
  • loading the distribution function
  • loading the electric field

Add a non-uniform velocity grid

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

Modularize the time integrator

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.

Benchmarking the vdfdx solvers

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.

Requirments are too strict

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.

Save various moments of the distribution function at every timestep

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.

Better describe the goal, target audience of the project

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).

Refactor the manager

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.

Semi-Lagrangian spatial advection

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.

Make a front end for live-plotting simulation results

Given an MLFlow run directory and experiment ID:

Provide the ability to visualize:

  • distribution function
    -- fourier-modes
    -- reconstructions
  • fields
    -- fourier-modes
    -- reconstructions
  • series
    -- overlap ( ability to choose )

Refactor storage tests

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.

Missing dependency?

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'

More explicit variable docstrings!

#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!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.