Skip to content

Commit

Permalink
Merge pull request #1268 from scikit-hep/ikrommyd/fix-docs-link
Browse files Browse the repository at this point in the history
fix: fix coffea docs links everywhere
  • Loading branch information
lgray authored Feb 4, 2025
2 parents 7c551ea + 1ba33bf commit 8beb511
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 16 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/latest/ 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/latest/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/latest/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
2 changes: 1 addition & 1 deletion README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,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/latest/installation.html>`_ section of the documentation.

Strict dependencies
===================
Expand Down
8 changes: 4 additions & 4 deletions binder/applying_corrections.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,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/latest/api/coffea.lookup_tools.extractor.html#coffea.lookup_tools.extractor)."
]
},
{
Expand Down Expand Up @@ -105,7 +105,7 @@
"source": [
"### Opening a root file and using it as a lookup table\n",
"\n",
"In [tests/samples](https://github.com/scikit-hep/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/scikit-hep/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/latest/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 @@ -362,7 +362,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/latest/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 @@ -499,7 +499,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/latest/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
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/scikit-hep/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/latest/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/latest/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 @@ -50,9 +50,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/latest/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/latest/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 @@ -210,7 +210,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/latest/api/coffea.nanoevents.methods.vector.LorentzVector.html#coffea.nanoevents.methods.vector.LorentzVector):"
]
},
{
Expand Down
6 changes: 3 additions & 3 deletions binder/processor.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -11,16 +11,16 @@
"As a usual analysis will involve processing tens to thousands of files, totalling gigabytes to terabytes of data, there is a certain amount of work to be done to build a parallelized framework to process the data in a reasonable amount of time. Of course, one can work directly within uproot to achieve this, as we'll show in the beginning, but coffea provides the `coffea.processor` module, which allows users to worry just about the actual analysis code and not about how to implement efficient parallelization, assuming that the parallization is a trivial map-reduce operation (e.g. filling histograms and adding them together). The module provides the following key features:\n",
"\n",
" * A `ProcessorABC` abstract base class that can be derived from to implement the analysis code;\n",
" * A [NanoEvents](https://coffeateam.github.io/coffea/notebooks/nanoevents.html) interface to the arrays being read from the TTree as inputs;\n",
" * A [NanoEvents](https://coffea-hep.readthedocs.io/en/latest/notebooks/nanoevents.html) interface to the arrays being read from the TTree as inputs;\n",
" * A generic `accumulate()` utility to reduce the outputs to a single result, as showin in the accumulators notebook tutorial; and\n",
" * A set of parallel executors to access multicore processing or distributed computing systems such as [Dask](https://distributed.dask.org/en/latest/), [Parsl](http://parsl-project.org/), [Spark](https://spark.apache.org/), [WorkQueue](https://cctools.readthedocs.io/en/latest/work_queue/), and others.\n",
"\n",
"Let's start by writing a simple processor class that reads some CMS open data and plots a dimuon mass spectrum.\n",
"We'll start by copying the [ProcessorABC](https://coffeateam.github.io/coffea/api/coffea.processor.ProcessorABC.html#coffea.processor.ProcessorABC) skeleton and filling in some details:\n",
"We'll start by copying the [ProcessorABC](https://coffea-hep.readthedocs.io/en/latest/api/coffea.processor.ProcessorABC.html#coffea.processor.ProcessorABC) skeleton and filling in some details:\n",
"\n",
" * Remove `flag`, as we won't use it\n",
" * Adding a new histogram for $m_{\\mu \\mu}$\n",
" * Building a [Candidate](https://coffeateam.github.io/coffea/api/coffea.nanoevents.methods.candidate.PtEtaPhiMCandidate.html#coffea.nanoevents.methods.candidate.PtEtaPhiMCandidate) record for muons, since we will read it with `BaseSchema` interpretation (the files used here could be read with `NanoAODSchema` but we want to show how to build vector objects from other TTree formats) \n",
" * Building a [Candidate](https://coffea-hep.readthedocs.io/en/latest/api/coffea.nanoevents.methods.candidate.PtEtaPhiMCandidate.html#coffea.nanoevents.methods.candidate.PtEtaPhiMCandidate) record for muons, since we will read it with `BaseSchema` interpretation (the files used here could be read with `NanoAODSchema` but we want to show how to build vector objects from other TTree formats) \n",
" * Calculating the dimuon invariant mass"
]
},
Expand Down

0 comments on commit 8beb511

Please sign in to comment.