Published November 5, 2020 | Version 0.0.2
Software Open

libpyvinyl-v0.0.2

  • 1. European X-ray Free Electron Laser GmbH

Contributors

Researchers:

  • 1. Mads
  • 2. Juncheng

Description

The python package libpyvinyl exposes the high level API for simulation codes under the umbrella of the Virtual Neutron and x-raY Laboratory (ViNYL).

The fundamental class is the BaseCalculator and its sister class Parameters. While Parameters is a pure state engine, i.e. it's sole purpose is to encapsulate the physical, numerical, and computational parameters of a simulation, the BaseCalculator exposes the interface to

  • Configure a simulation (through the corresponding Parameters instance)
  • Launch the simulation run
  • Collect the simulation output data and make it queriable as a class attribute
  • Snapshoot a simulation by dumping the object to disk (using the dill library).
  • Reload a simulation run from disk and continue the run with optionally modified parameters.

The BaseCalculaton is an abstract base class, it shall not be instantiated as such. The anticipated use is to inherit specialised Calculators from BaseCalculator and to implement the core functionality in the derived class. In particular, this is required for the methods responsible to launch a simulation (run()) .

As an example, we demonstrate in an accompanying notebook how to declare a derived Calculator and implement a backengine method. The example then shows how to run the simulation, store the results in a hdf5 file, snapshot the simulation and reload the simulation into memory.

Files

Files (17.4 kB)

Name Size Download all
md5:0fce7fa82527e6236f2ad2ce91e67046
17.4 kB Download

Additional details

Related works

Funding

PaNOSC – Photon and Neutron Open Science Cloud 823852
European Commission

References