Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix PyPi bug during imports #87

Merged
merged 17 commits into from
Feb 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion .github/workflows/runfitbot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
- name: Install project 🔨
# it is required to repeat extras, otherwise they will be removed from
# the environment
run: poetry install --no-interaction ${{ inputs.poetry-extras }}
run: poetry install --no-interaction

- name: Perform a fit 🚀
shell: bash --login {0}
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/unittests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ jobs:
# it is required to repeat extras, otherwise they will be removed from
# the environment
run: poetry install --no-interaction ${{ inputs.poetry-extras }}
- name: Download the theory
run: poetry run nns get theory
- name: Install task runner 🔨
run: pip install poethepoet
- name: Lint with pylint 🚀
Expand Down
3 changes: 0 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,9 +25,6 @@
- [Tutorials](https://nnpdf.github.io/nnusf/tutorials/datasets.html)
- [Delivery & Usage](https://nnpdf.github.io/nnusf/delivery/lhapdf.html)

> **Note**
> For the time being, we recommend the user to use the
> [development](https://nnpdf.github.io/nnusf/quickstart/installation.html#development-installation) installation.

# Citation

Expand Down
29 changes: 17 additions & 12 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -55,24 +55,29 @@ To reference NNSFν in a scientific publication please use the following:

.. code-block:: latex

@article {reference_id,
author = {A. Candido, A. Garcia, G. Magni, T. R. Rabemananjara, J. Rojo, R. Stegeman},
title = {Neutrino Structure Functions from GeV to EeV Energies},
year = {2023},
doi = {10.1101/2020.07.15.204701},
eprint = {https://arxiv.org/list/hep-ph/},
journal = {aRxiv}
@article{Candido:2023utz,
author = "Candido, Alessandro and Garcia, Alfonso and Magni, Giacomo and Rabemananjara, Tanjona and Rojo, Juan and Stegeman, Roy",
title = "{Neutrino Structure Functions from GeV to EeV Energies}",
eprint = "2302.08527",
archivePrefix = "arXiv",
primaryClass = "hep-ph",
reportNumber = "Nikhef 2022-014, Edinburgh 2022/27, TIF-UNIMI-2023-5",
month = "2",
year = "2023"
}

If NNSFν proves to be useful in your work, please also reference the codes:

.. code-block:: latex

@article {reference_id,
author = {A. Candido, A. Garcia, G. Magni, T. R. Rabemananjara, J. Rojo, R. Stegeman},
title = {Neutrino Structure Functions from GeV to EeV Energies},
year = {2023},
doi = {10.1101/2020.07.15.204701},
@misc{https://doi.org/10.5281/zenodo.7657132,
doi = {10.5281/ZENODO.7657132},
url = {https://zenodo.org/record/7657132},
author = "Candido, Alessandro and Garcia, Alfonso and Magni, Giacomo and Rabemananjara, Tanjona and Rojo, Juan and Stegeman, Roy",
title = "{Neutrino Structure Functions from GeV to EeV Energies}",
publisher = {Zenodo},
year = {2023},
copyright = {Open Access}
}


Expand Down
6 changes: 4 additions & 2 deletions docs/source/mbadges.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
<p align="center">
<img alt="Zenodo" src="https://zenodo.org/badge/DOI/10.1101/2023.02.15.204701.svg">
<a href="https://zenodo.org/account/settings/github/repository/NNPDF/nnusf#"><img alt="Zenodo" src="https://zenodo.org/badge/DOI/10.5281/zenodo.7657132 .svg"></a>
<a href="https://arxiv.org/abs/2302.08527"><img alt="arXiv" src="https://img.shields.io/badge/arXiv-2302.08527-b31b1b?labelColor=222222"></a>
<a href="https://pypi.org/project/nnusf/"><img alt="PyPI" src="https://img.shields.io/pypi/v/nnusf"/></a>
<img alt="Docs" src="https://assets.readthedocs.org/static/projects/badges/passing-flat.svg">
<img alt="Status" src="https://www.repostatus.org/badges/latest/active.svg">
<img alt="License" src="https://img.shields.io/badge/License-MIT-yellow.svg">
<img alt="License" src="https://img.shields.io/badge/License-GPL3-blue.svg">
</p>
62 changes: 48 additions & 14 deletions docs/source/quickstart/installation.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,25 @@ via the `Python Package Index <https://pypi.org/>`_ using the following command:

pip install nnusf

.. note::

In order to use NNSFν one needs to download the the :mod:`commondata`
and :mod:`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:

.. code-block:: console

nns get theory

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

.. code-block:: console

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:

Expand All @@ -31,30 +50,45 @@ 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:math:`\nu` package just type:
Then, to install the NNSFν package just type:

.. code-block:: bash

poetry install

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

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

poetry config virtualenvs.create false --local
.. code-block:: console

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:
poetry config virtualenvs.create false --local

.. code-block:: bash
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))
.. code-block:: console

Then download the scripts from `N3PDF/workflows/packages/lhapdf <https://github.com/N3PDF/workflows/tree/v2/packages/lhapdf>`_
and install :mod:`LHAPDF`:
export PREFIX=$(realpath $(poetry env --path))

.. code-block:: bash
Then download the scripts from
`N3PDF/workflows/packages/lhapdf <https://github.com/N3PDF/workflows/tree/v2/packages/lhapdf>`_
and install :mod:`LHAPDF`:

.. code-block:: console

sh install.sh

.. tip::

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

.. code-block:: console

poetry shell

sh install.sh
otherwise prepending all the commands by :mod:`poetry` will be required.
8 changes: 4 additions & 4 deletions docs/source/tutorials/datasets.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Once this is done run the following command:

.. code-block:: bash

nnu data filter ./commondata/rawdata/*
nnu data filter ${NNUSF_USERDIR}/commondata/rawdata/*

This will dump the pandas tables containing the input kinematics,
central values, and uncertainties in :mod:`commondata/kinematics`,
Expand All @@ -43,7 +43,7 @@ To do so, just run the following:

.. code-block:: bash

nnu data coefficients ./commondata/data/*
nnu data coefficients ${NNUSF_USERDIR}/commondata/data/*


Yadism pseudo-data
Expand All @@ -58,7 +58,7 @@ to generate the input kinematics, just run the following command:

.. code-block:: bash

nnu data matching_grids_empty ./commondata/data/DATA_${EXPERIMENT}_${OBSERVABLE}.csv
nnu data matching_grids_empty ${NNUSF_USERDIR}/commondata/data/DATA_${EXPERIMENT}_${OBSERVABLE}.csv

This will generate inside :mod:`commondata/kinematics` a table named
:mod:`KIN_${EXPERIMENT}_${OBSERVABLE}_MATCHING.csv` containing the input
Expand Down Expand Up @@ -103,4 +103,4 @@ just need to run the same command as before:

.. code-block:: bash

nnu data coefficients ./commondata/data/*
nnu data coefficients ${NNUSF_USERDIR}/commondata/data/*
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading