From 1ba33bfaff127aecb77962e86aedd52bdf915478 Mon Sep 17 00:00:00 2001 From: Iason Krommydas Date: Tue, 4 Feb 2025 15:57:12 -0600 Subject: [PATCH] fix coffea docs links --- .github/ISSUE_TEMPLATE/user_question.md | 2 +- CONTRIBUTING.md | 4 ++-- README.rst | 2 +- binder/applying_corrections.ipynb | 8 ++++---- binder/nanoevents.ipynb | 10 +++++----- binder/processor.ipynb | 6 +++--- 6 files changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/user_question.md b/.github/ISSUE_TEMPLATE/user_question.md index 849261715..594a6072b 100644 --- a/.github/ISSUE_TEMPLATE/user_question.md +++ b/.github/ISSUE_TEMPLATE/user_question.md @@ -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? diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index a41363329..3189103d8 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -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. @@ -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 diff --git a/README.rst b/README.rst index 9d7068bf6..bdc48d1d3 100644 --- a/README.rst +++ b/README.rst @@ -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 `_ section of the documentation. +For more details, see the `Installing coffea `_ section of the documentation. Strict dependencies =================== diff --git a/binder/applying_corrections.ipynb b/binder/applying_corrections.ipynb index 9748c3b51..c842eb4f0 100644 --- a/binder/applying_corrections.ipynb +++ b/binder/applying_corrections.ipynb @@ -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)." ] }, { @@ -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." ] }, { @@ -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." ] }, { @@ -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." ] }, { diff --git a/binder/nanoevents.ipynb b/binder/nanoevents.ipynb index 14a2f9566..39705fbc8 100644 --- a/binder/nanoevents.ipynb +++ b/binder/nanoevents.ipynb @@ -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", @@ -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", @@ -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", @@ -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):" ] }, { diff --git a/binder/processor.ipynb b/binder/processor.ipynb index 688bd481b..5e22e1312 100644 --- a/binder/processor.ipynb +++ b/binder/processor.ipynb @@ -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" ] },