From 5bece38d452b41d7c01783fdbe1c73004cf03a7b Mon Sep 17 00:00:00 2001 From: Jordan <21129425+ItIsJordan@users.noreply.github.com> Date: Wed, 23 Aug 2023 16:10:46 +0100 Subject: [PATCH] Update documentation (useage.rst) Updates the documentation in usage.rst to describe use of the bidirectional linking feature. --- docs/usage.rst | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/docs/usage.rst b/docs/usage.rst index 82224b6a..28e8caa4 100644 --- a/docs/usage.rst +++ b/docs/usage.rst @@ -112,6 +112,23 @@ The ``create_files`` function writes all the YAML output files you need and pack **Please note**: creating the output files also creates a ``submission`` folder containing the individual files going into the tarball. This folder exists merely for convenience, in order to make it easy to inspect each individual file. It is not recommended to attempt to manually manage or edit the files in the folder, and there is no guarantee that ``hepdata_lib`` will handle any of the changes you make in a graceful manner. As far as we are aware, there is no use case where manual editing of the files is necessary. If you have such a use case, please report it in a Github issue. +Adding links to related records +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +To add a link to a related record object, you can use the `add_related_recid` function of the Submission object. + +**Please note**: Values must be entered as integers. + +:: + + sub.add_related_recid(1) + +In this example, we are adding a link to the submission with the record ID value of `"1"`. + +The documentation for this feature can be found here: (`Linking Records`_). + +.. _`Linking Records` : https://hepdata-submission.readthedocs.io/en/latest/bidirectional.html#linking-records + .. _sec-usage-tab-var: @@ -239,6 +256,22 @@ Lists of recognized keywords are available from the hepdata documentation for `O .. _`Particles`: https://hepdata-submission.readthedocs.io/en/latest/keywords/partlist.html +Adding links to related tables +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +To add a link to a related table object, you can use the `add_related_doi` function of the Table class. + +**Please note**: Your DOIs must match the format: `10.17182/hepdata.[RecordID].v[Version]/t[Table]` + +:: + + table.add_related_doi("10.17182/hepdata.1.v2/t3") + +In this example, we are adding a link to the table with a DOI of: `"10.17182/hepdata.1.v2/t3"`. + +The documentation for this feature can be found here: (`Linking Tables`_). + +.. _`Linking Tables` : https://hepdata-submission.readthedocs.io/en/latest/bidirectional.html#linking-tables Uncertainties ++++++++++++++++++++++++++++++++