Skip to content

Commit

Permalink
Merge pull request #1269 from scikit-hep/ikrommyd/backport-docs-link-fix
Browse files Browse the repository at this point in the history
fix: backport fix coffea docs links everywhere
  • Loading branch information
ikrommyd authored Feb 4, 2025
2 parents 80f88ee + 17f850b commit 828617d
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 28 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/user_question.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,4 +11,4 @@ assignees: ''
A clear and concise description of what the goal is.

**Explain what documentation is missing**
If someone else has this same goal, what do you think could be added to https://coffeateam.github.io/coffea/ to help them complete the task on their own?
If someone else has this same goal, what do you think could be added to https://coffea-hep.readthedocs.io/en/backports-v0.7.x/ to help them complete the task on their own?
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

#### **Do you want to write a patch that fixes a bug?**

* Follow the [setup instructions for developers](https://coffeateam.github.io/coffea/installation.html#for-developers) to get a development environment
* Follow the [setup instructions for developers](https://coffea-hep.readthedocs.io/en/backports-v0.7.x/installation.html#for-developers) to get a development environment

* Open a new GitHub pull request with the patch.

Expand All @@ -30,7 +30,7 @@ Changes that are cosmetic in nature and do not add anything substantial to the s

#### **Do you want to contribute to the coffea documentation?**

* Follow the [setup instructions for developers](https://coffeateam.github.io/coffea/installation.html#for-developers) to get a development environment
* Follow the [setup instructions for developers](https://coffea-hep.readthedocs.io/en/backports-v0.7.x/installation.html#for-developers) to get a development environment

* Edit the ReStructured Text files in `docs/source` or the docstrings in the python source code as appropriate

Expand Down
4 changes: 2 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ Install coffea like any other Python package:
pip install coffea
or similar (use ``sudo``, ``--user``, ``virtualenv``, or pip-in-conda if you wish).
For more details, see the `Installing coffea <https://coffeateam.github.io/coffea/installation.html>`_ section of the documentation.
For more details, see the `Installing coffea <https://coffea-hep.readthedocs.io/en/backports-v0.7.x/installation.html>`_ section of the documentation.

Strict dependencies
===================
Expand All @@ -87,4 +87,4 @@ The following are installed automatically when you install coffea with pip:
Documentation
=============
All documentation is hosted at https://coffeateam.github.io/coffea/
All documentation is hosted at https://coffea-hep.readthedocs.io/en/backports-v0.7.x/
4 changes: 2 additions & 2 deletions binder/accumulators.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"A [WeightStatistics](https://coffeateam.github.io/coffea/api/coffea.analysis_tools.WeightStatistics.html) object tracks the smallest and largest weights seen per type, as well as some other summary statistics. It is kept internally and can be accessed via `weights.weightStatistics`. This object is addable, so it can be used in an accumulator."
"A [WeightStatistics](https://coffea-hep.readthedocs.io/en/backports-v0.7.x/api/coffea.analysis_tools.WeightStatistics.html) object tracks the smallest and largest weights seen per type, as well as some other summary statistics. It is kept internally and can be accessed via `weights.weightStatistics`. This object is addable, so it can be used in an accumulator."
]
},
{
Expand Down Expand Up @@ -383,7 +383,7 @@
"source": [
"## Accumulator semantics\n",
"\n",
"Prior to coffea 0.7.2, accumulators were more explicit in that they inherited from [AccumulatorABC](https://coffeateam.github.io/coffea/api/coffea.processor.AccumulatorABC.html). Such accumulators are still supported, but now the requirements for an acuumulator output of a processor have been relaxed to the protocol:\n",
"Prior to coffea 0.7.2, accumulators were more explicit in that they inherited from [AccumulatorABC](https://coffea-hep.readthedocs.io/en/backports-v0.7.x/api/coffea.processor.AccumulatorABC.html). Such accumulators are still supported, but now the requirements for an acuumulator output of a processor have been relaxed to the protocol:\n",
"```python\n",
"class Addable(Protocol):\n",
" def __add__(self: T, other: T) -> T:\n",
Expand Down
8 changes: 4 additions & 4 deletions binder/applying_corrections.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
"source": [
"## Coffea lookup_tools\n",
"\n",
"The entrypoint for `coffea.lookup_tools` is the [extractor class](https://coffeateam.github.io/coffea/api/coffea.lookup_tools.extractor.html#coffea.lookup_tools.extractor)."
"The entrypoint for `coffea.lookup_tools` is the [extractor class](https://coffea-hep.readthedocs.io/en/backports-v0.7.x/api/coffea.lookup_tools.extractor.html#coffea.lookup_tools.extractor)."
]
},
{
Expand Down Expand Up @@ -89,7 +89,7 @@
"source": [
"### Opening a root file and using it as a lookup table\n",
"\n",
"In [tests/samples](https://github.com/CoffeaTeam/coffea/tree/master/tests/samples), there is an example file with a `TH2F` histogram named `scalefactors_Tight_Electron`. The following code reads that histogram into an [evaluator](https://coffeateam.github.io/coffea/api/coffea.lookup_tools.evaluator.html#coffea.lookup_tools.evaluator) instance, under the key `testSF2d` and applies it to some electrons."
"In [tests/samples](https://github.com/CoffeaTeam/coffea/tree/master/tests/samples), there is an example file with a `TH2F` histogram named `scalefactors_Tight_Electron`. The following code reads that histogram into an [evaluator](https://coffea-hep.readthedocs.io/en/backports-v0.7.x/api/coffea.lookup_tools.evaluator.html#coffea.lookup_tools.evaluator) instance, under the key `testSF2d` and applies it to some electrons."
]
},
{
Expand Down Expand Up @@ -344,7 +344,7 @@
"\n",
"### Applying energy scale transformations with jetmet_tools\n",
"\n",
"The `coffea.jetmet_tools` package provides a convenience class [JetTransformer](https://coffeateam.github.io/coffea/api/coffea.jetmet_tools.JetTransformer.html#coffea.jetmet_tools.JetTransformer) which applies specified corrections and computes uncertainties in one call. First we build the desired jet correction stack to apply. This will usually be some set of the various JEC and JER correction text files that depends on the jet cone size (AK4, AK8) and the pileup mitigation algorithm, as well as the data-taking year they are associated with."
"The `coffea.jetmet_tools` package provides a convenience class [JetTransformer](https://coffea-hep.readthedocs.io/en/backports-v0.7.x/api/coffea.jetmet_tools.JetTransformer.html#coffea.jetmet_tools.JetTransformer) which applies specified corrections and computes uncertainties in one call. First we build the desired jet correction stack to apply. This will usually be some set of the various JEC and JER correction text files that depends on the jet cone size (AK4, AK8) and the pileup mitigation algorithm, as well as the data-taking year they are associated with."
]
},
{
Expand Down Expand Up @@ -483,7 +483,7 @@
"metadata": {},
"source": [
"### Applying CMS b-tagging corrections with btag_tools\n",
"The `coffea.btag_tools` module provides the high-level utility [BTagScaleFactor](https://coffeateam.github.io/coffea/api/coffea.btag_tools.BTagScaleFactor.html#coffea.btag_tools.BTagScaleFactor) which calculates per-jet weights for b-tagging as well as light flavor mis-tagging efficiencies. Uncertainties can be calculated as well."
"The `coffea.btag_tools` module provides the high-level utility [BTagScaleFactor](https://coffea-hep.readthedocs.io/en/backports-v0.7.x/api/coffea.btag_tools.BTagScaleFactor.html#coffea.btag_tools.BTagScaleFactor) which calculates per-jet weights for b-tagging as well as light flavor mis-tagging efficiencies. Uncertainties can be calculated as well."
]
},
{
Expand Down
12 changes: 6 additions & 6 deletions binder/histograms.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
"This is a rendered copy of [histograms.ipynb](https://github.com/CoffeaTeam/coffea/blob/master/binder/histograms.ipynb). You can optionally run it interactively on [binder at this link](https://mybinder.org/v2/gh/coffeateam/coffea/master?filepath=binder%2Fhistograms.ipynb)\n",
"\n",
"In scientific python, histograms seem to be considered as a plot style, on equal footing with, e.g. scatter plots.\n",
"It may well be that HEP is the only place where users need to plot *pre-binned* data, and thus must use histograms as persistent objects representing reduced data. In Coffea, the [hist](https://coffeateam.github.io/coffea/modules/coffea.hist.html) subpackage provides a persistable mergable histogram object. This notebook will discuss a few ways that such objects can be manipulated.\n",
"It may well be that HEP is the only place where users need to plot *pre-binned* data, and thus must use histograms as persistent objects representing reduced data. In Coffea, the [hist](https://coffea-hep.readthedocs.io/en/backports-v0.7.x/modules/coffea.hist.html) subpackage provides a persistable mergable histogram object. This notebook will discuss a few ways that such objects can be manipulated.\n",
"\n",
"A histogram object roughly goes through three stages in its life:\n",
"\n",
Expand Down Expand Up @@ -202,7 +202,7 @@
"metadata": {},
"source": [
"but we are becoming challenged by book-keeping of the variables.\n",
"The [histogram class](https://coffeateam.github.io/coffea/api/coffea.hist.Hist.html#coffea.hist.Hist) in Coffea is designed to simplify this operation, and the eventual successor (for filling purposes) [boost-histogram](https://github.com/scikit-hep/boost-histogram#usage) has similar syntax.\n",
"The [histogram class](https://coffea-hep.readthedocs.io/en/backports-v0.7.x/api/coffea.hist.Hist.html#coffea.hist.Hist) in Coffea is designed to simplify this operation, and the eventual successor (for filling purposes) [boost-histogram](https://github.com/scikit-hep/boost-histogram#usage) has similar syntax.\n",
"\n",
"In the constructor you specify each axis, either as a numeric `Bin` axis or a categorical `Cat` axis. Each axis constructor takes arguments similar to ROOT TH1 constructors. One can pass an array to the `Bin` axis for non-uniform binning. Then the fill call is as simple as passing the respective arrays to `histo.fill`."
]
Expand Down Expand Up @@ -628,13 +628,13 @@
"source": [
"To facilitate these operations, there is a package called [mplhep](https://github.com/scikit-hep/mplhep). This package is available standlaone, but it is also used internally by the `coffea.hist` subpackage to provide several convenience functions to aid in plotting `Hist` objects:\n",
"\n",
" * [plot1d](https://coffeateam.github.io/coffea/api/coffea.hist.plot1d.html#coffea.hist.plot1d): Create a 1D plot from a 1D or 2D Hist object\n",
" * [plot1d](https://coffea-hep.readthedocs.io/en/backports-v0.7.x/api/coffea.hist.plot1d.html#coffea.hist.plot1d): Create a 1D plot from a 1D or 2D Hist object\n",
"\n",
" * [plotratio](https://coffeateam.github.io/coffea/api/coffea.hist.plotratio.html#coffea.hist.plotratio): Create a ratio plot, dividing two compatible histograms\n",
" * [plotratio](https://coffea-hep.readthedocs.io/en/backports-v0.7.x/api/coffea.hist.plotratio.html#coffea.hist.plotratio): Create a ratio plot, dividing two compatible histograms\n",
"\n",
" * [plot2d](https://coffeateam.github.io/coffea/api/coffea.hist.plot2d.html#coffea.hist.plot2d): Create a 2D plot from a 2D Hist object\n",
" * [plot2d](https://coffea-hep.readthedocs.io/en/backports-v0.7.x/api/coffea.hist.plot2d.html#coffea.hist.plot2d): Create a 2D plot from a 2D Hist object\n",
"\n",
" * [plotgrid](https://coffeateam.github.io/coffea/api/coffea.hist.plotgrid.html#coffea.hist.plotgrid): Create a grid of plots, enumerating identifiers on up to 3 axes\n",
" * [plotgrid](https://coffea-hep.readthedocs.io/en/backports-v0.7.x/api/coffea.hist.plotgrid.html#coffea.hist.plotgrid): Create a grid of plots, enumerating identifiers on up to 3 axes\n",
" \n",
"Below are some simple examples of using each function on our `histo` object."
]
Expand Down
10 changes: 5 additions & 5 deletions binder/nanoevents.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"\n",
"This is a rendered copy of [nanoevents.ipynb](https://github.com/CoffeaTeam/coffea/blob/master/binder/nanoevents.ipynb). You can optionally run it interactively on [binder at this link](https://mybinder.org/v2/gh/coffeateam/coffea/master?filepath=binder%2Fnanoevents.ipynb)\n",
"\n",
"NanoEvents is a Coffea utility to wrap flat nTuple structures (such as the CMS [NanoAOD](https://www.epj-conferences.org/articles/epjconf/pdf/2019/19/epjconf_chep2018_06021.pdf) format) into a single awkward array with appropriate object methods (such as Lorentz vector methods$^*$), cross references, and nested objects, all lazily accessed$^\\dagger$ from the source ROOT TTree via uproot. The interpretation of the TTree data is configurable via [schema objects](https://coffeateam.github.io/coffea/modules/coffea.nanoevents.html#classes), which are community-supplied for various source file types. These schema objects allow a richer interpretation of the file contents than the [uproot.lazy](https://uproot4.readthedocs.io/en/latest/uproot4.behaviors.TBranch.lazy.html) methods. Currently available schemas include:\n",
"NanoEvents is a Coffea utility to wrap flat nTuple structures (such as the CMS [NanoAOD](https://www.epj-conferences.org/articles/epjconf/pdf/2019/19/epjconf_chep2018_06021.pdf) format) into a single awkward array with appropriate object methods (such as Lorentz vector methods$^*$), cross references, and nested objects, all lazily accessed$^\\dagger$ from the source ROOT TTree via uproot. The interpretation of the TTree data is configurable via [schema objects](https://coffea-hep.readthedocs.io/en/backports-v0.7.x/modules/coffea.nanoevents.html#classes), which are community-supplied for various source file types. These schema objects allow a richer interpretation of the file contents than the [uproot.lazy](https://uproot4.readthedocs.io/en/latest/uproot4.behaviors.TBranch.lazy.html) methods. Currently available schemas include:\n",
"\n",
" - `BaseSchema`, which provides a simple representation of the input TTree, where each branch is available verbatim as `events.branch_name`, effectively the same behavior as `uproot.lazy`. Any branches that uproot supports at \"full speed\" (i.e. that are fully split and either flat or single-jagged) can be read by this schema;\n",
" - `NanoAODSchema`, which is optimized to provide all methods and cross-references in CMS NanoAOD format;\n",
Expand All @@ -19,7 +19,7 @@
"\n",
"We welcome contributions for new schemas, and can assist with the design of them.\n",
"\n",
"$^*$ Vector methods are currently made possible via the [coffea vector](https://coffeateam.github.io/coffea/modules/coffea.nanoevents.methods.vector.html) methods mixin class structure. In a future version of coffea, they will instead be provided by the dedicated scikit-hep [vector](https://vector.readthedocs.io/en/latest/) library, which provides a more rich feature set. The coffea vector methods predate the release of the vector library.\n",
"$^*$ Vector methods are currently made possible via the [coffea vector](https://coffea-hep.readthedocs.io/en/backports-v0.7.x/modules/coffea.nanoevents.methods.vector.html) methods mixin class structure. In a future version of coffea, they will instead be provided by the dedicated scikit-hep [vector](https://vector.readthedocs.io/en/latest/) library, which provides a more rich feature set. The coffea vector methods predate the release of the vector library.\n",
"\n",
"$^\\dagger$ _Lazy_ access refers to only fetching the needed data from the (possibly remote) file when a sub-array is first accessed. The sub-array is then _materialized_ and subsequent access of the sub-array uses a cached value in memory. As such, fully materializing a `NanoEvents` object may require a significant amount of memory.\n",
"\n",
Expand Down Expand Up @@ -48,9 +48,9 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"In the factory constructor, we also pass the desired schema version (the latest version of NanoAOD can be built with `schemaclass=NanoAODSchema`) for this file and some extra metadata that we can later access with `events.metadata`. In a later example, we will show how to set up this metadata in coffea processors where the `events` object is pre-created for you. Consider looking at the [from_root](https://coffeateam.github.io/coffea/api/coffea.nanoevents.NanoEventsFactory.html#coffea.nanoevents.NanoEventsFactory.from_root) class method to see all optional arguments.\n",
"In the factory constructor, we also pass the desired schema version (the latest version of NanoAOD can be built with `schemaclass=NanoAODSchema`) for this file and some extra metadata that we can later access with `events.metadata`. In a later example, we will show how to set up this metadata in coffea processors where the `events` object is pre-created for you. Consider looking at the [from_root](https://coffea-hep.readthedocs.io/en/backports-v0.7.x/api/coffea.nanoevents.NanoEventsFactory.html#coffea.nanoevents.NanoEventsFactory.from_root) class method to see all optional arguments.\n",
"\n",
"The `events` object is an awkward array, which at its top level is a record array with one record for each \"collection\", where a collection is a grouping of fields (TBranches) based on the naming conventions of [NanoAODSchema](https://coffeateam.github.io/coffea/api/coffea.nanoevents.NanoAODSchema.html). For example, in the file we opened, the branches:\n",
"The `events` object is an awkward array, which at its top level is a record array with one record for each \"collection\", where a collection is a grouping of fields (TBranches) based on the naming conventions of [NanoAODSchema](https://coffea-hep.readthedocs.io/en/backports-v0.7.x/api/coffea.nanoevents.NanoAODSchema.html). For example, in the file we opened, the branches:\n",
"```\n",
"Generator_binvar\n",
"Generator_scalePDF\n",
Expand Down Expand Up @@ -162,7 +162,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"we can access additional attributes associated to each generated jet by virtue of the fact that they can be interpreted as [Lorentz vectors](https://coffeateam.github.io/coffea/api/coffea.nanoevents.methods.vector.LorentzVector.html#coffea.nanoevents.methods.vector.LorentzVector):"
"we can access additional attributes associated to each generated jet by virtue of the fact that they can be interpreted as [Lorentz vectors](https://coffea-hep.readthedocs.io/en/backports-v0.7.x/api/coffea.nanoevents.methods.vector.LorentzVector.html#coffea.nanoevents.methods.vector.LorentzVector):"
]
},
{
Expand Down
Loading

0 comments on commit 828617d

Please sign in to comment.