Skip to content

Commit

Permalink
Merge branch 'main' into bbbb-options
Browse files Browse the repository at this point in the history
  • Loading branch information
cmantill authored Jan 18, 2024
2 parents 15b5b32 + 673328f commit d79d34f
Show file tree
Hide file tree
Showing 28 changed files with 4,270 additions and 2,548 deletions.
32 changes: 0 additions & 32 deletions .github/matchers/pylint.json

This file was deleted.

4 changes: 2 additions & 2 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- name: Build sdist and wheel
run: pipx run build

- uses: actions/upload-artifact@v3
- uses: actions/upload-artifact@v4
with:
path: dist

Expand All @@ -47,7 +47,7 @@ jobs:
if: github.event_name == 'release' && github.event.action == 'published'

steps:
- uses: actions/download-artifact@v3
- uses: actions/download-artifact@v4
with:
name: artifact
path: dist
Expand Down
25 changes: 3 additions & 22 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,33 +15,14 @@ env:
FORCE_COLOR: 3

jobs:
pre-commit:
name: Format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-python@v4
with:
python-version: "3.x"
- uses: pre-commit/action@v3.0.0
with:
extra_args: --hook-stage manual --all-files
- name: Run PyLint
run: |
echo "::add-matcher::$GITHUB_WORKSPACE/.github/matchers/pylint.json"
pipx run nox -s pylint
checks:
name: Check Python ${{ matrix.python-version }} on ${{ matrix.runs-on }}
runs-on: ${{ matrix.runs-on }}
needs: [pre-commit]
strategy:
fail-fast: false
matrix:
python-version: ["3.8", "3.12"]
runs-on: [ubuntu-latest, macos-latest, windows-latest]
python-version: ["3.8", "3.11"]
runs-on: [ubuntu-latest, macos-latest]

include:
- python-version: pypy-3.10
Expand All @@ -52,7 +33,7 @@ jobs:
with:
fetch-depth: 0

- uses: actions/setup-python@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
allow-prereleases: true
Expand Down
8 changes: 4 additions & 4 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ ci:

repos:
- repo: https://github.com/psf/black-pre-commit-mirror
rev: "23.11.0"
rev: "23.12.1"
hooks:
- id: black-jupyter

Expand Down Expand Up @@ -39,14 +39,14 @@ repos:
- id: rst-inline-touching-normal

- repo: https://github.com/pre-commit/mirrors-prettier
rev: "v3.1.0"
rev: "v4.0.0-alpha.8"
hooks:
- id: prettier
types_or: [markdown, html, css, scss, javascript, json]
args: [--prose-wrap=always]

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: "v0.1.5"
rev: "v0.1.9"
hooks:
- id: ruff
args: ["--fix", "--show-fixes"]
Expand Down Expand Up @@ -88,7 +88,7 @@ repos:
- id: validate-pyproject

- repo: https://github.com/python-jsonschema/check-jsonschema
rev: 0.27.1
rev: 0.27.3
hooks:
- id: check-dependabot
- id: check-github-workflows
Expand Down
67 changes: 45 additions & 22 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,24 @@
# HH4b

[![Actions Status][actions-badge]][actions-link]
[![Codestyle](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
[![pre-commit.ci status](https://results.pre-commit.ci/badge/github/LPC-HH/HH4b/main.svg)](https://results.pre-commit.ci/latest/github/LPC-HH/HH4b/main)

<!-- prettier-ignore-start -->
[actions-badge]: https://github.com/LPC-HH/HH4b/workflows/CI/badge.svg
[actions-link]: https://github.com/LPC-HH/HH4b/actions
[conda-badge]: https://img.shields.io/conda/vn/conda-forge/HH4b
[conda-link]: https://github.com/conda-forge/HH4b-feedstock
[github-discussions-badge]: https://img.shields.io/static/v1?label=Discussions&message=Ask&color=blue&logo=github
[github-discussions-link]: https://github.com/LPC-HH/HH4b/discussions
[pypi-link]: https://pypi.org/project/HH4b/
[pypi-platforms]: https://img.shields.io/pypi/pyversions/HH4b
[pypi-version]: https://img.shields.io/pypi/v/HH4b
[rtd-badge]: https://readthedocs.org/projects/HH4b/badge/?version=latest
[rtd-link]: https://HH4b.readthedocs.io/en/latest/?badge=latest

<!-- prettier-ignore-end -->

<p align="left">
<img width="300" src="https://raw.githubusercontent.com/LPC-HH/HH4b/main/figure.png" />
</p>
Expand All @@ -25,10 +41,9 @@ four beauty quarks (b).
- [Condor Scripts](#condor-scripts)
- [Check jobs](#check-jobs)
- [Combine pickles](#combine-pickles)
- [Post-processing](#post-processing)
- [Create Datacard](#create-datacard)
- [Combine](#combine)
- [CMSSW + Combine Quickstart](#cmssw--combine-quickstart)
- [Create Datacards](#create-datacards)
- [Run fits and diagnostics locally](#run-fits-and-diagnostics-locally)

## Setting up package
Expand Down Expand Up @@ -195,23 +210,6 @@ Combine all output pickles into one:
for year in 2016APV 2016 2017 2018; do python src/condor/combine_pickles.py --tag $TAG --processor trigger --r --year $year; done
```

## Post-processing

### Create Datacard

Need `root==6.22.6`, and https://github.com/rkansal47/rhalphalib installed (see
[below](#cmssw--combine-quickstart) for how to install both).

```bash
python3 postprocessing/CreateDatacard.py --templates-dir templates/$TAG --model-name $TAG
```

e.g.

```
python3 CreateDatacard.py --templates-dir templates/23Nov13_2018/ --model-name 2018-cutbased --year 2018
```

## Combine

### CMSSW + Combine Quickstart
Expand All @@ -225,16 +223,41 @@ git clone -b regex-float-parameters https://github.com/rkansal47/HiggsAnalysis-C
git clone -b v2.0.0 https://github.com/cms-analysis/CombineHarvester.git CombineHarvester
# Important: this scram has to be run from src dir
scramv1 b clean; scramv1 b
# rhalphalib to create the datacards:
```

I also add the combine folder to my PATH in my .bashrc for convenience:

```
export PATH="$PATH:/uscms_data/d1/rkansal/hh4b/HH4b/src/HH4b/combine"
```

### Create Datacards

After activating the CMSSW environment from above, need to install rhalphalib
and this repo:

```bash
# rhalphalib
git clone https://github.com/rkansal47/rhalphalib
cd rhalphalib
pip install -e . # editable installation
cd ..
# this repo
git clone https://github.com/LPC-HH/HH4b.git
cd HH4b
pip install -e . # editable installation
```

I also add the combine folder to my PATH in my .bashrc for convenience:
Then, the command is:

```bash
python3 postprocessing/CreateDatacard.py --templates-dir templates/$TAG --model-name $TAG
```
export PATH="$PATH:/uscms_data/d1/rkansal/hh4b/HH4b/src/HH4b/combine"

e.g.

```
python3 CreateDatacard.py --templates-dir templates/23Nov13_2018/ --model-name 2018-cutbased --year 2018
```

### Run fits and diagnostics locally
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,7 @@ ignore = [
"G004",
"E722", # bare except
"RUF005", # iterable unpacking
"RUF013", # implicit 'Optional' type
"F811", # redefinition of unused variable
"PGH001", # eval
"RET503",
Expand Down
Loading

0 comments on commit d79d34f

Please sign in to comment.