Installation#

User installation#

The easiest way to install the latest stable version of NNSFν is via the Python Package Index using the following command:

pip install nnusf

Note

In order to use NNSFν one needs to download the the commondata and theory files and store them into the user directory (which is platform/system dependent).

NNSFν provides an easy way to download and install these input data files by simply running the following commands:

nns get theory

To see where the files have been installed, type the following commands:

nns get print_userdir_path

To check that the package has been installed correctly, just run the following which will print out all the available subcommands:

nnu --help

Development installation#

In order to develop on the codes it is required to clone the github repository and install the package using Poetry. To install poetry just follow the instructions here. Once this is done, first clone the repository and enter into the directory:

git clone https://github.com/NNPDF/nnusf.git --depth 1
cd nnusf

Then, to install the NNSFν package just type:

poetry install

Note

Note that when installing using poetry one has the choice of doing so in a poetry virtual environment or not. To install the package in the current active environment, before poetry install type the following command:

poetry config virtualenvs.create false --local

If instead you choose to install the package in a clean environment, first you need to save the path to the environment into an environment variable:

export PREFIX=$(realpath $(poetry env --path))

Then download the scripts from N3PDF/workflows/packages/lhapdf and install LHAPDF:

sh install.sh

Tip

If NNSFv was instead installed in a poetry virtual environment then it may be useful to enter in a poetry shell by invoking the following command:

poetry shell

otherwise prepending all the commands by poetry will be required.