Skip to content

Commit

Permalink
Merge branch 'main' into data-licence-update
Browse files Browse the repository at this point in the history
# Conflicts:
#	examples/Getting_started.ipynb
  • Loading branch information
GraemeWatt committed Feb 15, 2024
2 parents 3918d70 + b8f41b3 commit f440480
Show file tree
Hide file tree
Showing 14 changed files with 801 additions and 445 deletions.
2 changes: 1 addition & 1 deletion .bumpversion.cfg
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[bumpversion]
current_version = 0.14.0
current_version = 0.14.2
commit = True
tag = True

Expand Down
13 changes: 7 additions & 6 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,17 +47,18 @@ jobs:
- uses: actions/checkout@v4

- name: Setup Micromamba environment
uses: mamba-org/provision-with-micromamba@v15
uses: mamba-org/setup-micromamba@v1
with:
environment-file: false
environment-name: ci
extra-specs: |
create-args: >-
python=${{ matrix.python-version }}
root=${{ matrix.root-version }}
imagemagick
ghostscript
pip
channels: conda-forge
condarc: |
channels:
- conda-forge
- name: ROOT info
run: |
Expand Down Expand Up @@ -102,9 +103,9 @@ jobs:
- name: Upload notebooks
if: ${{ always() }}
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: notebooks py3
name: notebooks-${{ matrix.root-version }}-${{ matrix.python-version }}-${{ matrix.os }} py3-${{ matrix.root-version }}-${{ matrix.python-version }}-${{ matrix.os }}
path: examples/*.html

- name: Run pylint
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ If you are not sure about your Python environment, please also see below how to

## Getting started

For using `hepdata_lib`, you don't even need to install it, but can use the [binder](https://mybinder.org/) or [SWAN](https://swan.cern.ch/) (CERN-only) services using one of the buttons below and following the instructions in the notebook with name [Getting_started](examples/Getting_started.ipynb):
For using `hepdata_lib`, you don't even need to install it, but can use the [binder](https://mybinder.org/) or [SWAN](https://swan.cern.ch/) (CERN-only) services using one of the buttons below:

[![Binder](https://mybinder.org/badge.svg)](https://mybinder.org/v2/gh/HEPData/hepdata_lib/main?filepath=examples/Getting_started.ipynb)
[![SWAN](https://swanserver.web.cern.ch/swanserver/images/badge_swan_white_150.png)](https://cern.ch/swanserver/cgi-bin/go/?projurl=https://github.com/HEPData/hepdata_lib.git)
Expand Down
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ def __getattr__(cls, name):
author = 'Andreas Albert, Clemens Lange'

# The short X.Y version
version = '0.14.0'
version = '0.14.2'
# The full version, including alpha/beta/rc tags
release = '0.14.0'
release = '0.14.2'


# -- General configuration ---------------------------------------------------
Expand Down
15 changes: 14 additions & 1 deletion docs/dev.rst
Original file line number Diff line number Diff line change
Expand Up @@ -121,4 +121,17 @@ Analysing the code
pylint hepdata_lib/*.py
pylint tests/*.py --rcfile=tests/pylintrc

These commands are run by GitHub Actions, so you should first check locally that no issues are flagged.
These commands are run by GitHub Actions, so you should first check locally that no issues are flagged.


Making a release
----------------

After making a new release available on `PyPI`_, a `JIRA`_ issue (`example`_) should be opened to request that
``hepdata_lib`` is upgraded in future `LCG Releases`_ used by `SWAN`_.

.. _PyPI: https://pypi.org/project/hepdata-lib/
.. _JIRA: https://its.cern.ch/jira/projects/SPI/
.. _example: https://its.cern.ch/jira/browse/SPI-2507
.. _LCG Releases: https://lcginfo.cern.ch/pkg/hepdata_lib/
.. _SWAN: http://swan.cern.ch/
15 changes: 15 additions & 0 deletions docs/setup.rst
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,21 @@ On LXPLUS and many other local computing sites with CVMFS and Apptainer (previou
This opens a new shell with ``hepdata_lib``, ROOT, and Python 3 available.
Your home directory and most other user directories on the machine on which you execute Apptainer will also be accessible from within this shell.

Using SWAN
++++++++++

`SWAN`_ requires a CERN account. ``hepdata_lib`` should already be installed in most recent `LCG Releases`_ used by
SWAN. The latest LCG Release might not contain the latest ``hepdata_lib`` version. The `LCG Nightly`_, possibly
containing a more recent ``hepdata_lib`` version, can be used by selecting the "Bleeding Edge" software stack in the
SWAN configuration. Alternatively, you can upgrade ``hepdata_lib`` by adding a local installation path to the
``$PYTHONPATH`` in a startup script specified as the "Environment script" in the SWAN configuration (see
`Install packages in CERNBox`_). Then execute ``!pip install hepdata_lib --user --upgrade`` in your Jupyter notebook
to upgrade ``hepdata_lib`` to the latest version.

.. _SWAN: http://swan.cern.ch/
.. _LCG Releases: https://lcginfo.cern.ch/pkg/hepdata_lib/
.. _LCG Nightly: https://lcginfo.cern.ch/#nightlies
.. _Install packages in CERNBox: https://swan.docs.cern.ch/advanced/install_packages/

.. _sec-setup-developers:

Expand Down
10 changes: 9 additions & 1 deletion docs/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -351,4 +351,12 @@ After creating the Uncertainty objects, the only additional step is to attach th
variable.add_uncertainty(unc1)
variable.add_uncertainty(unc2)


See `Uncertainties`_ for more guidance. In particular, note that ``hepdata_lib`` will omit the ``errors`` key from the
YAML output if all uncertainties are zero for a particular bin, printing a warning message "Note that bins with zero
content should preferably be omitted completely from the HEPData table". A legitimate use case is where there are
multiple dependent variables and a (different) subset of the bins has missing content for some dependent variables.
In this case the uncertainties should be set to zero for the missing bins with a non-numeric central value like ``'-'``.
The warning message can be suppressed by passing an optional argument ``zero_uncertainties_warning=False`` when
defining an instance of the ``Variable`` class.

.. _`Uncertainties`: https://hepdata-submission.readthedocs.io/en/latest/data_yaml.html#uncertainties
16 changes: 5 additions & 11 deletions examples/Getting_started.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,7 @@
"source": [
"# Getting started with hepdata_lib\n",
"\n",
"The following instructions and examples should get you started to get your analysis into [HEPData](https://hepdata.net) using `hepdata_lib`. Please also refer to the [documentation](http://hepdata-lib.readthedocs.io/). While you can also run `hepdata_lib` on your local computer, you can use the [binder](https://mybinder.org/) or [SWAN](http://swan.cern.ch/) services in the browser. Mind that SWAN is only available for people with a CERN account.\n",
"\n",
"## SWAN-specific instructions\n",
"\n",
"For SWAN, if you haven't done so already, open up a new terminal (going back to the project tab and clicking the terminal icon in the top right), and enter the following to install `hepdata_lib`:\n",
"```\n",
"pip install --user hepdata_lib\n",
"```\n",
"Then go back to the notebook."
"The following instructions and examples should get you started to get your analysis into [HEPData](https://hepdata.net) using `hepdata_lib`. Please also refer to the [documentation](http://hepdata-lib.readthedocs.io/). While you can also run `hepdata_lib` on your local computer, you can use the [binder](https://mybinder.org/) or [SWAN](http://swan.cern.ch/) services in the browser. Mind that SWAN is only available for people with a CERN account."
]
},
{
Expand All @@ -35,12 +27,14 @@
"name": "stdout",
"output_type": "stream",
"text": [
"Welcome to JupyROOT 6.26/06\n"
"Welcome to JupyROOT 6.26/06\n",
"hepdata_lib version 0.14.1\n"
]
}
],
"source": [
"import hepdata_lib"
"import hepdata_lib\n",
"print(\"hepdata_lib version\", hepdata_lib.__version__)"
]
},
{
Expand Down
Loading

0 comments on commit f440480

Please sign in to comment.