-
Notifications
You must be signed in to change notification settings - Fork 129
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
73 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -161,6 +161,30 @@ jobs: | |
conda-pack --output coffea-env.tar.gz | ||
python wq.py coffea-env.tar.gz | ||
testtaskvine: | ||
runs-on: ubuntu-latest | ||
timeout-minutes: 15 | ||
needs: pre-commit | ||
strategy: | ||
matrix: | ||
python-version: ["3.11"] | ||
name: test coffea-taskvine | ||
|
||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Conda | ||
uses: conda-incubator/[email protected] | ||
with: | ||
auto-update-conda: true | ||
python-version: ${{ matrix.python-version }} | ||
- name: Test TaskVine Executor | ||
shell: bash -l {0} | ||
run: | | ||
conda create --yes --name coffea-env -c conda-forge python=${{ matrix.python-version }} ndcctools pytest 'setuptools<71' | ||
conda activate coffea-env | ||
python -m pip install --ignore-installed . | ||
python -m pytest tests/test_taskvine_executor.py | ||
# testskyhookjob: | ||
# runs-on: ubuntu-latest | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
import sys | ||
import os.path as osp | ||
import pytest | ||
from coffea import processor | ||
import ndcctools.taskvine as vine | ||
|
||
if sys.platform.startswith("win"): | ||
pytest.skip("skipping tests that only function in linux", allow_module_level=True) | ||
|
||
|
||
def test_taskvine_executor_nanoevents_analysis(): | ||
from coffea.processor.test_items import NanoEventsProcessor | ||
|
||
filelist = { | ||
"ZJets": { | ||
"treename": "Events", | ||
"files": [osp.abspath("tests/samples/nano_dy.root")], | ||
"metadata": {"checkusermeta": True, "someusermeta": "hello"}, | ||
}, | ||
"Data": { | ||
"treename": "Events", | ||
"files": [osp.abspath("tests/samples/nano_dimuon.root")], | ||
"metadata": {"checkusermeta": True, "someusermeta2": "world"}, | ||
}, | ||
} | ||
|
||
port = 9123 | ||
executor = processor.TaskVineExecutor(port=port) | ||
|
||
workers = vine.Factory(manager_host_port="localhost:9123") | ||
workers.max_workers = 1 | ||
workers.min_workers = 1 | ||
workers.cores = 1 | ||
workers.disk = 2000 | ||
|
||
with workers: | ||
run = processor.Runner( | ||
executor=executor, | ||
skipbadfiles=True, | ||
schema=processor.NanoAODSchema, | ||
maxchunks=10000, | ||
chunksize=1000, | ||
) | ||
|
||
hists = run(filelist, "Events", processor_instance=NanoEventsProcessor()) | ||
assert hists["cutflow"]["ZJets_pt"] == 18 | ||
assert hists["cutflow"]["ZJets_mass"] == 6 | ||
assert hists["cutflow"]["Data_pt"] == 84 | ||
assert hists["cutflow"]["Data_mass"] == 66 |