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

Add ProSelecta example to add_additional_resource in docs #270

Merged
merged 2 commits into from
Jul 25, 2024
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
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/usage.rst
Original file line number Diff line number Diff line change
Expand Up @@ -125,13 +125,16 @@ Additional resources, hosted either externally or locally, can be linked with th
sub.add_additional_resource("Some file", "root_file.root", copy_file=True)
sub.add_additional_resource("Some file", "root_file.root", copy_file=True, resource_license={"name": "CC BY 4.0", "url": "https://creativecommons.org/licenses/by/4.0/", "description": "This license enables reusers to distribute, remix, adapt, and build upon the material in any medium or format, so long as attribution is given to the creator."})
sub.add_additional_resource("Archive of full likelihoods in the HistFactory JSON format", "Likelihoods.tar.gz", copy_file=True, file_type="HistFactory")
sub.add_additional_resource("Selection and projection function examples", "analysis.cxx", copy_file=True, file_type="ProSelecta")

The first argument is a ``description`` and the second is the ``location`` of the external link or local resource file.
The optional argument ``copy_file=True`` (default value of ``False``) will copy a local file into the output directory.
The optional argument ``resource_license`` can be used to define a data license for an additional resource.
The ``resource_license`` is in the form of a dictionary with mandatory string ``name`` and ``url`` values, and an optional ``description``.
The optional argument ``file_type="HistFactory"`` (default value of ``None``) can be used to identify statistical models provided in the HistFactory JSON
format rather than relying on certain trigger words in the ``description`` (see `pyhf section of submission documentation`_).
The optional argument ``file_type="ProSelecta"`` (default value of ``None``) can be used to identify C++ snippets in the ProSelecta format for use with
the NUISANCE framework for event generators in neutrino physics (see `NUISANCE section of submission documentation`_).

**Please note:** The default license applied to all data uploaded to HEPData is `CC0`_. You do not
need to specify a license for a resource file unless it differs from `CC0`_.
Expand All @@ -147,6 +150,7 @@ The ``add_link`` function can alternatively be used to add a link to an external
Again, the first argument is a ``description`` and the second is the ``location`` of the external link.

.. _`pyhf section of submission documentation`: https://hepdata-submission.readthedocs.io/en/latest/analyses.html#pyhf
.. _`NUISANCE section of submission documentation`: https://hepdata-submission.readthedocs.io/en/latest/analyses.html#nuisance

Adding links to related records
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down
2 changes: 1 addition & 1 deletion hepdata_lib/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ def add_additional_resource(self, description, location, copy_file=False, file_t
:param copy_file: If set to true, will attempt to copy a local file to the tar ball.
:type copy_file: bool

:param file_type: Type of the resource file. Currently, only "HistFactory" has any effect.
:param file_type: Type of the resource file (None, "HistFactory" or "ProSelecta").
:type file_type: string

:param resource_license: License information comprising name, url and optional description.
Expand Down