Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

feat: histogram inputs #289

Merged
merged 19 commits into from
Oct 8, 2021
Merged

feat: histogram inputs #289

merged 19 commits into from
Oct 8, 2021

Conversation

alexander-held
Copy link
Member

@alexander-held alexander-held commented Oct 6, 2021

This adds functionality to use analyzer-provided histograms instead of ntuples as input. This is done via approach 4) described in #219: The configuration schema is (slightly) expanded to support specification of paths to histograms, and the first step in a workspace-building workflow is to read the user-provided histograms and save them in the manner that cabinetry expects for further internal usage. Only a single histogram is supported per template that cabinetry needs, though this may be expanded in the future (#291).

additions:

  • added contrib.histogram_reader to read histograms with uproot
  • added templates.collector to collect histograms and store them in the cabinetry-internal format for subsequent processing (the whole templates module is new, but contains refactored functionality, see below)

Breaking changes:

  • refactored template_builder and template_postprocessor, moved high-level functionality into templates and lower-level features into submodules templates.creator and templates.postprocessor
    • template_builder.create_histograms -> templates.create
    • template_postprocessor.run -> templates.postprocess
  • renamed contrib.histogram_creation to contrib.histogram_creator, and the from_uproot function contained within to with_uproot
  • SamplePaths config option renamed to SamplePath

resolves #219

* added support for histogram inputs to workspace building
* breaking change: refactored template_builder and template_postprocessor
   - high-level functionality now provided via new templates module
   - lower-level functionality available in submodules
* breaking change: SamplePaths config option renamed to SamplePath
* breaking change: contrib.histogram_creation.from_uproot renamed to contrib.histogram_creator.with_uproot
* extended config schema to support specifying histogram inputs
* added templates.collect API to support handling histogram inputs
* added documentation for histogram input handling

@codecov
Copy link

codecov bot commented Oct 6, 2021

Codecov Report

Merging #289 (ce458ff) into master (2b9edf8) will not change coverage.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff            @@
##            master      #289   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           19        23    +4     
  Lines         1808      1878   +70     
  Branches       283       295   +12     
=========================================
+ Hits          1808      1878   +70     
Impacted Files Coverage Δ
src/cabinetry/model_utils.py 100.00% <ø> (ø)
src/cabinetry/templates/postprocessor.py 100.00% <ø> (ø)
src/cabinetry/workspace.py 100.00% <ø> (ø)
src/cabinetry/__init__.py 100.00% <100.00%> (ø)
src/cabinetry/cli/__init__.py 100.00% <100.00%> (ø)
src/cabinetry/contrib/histogram_creator.py 100.00% <100.00%> (ø)
src/cabinetry/contrib/histogram_reader.py 100.00% <100.00%> (ø)
src/cabinetry/templates/__init__.py 100.00% <100.00%> (ø)
src/cabinetry/templates/builder.py 100.00% <100.00%> (ø)
src/cabinetry/templates/collector.py 100.00% <100.00%> (ø)
... and 2 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2b9edf8...ce458ff. Read the comment docs.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Reading histogram input instead of ntuples
1 participant