By signing in you accept the Terms of Use and acknowledge the Privacy Policy and Cookie Policy: https://gitlab.eufus.psnc.pl/-/users/terms

Skip to content
Snippets Groups Projects
user avatar
Jonathan Citrin authored
Update numpy API for >2 compatibility

See merge request qualikiz-group/QuaLiKiz-pythontools!69
e21d73f5
History

QuaLiKiz-pythontools

A collection of tools for QuaLiKiz in Python.

This is a collection of Python modules to be used for working with QuaLiKiz, a quasi-linear gyrokinetic code. QuaLiKiz can be found on GitLab. This repository contains the source for the Python package qualikiz_tools. Use the qualikiz_tools CLI (Command Line Interface) to generate, run and analyze QuaLiKiz runs. For more advanced usage scenarios the modules themselves can be used in other python scripts. For example, the QuaLiKiz neural network QLKNN-10D training set was generated in this way. You can find more "doc-like docs" on GitLab Pages.

Install

The recommended way to install qualikiz_tools is to use pip. Although installation is not strictly necessary to use the python modules, it is advised to install anyway for the full power of the CLI.

  1. Set up your SSH keys

  2. Clone the repository from GitLab. If you want to install as submodule of QuaLiKiz (preferred)

     git clone git@gitlab.com:QuaLiKiz-group/QuaLiKiz.git
     cd QuaLiKiz
     git submodule init
     git submodule update

    Or NOT RECOMMENDED if you instead want to install standalone, clone using

     git clone git@gitlab.com:QuaLiKiz-group/QuaLiKiz-pythontools.git
  3. Install qualikiz_tools. This fully installs it in developer mode in your USER_SITE. The option --editable is always required, in order for relative paths to QuaLiKiz binaries to work, do not omit!

     cd QuaLiKiz-pythontools
     pip install --user --upgrade --editable .[all]

Usage

Examples scripts can be found in qualikiz_tools/examples. A workflow example is given below:

  1. Generate a template QuaLiKiz run directory using the CLI

    qualikiz_tools create example
    cd runs/example
  2. Adjust the parameters.json to your liking (optional)

  3. Generate the input binaries using the CLI

    qualikiz_tools input generate .
  4. Submit the job. We assume the machine specific files exist. Use 'bash' if they do not, which assumes you can run an mpi program using mpirun

    qualikiz_tools launcher launch bash .
  5. After the job is done, convert the output to netCDF.

    qualikiz_tools output to_netcdf .
  6. Plot your netCDF file, for example:

    qualikiz_tools plot --flux ef .

FAQ

  • How do I find out what each CLI command does?

    qualikiz_tools help
    qualikiz_tools <command> help