From 5b77459ad10b60b5c6cd33e3d091ffceb3633c93 Mon Sep 17 00:00:00 2001 From: Alessandro Candido Date: Sat, 17 Jul 2021 16:41:44 +0200 Subject: [PATCH 01/63] Bootstrap python package with poetry --- .gitignore | 146 +++++++++++++++++++++++ poetry.lock | 310 ++++++++++++++++++++++++++++++++++++++++++++++++ pyproject.toml | 22 ++++ run/__init__.py | 4 + run/dis.py | 7 ++ run/hadronic.py | 7 ++ 6 files changed, 496 insertions(+) create mode 100644 poetry.lock create mode 100644 pyproject.toml create mode 100644 run/__init__.py create mode 100644 run/dis.py create mode 100644 run/hadronic.py diff --git a/.gitignore b/.gitignore index a46bb4e8..8bb8988b 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,147 @@ .prefix/ + +### Python +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +parts/ +sdist/ +var/ +wheels/ +pip-wheel-metadata/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.nox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +*.py,cover +.hypothesis/ +.pytest_cache/ +pytestdebug.log + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py +db.sqlite3 +db.sqlite3-journal + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ +doc/_build/ + +# PyBuilder +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# IPython +profile_default/ +ipython_config.py + +# pyenv +.python-version + +# pipenv +# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. +# However, in case of collaboration, if having platform-specific dependencies or dependencies +# having no cross-platform support, pipenv may install dependencies that don't work, or not +# install all needed dependencies. +#Pipfile.lock + +# poetry +#poetry.lock + +# PEP 582; used by e.g. github.com/David-OConnor/pyflow +__pypackages__/ + +# Celery stuff +celerybeat-schedule +celerybeat.pid + +# SageMath parsed files +*.sage.py + +# Environments +# .env +.env/ +.venv/ +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ +pythonenv* + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ +.dmypy.json +dmypy.json + +# Pyre type checker +.pyre/ + +# pytype static type analyzer +.pytype/ + +# operating system-related files +*.DS_Store #file properties cache/storage on macOS +Thumbs.db #thumbnail cache on Windows + +# profiling data +.prof diff --git a/poetry.lock b/poetry.lock new file mode 100644 index 00000000..a8728b2a --- /dev/null +++ b/poetry.lock @@ -0,0 +1,310 @@ +[[package]] +name = "atomicwrites" +version = "1.4.0" +description = "Atomic file writes." +category = "dev" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" + +[[package]] +name = "attrs" +version = "21.2.0" +description = "Classes Without Boilerplate" +category = "dev" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" + +[package.extras] +dev = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "mypy", "pytest-mypy-plugins", "zope.interface", "furo", "sphinx", "sphinx-notfound-page", "pre-commit"] +docs = ["furo", "sphinx", "zope.interface", "sphinx-notfound-page"] +tests = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "mypy", "pytest-mypy-plugins", "zope.interface"] +tests_no_zope = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "mypy", "pytest-mypy-plugins"] + +[[package]] +name = "click" +version = "8.0.1" +description = "Composable command line interface toolkit" +category = "main" +optional = false +python-versions = ">=3.6" + +[package.dependencies] +colorama = {version = "*", markers = "platform_system == \"Windows\""} + +[[package]] +name = "colorama" +version = "0.4.4" +description = "Cross-platform colored terminal text." +category = "main" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" + +[[package]] +name = "commonmark" +version = "0.9.1" +description = "Python parser for the CommonMark Markdown spec" +category = "main" +optional = false +python-versions = "*" + +[package.extras] +test = ["flake8 (==3.7.8)", "hypothesis (==3.55.3)"] + +[[package]] +name = "more-itertools" +version = "8.8.0" +description = "More routines for operating on iterables, beyond itertools" +category = "dev" +optional = false +python-versions = ">=3.5" + +[[package]] +name = "packaging" +version = "21.0" +description = "Core utilities for Python packages" +category = "dev" +optional = false +python-versions = ">=3.6" + +[package.dependencies] +pyparsing = ">=2.0.2" + +[[package]] +name = "pluggy" +version = "0.13.1" +description = "plugin and hook calling mechanisms for python" +category = "dev" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" + +[package.extras] +dev = ["pre-commit", "tox"] + +[[package]] +name = "prompt-toolkit" +version = "1.0.14" +description = "Library for building powerful interactive command lines in Python" +category = "main" +optional = false +python-versions = "*" + +[package.dependencies] +six = ">=1.9.0" +wcwidth = "*" + +[[package]] +name = "py" +version = "1.10.0" +description = "library with cross-python path, ini-parsing, io, code, log facilities" +category = "dev" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" + +[[package]] +name = "pygments" +version = "2.9.0" +description = "Pygments is a syntax highlighting package written in Python." +category = "main" +optional = false +python-versions = ">=3.5" + +[[package]] +name = "pyinquirer" +version = "1.0.3" +description = "A Python module for collection of common interactive command line user interfaces, based on Inquirer.js" +category = "main" +optional = false +python-versions = "*" + +[package.dependencies] +prompt_toolkit = "1.0.14" +Pygments = ">=2.2.0" +regex = ">=2016.11.21" + +[[package]] +name = "pyparsing" +version = "2.4.7" +description = "Python parsing module" +category = "dev" +optional = false +python-versions = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*" + +[[package]] +name = "pytest" +version = "5.4.3" +description = "pytest: simple powerful testing with Python" +category = "dev" +optional = false +python-versions = ">=3.5" + +[package.dependencies] +atomicwrites = {version = ">=1.0", markers = "sys_platform == \"win32\""} +attrs = ">=17.4.0" +colorama = {version = "*", markers = "sys_platform == \"win32\""} +more-itertools = ">=4.0.0" +packaging = "*" +pluggy = ">=0.12,<1.0" +py = ">=1.5.0" +wcwidth = "*" + +[package.extras] +checkqa-mypy = ["mypy (==v0.761)"] +testing = ["argcomplete", "hypothesis (>=3.56)", "mock", "nose", "requests", "xmlschema"] + +[[package]] +name = "regex" +version = "2021.7.6" +description = "Alternative regular expression module, to replace re." +category = "main" +optional = false +python-versions = "*" + +[[package]] +name = "rich" +version = "10.6.0" +description = "Render rich text, tables, progress bars, syntax highlighting, markdown and more to the terminal" +category = "main" +optional = false +python-versions = ">=3.6,<4.0" + +[package.dependencies] +colorama = ">=0.4.0,<0.5.0" +commonmark = ">=0.9.0,<0.10.0" +pygments = ">=2.6.0,<3.0.0" + +[package.extras] +jupyter = ["ipywidgets (>=7.5.1,<8.0.0)"] + +[[package]] +name = "six" +version = "1.16.0" +description = "Python 2 and 3 compatibility utilities" +category = "main" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*" + +[[package]] +name = "wcwidth" +version = "0.2.5" +description = "Measures the displayed width of unicode strings in a terminal" +category = "main" +optional = false +python-versions = "*" + +[metadata] +lock-version = "1.1" +python-versions = "^3.9" +content-hash = "02874a31b3d753c9cb82872cc72b54d32e8ec3c0f028f214411eb9e89189a41e" + +[metadata.files] +atomicwrites = [ + {file = "atomicwrites-1.4.0-py2.py3-none-any.whl", hash = "sha256:6d1784dea7c0c8d4a5172b6c620f40b6e4cbfdf96d783691f2e1302a7b88e197"}, + {file = "atomicwrites-1.4.0.tar.gz", hash = "sha256:ae70396ad1a434f9c7046fd2dd196fc04b12f9e91ffb859164193be8b6168a7a"}, +] +attrs = [ + {file = "attrs-21.2.0-py2.py3-none-any.whl", hash = "sha256:149e90d6d8ac20db7a955ad60cf0e6881a3f20d37096140088356da6c716b0b1"}, + {file = "attrs-21.2.0.tar.gz", hash = "sha256:ef6aaac3ca6cd92904cdd0d83f629a15f18053ec84e6432106f7a4d04ae4f5fb"}, +] +click = [ + {file = "click-8.0.1-py3-none-any.whl", hash = "sha256:fba402a4a47334742d782209a7c79bc448911afe1149d07bdabdf480b3e2f4b6"}, + {file = "click-8.0.1.tar.gz", hash = "sha256:8c04c11192119b1ef78ea049e0a6f0463e4c48ef00a30160c704337586f3ad7a"}, +] +colorama = [ + {file = "colorama-0.4.4-py2.py3-none-any.whl", hash = "sha256:9f47eda37229f68eee03b24b9748937c7dc3868f906e8ba69fbcbdd3bc5dc3e2"}, + {file = "colorama-0.4.4.tar.gz", hash = "sha256:5941b2b48a20143d2267e95b1c2a7603ce057ee39fd88e7329b0c292aa16869b"}, +] +commonmark = [ + {file = "commonmark-0.9.1-py2.py3-none-any.whl", hash = "sha256:da2f38c92590f83de410ba1a3cbceafbc74fee9def35f9251ba9a971d6d66fd9"}, + {file = "commonmark-0.9.1.tar.gz", hash = "sha256:452f9dc859be7f06631ddcb328b6919c67984aca654e5fefb3914d54691aed60"}, +] +more-itertools = [ + {file = "more-itertools-8.8.0.tar.gz", hash = "sha256:83f0308e05477c68f56ea3a888172c78ed5d5b3c282addb67508e7ba6c8f813a"}, + {file = "more_itertools-8.8.0-py3-none-any.whl", hash = "sha256:2cf89ec599962f2ddc4d568a05defc40e0a587fbc10d5989713638864c36be4d"}, +] +packaging = [ + {file = "packaging-21.0-py3-none-any.whl", hash = "sha256:c86254f9220d55e31cc94d69bade760f0847da8000def4dfe1c6b872fd14ff14"}, + {file = "packaging-21.0.tar.gz", hash = "sha256:7dc96269f53a4ccec5c0670940a4281106dd0bb343f47b7471f779df49c2fbe7"}, +] +pluggy = [ + {file = "pluggy-0.13.1-py2.py3-none-any.whl", hash = "sha256:966c145cd83c96502c3c3868f50408687b38434af77734af1e9ca461a4081d2d"}, + {file = "pluggy-0.13.1.tar.gz", hash = "sha256:15b2acde666561e1298d71b523007ed7364de07029219b604cf808bfa1c765b0"}, +] +prompt-toolkit = [ + {file = "prompt_toolkit-1.0.14-py2-none-any.whl", hash = "sha256:82c7f8e07d7a0411ff5367a5a8ff520f0112b9179f3e599ee8ad2ad9b943d911"}, + {file = "prompt_toolkit-1.0.14-py3-none-any.whl", hash = "sha256:7281b5199235adaef6980942840c43753e4ab20dfe41338da634fb41c194f9d8"}, + {file = "prompt_toolkit-1.0.14.tar.gz", hash = "sha256:cc66413b1b4b17021675d9f2d15d57e640b06ddfd99bb724c73484126d22622f"}, +] +py = [ + {file = "py-1.10.0-py2.py3-none-any.whl", hash = "sha256:3b80836aa6d1feeaa108e046da6423ab8f6ceda6468545ae8d02d9d58d18818a"}, + {file = "py-1.10.0.tar.gz", hash = "sha256:21b81bda15b66ef5e1a777a21c4dcd9c20ad3efd0b3f817e7a809035269e1bd3"}, +] +pygments = [ + {file = "Pygments-2.9.0-py3-none-any.whl", hash = "sha256:d66e804411278594d764fc69ec36ec13d9ae9147193a1740cd34d272ca383b8e"}, + {file = "Pygments-2.9.0.tar.gz", hash = "sha256:a18f47b506a429f6f4b9df81bb02beab9ca21d0a5fee38ed15aef65f0545519f"}, +] +pyinquirer = [ + {file = "PyInquirer-1.0.3.tar.gz", hash = "sha256:c9a92d68d7727fbd886a7908c08fd9e9773e5dc211bf5cbf836ba90d366dee51"}, +] +pyparsing = [ + {file = "pyparsing-2.4.7-py2.py3-none-any.whl", hash = "sha256:ef9d7589ef3c200abe66653d3f1ab1033c3c419ae9b9bdb1240a85b024efc88b"}, + {file = "pyparsing-2.4.7.tar.gz", hash = "sha256:c203ec8783bf771a155b207279b9bccb8dea02d8f0c9e5f8ead507bc3246ecc1"}, +] +pytest = [ + {file = "pytest-5.4.3-py3-none-any.whl", hash = "sha256:5c0db86b698e8f170ba4582a492248919255fcd4c79b1ee64ace34301fb589a1"}, + {file = "pytest-5.4.3.tar.gz", hash = "sha256:7979331bfcba207414f5e1263b5a0f8f521d0f457318836a7355531ed1a4c7d8"}, +] +regex = [ + {file = "regex-2021.7.6-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:e6a1e5ca97d411a461041d057348e578dc344ecd2add3555aedba3b408c9f874"}, + {file = "regex-2021.7.6-cp36-cp36m-manylinux1_i686.whl", hash = "sha256:6afe6a627888c9a6cfbb603d1d017ce204cebd589d66e0703309b8048c3b0854"}, + {file = "regex-2021.7.6-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:ccb3d2190476d00414aab36cca453e4596e8f70a206e2aa8db3d495a109153d2"}, + {file = "regex-2021.7.6-cp36-cp36m-manylinux2010_i686.whl", hash = "sha256:ed693137a9187052fc46eedfafdcb74e09917166362af4cc4fddc3b31560e93d"}, + {file = "regex-2021.7.6-cp36-cp36m-manylinux2010_x86_64.whl", hash = "sha256:99d8ab206a5270c1002bfcf25c51bf329ca951e5a169f3b43214fdda1f0b5f0d"}, + {file = "regex-2021.7.6-cp36-cp36m-manylinux2014_i686.whl", hash = "sha256:b85ac458354165405c8a84725de7bbd07b00d9f72c31a60ffbf96bb38d3e25fa"}, + {file = "regex-2021.7.6-cp36-cp36m-manylinux2014_x86_64.whl", hash = "sha256:3f5716923d3d0bfb27048242a6e0f14eecdb2e2a7fac47eda1d055288595f222"}, + {file = "regex-2021.7.6-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e5983c19d0beb6af88cb4d47afb92d96751fb3fa1784d8785b1cdf14c6519407"}, + {file = "regex-2021.7.6-cp36-cp36m-win32.whl", hash = "sha256:c92831dac113a6e0ab28bc98f33781383fe294df1a2c3dfd1e850114da35fd5b"}, + {file = "regex-2021.7.6-cp36-cp36m-win_amd64.whl", hash = "sha256:791aa1b300e5b6e5d597c37c346fb4d66422178566bbb426dd87eaae475053fb"}, + {file = "regex-2021.7.6-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:59506c6e8bd9306cd8a41511e32d16d5d1194110b8cfe5a11d102d8b63cf945d"}, + {file = "regex-2021.7.6-cp37-cp37m-manylinux1_i686.whl", hash = "sha256:564a4c8a29435d1f2256ba247a0315325ea63335508ad8ed938a4f14c4116a5d"}, + {file = "regex-2021.7.6-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:59c00bb8dd8775473cbfb967925ad2c3ecc8886b3b2d0c90a8e2707e06c743f0"}, + {file = "regex-2021.7.6-cp37-cp37m-manylinux2010_i686.whl", hash = "sha256:9a854b916806c7e3b40e6616ac9e85d3cdb7649d9e6590653deb5b341a736cec"}, + {file = "regex-2021.7.6-cp37-cp37m-manylinux2010_x86_64.whl", hash = "sha256:db2b7df831c3187a37f3bb80ec095f249fa276dbe09abd3d35297fc250385694"}, + {file = "regex-2021.7.6-cp37-cp37m-manylinux2014_i686.whl", hash = "sha256:173bc44ff95bc1e96398c38f3629d86fa72e539c79900283afa895694229fe6a"}, + {file = "regex-2021.7.6-cp37-cp37m-manylinux2014_x86_64.whl", hash = "sha256:15dddb19823f5147e7517bb12635b3c82e6f2a3a6b696cc3e321522e8b9308ad"}, + {file = "regex-2021.7.6-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2ddeabc7652024803666ea09f32dd1ed40a0579b6fbb2a213eba590683025895"}, + {file = "regex-2021.7.6-cp37-cp37m-win32.whl", hash = "sha256:f080248b3e029d052bf74a897b9d74cfb7643537fbde97fe8225a6467fb559b5"}, + {file = "regex-2021.7.6-cp37-cp37m-win_amd64.whl", hash = "sha256:d8bbce0c96462dbceaa7ac4a7dfbbee92745b801b24bce10a98d2f2b1ea9432f"}, + {file = "regex-2021.7.6-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:edd1a68f79b89b0c57339bce297ad5d5ffcc6ae7e1afdb10f1947706ed066c9c"}, + {file = "regex-2021.7.6-cp38-cp38-manylinux1_i686.whl", hash = "sha256:422dec1e7cbb2efbbe50e3f1de36b82906def93ed48da12d1714cabcd993d7f0"}, + {file = "regex-2021.7.6-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:cbe23b323988a04c3e5b0c387fe3f8f363bf06c0680daf775875d979e376bd26"}, + {file = "regex-2021.7.6-cp38-cp38-manylinux2010_i686.whl", hash = "sha256:0eb2c6e0fcec5e0f1d3bcc1133556563222a2ffd2211945d7b1480c1b1a42a6f"}, + {file = "regex-2021.7.6-cp38-cp38-manylinux2010_x86_64.whl", hash = "sha256:1c78780bf46d620ff4fff40728f98b8afd8b8e35c3efd638c7df67be2d5cddbf"}, + {file = "regex-2021.7.6-cp38-cp38-manylinux2014_i686.whl", hash = "sha256:bc84fb254a875a9f66616ed4538542fb7965db6356f3df571d783f7c8d256edd"}, + {file = "regex-2021.7.6-cp38-cp38-manylinux2014_x86_64.whl", hash = "sha256:598c0a79b4b851b922f504f9f39a863d83ebdfff787261a5ed061c21e67dd761"}, + {file = "regex-2021.7.6-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:875c355360d0f8d3d827e462b29ea7682bf52327d500a4f837e934e9e4656068"}, + {file = "regex-2021.7.6-cp38-cp38-win32.whl", hash = "sha256:e586f448df2bbc37dfadccdb7ccd125c62b4348cb90c10840d695592aa1b29e0"}, + {file = "regex-2021.7.6-cp38-cp38-win_amd64.whl", hash = "sha256:2fe5e71e11a54e3355fa272137d521a40aace5d937d08b494bed4529964c19c4"}, + {file = "regex-2021.7.6-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:6110bab7eab6566492618540c70edd4d2a18f40ca1d51d704f1d81c52d245026"}, + {file = "regex-2021.7.6-cp39-cp39-manylinux1_i686.whl", hash = "sha256:4f64fc59fd5b10557f6cd0937e1597af022ad9b27d454e182485f1db3008f417"}, + {file = "regex-2021.7.6-cp39-cp39-manylinux1_x86_64.whl", hash = "sha256:89e5528803566af4df368df2d6f503c84fbfb8249e6631c7b025fe23e6bd0cde"}, + {file = "regex-2021.7.6-cp39-cp39-manylinux2010_i686.whl", hash = "sha256:2366fe0479ca0e9afa534174faa2beae87847d208d457d200183f28c74eaea59"}, + {file = "regex-2021.7.6-cp39-cp39-manylinux2010_x86_64.whl", hash = "sha256:f9392a4555f3e4cb45310a65b403d86b589adc773898c25a39184b1ba4db8985"}, + {file = "regex-2021.7.6-cp39-cp39-manylinux2014_i686.whl", hash = "sha256:2bceeb491b38225b1fee4517107b8491ba54fba77cf22a12e996d96a3c55613d"}, + {file = "regex-2021.7.6-cp39-cp39-manylinux2014_x86_64.whl", hash = "sha256:f98dc35ab9a749276f1a4a38ab3e0e2ba1662ce710f6530f5b0a6656f1c32b58"}, + {file = "regex-2021.7.6-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:319eb2a8d0888fa6f1d9177705f341bc9455a2c8aca130016e52c7fe8d6c37a3"}, + {file = "regex-2021.7.6-cp39-cp39-win32.whl", hash = "sha256:eaf58b9e30e0e546cdc3ac06cf9165a1ca5b3de8221e9df679416ca667972035"}, + {file = "regex-2021.7.6-cp39-cp39-win_amd64.whl", hash = "sha256:4c9c3155fe74269f61e27617529b7f09552fbb12e44b1189cebbdb24294e6e1c"}, + {file = "regex-2021.7.6.tar.gz", hash = "sha256:8394e266005f2d8c6f0bc6780001f7afa3ef81a7a2111fa35058ded6fce79e4d"}, +] +rich = [ + {file = "rich-10.6.0-py3-none-any.whl", hash = "sha256:d3f72827cd5df13b2ef7f1a97f81ec65548d4fdeb92cef653234f227580bbb2a"}, + {file = "rich-10.6.0.tar.gz", hash = "sha256:128261b3e2419a4ef9c97066ccc2abbfb49fa7c5e89c3fe4056d00aa5e9c1e65"}, +] +six = [ + {file = "six-1.16.0-py2.py3-none-any.whl", hash = "sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254"}, + {file = "six-1.16.0.tar.gz", hash = "sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926"}, +] +wcwidth = [ + {file = "wcwidth-0.2.5-py2.py3-none-any.whl", hash = "sha256:beb4802a9cebb9144e99086eff703a642a13d6a0052920003a230f3294bbe784"}, + {file = "wcwidth-0.2.5.tar.gz", hash = "sha256:c4d647b99872929fdb7bdcaa4fbe7f01413ed3d98077df798530e5b04f116c83"}, +] diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..03fa86da --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,22 @@ +[tool.poetry] +name = "run" +version = "0.0.0" +description = "generate runcards" +authors = ["Alessandro Candido "] + +[tool.poetry.dependencies] +python = "^3.9" +click = "^8.0.1" +PyInquirer = "^1.0.3" +rich = "^10.6.0" + +[tool.poetry.dev-dependencies] +pytest = "^5.2" + +[tool.poetry.scripts] +dis = "run:dis" +hadronic = "run:hadronic" + +[build-system] +requires = ["poetry-core>=1.0.0"] +build-backend = "poetry.core.masonry.api" diff --git a/run/__init__.py b/run/__init__.py new file mode 100644 index 00000000..c502f6d9 --- /dev/null +++ b/run/__init__.py @@ -0,0 +1,4 @@ +__version__ = "0.0.0" + +from .hadronic import hadronic +from .dis import dis diff --git a/run/dis.py b/run/dis.py new file mode 100644 index 00000000..3487b464 --- /dev/null +++ b/run/dis.py @@ -0,0 +1,7 @@ +import click +import rich + + +@click.command() +def dis(): + rich.print("Computing [red]dis[/]...") diff --git a/run/hadronic.py b/run/hadronic.py new file mode 100644 index 00000000..6b4dee1c --- /dev/null +++ b/run/hadronic.py @@ -0,0 +1,7 @@ +import click +import rich + + +@click.command() +def hadronic(): + rich.print("Computing [blue]hadronic[/]...") From 1c8d634318a6ee818c3d6eff26394733f3de9a76 Mon Sep 17 00:00:00 2001 From: Alessandro Candido Date: Sat, 17 Jul 2021 17:27:03 +0200 Subject: [PATCH 02/63] Introudce autocompletion with readline --- run/__init__.py | 2 +- run/dis.py | 7 ------- run/dis_.py | 25 ++++++++++++++++++++++ run/hadronic.py | 18 ++++++++++++++++ run/tools.py | 55 +++++++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 99 insertions(+), 8 deletions(-) delete mode 100644 run/dis.py create mode 100644 run/dis_.py create mode 100644 run/tools.py diff --git a/run/__init__.py b/run/__init__.py index c502f6d9..a8036d46 100644 --- a/run/__init__.py +++ b/run/__init__.py @@ -1,4 +1,4 @@ __version__ = "0.0.0" from .hadronic import hadronic -from .dis import dis +from .dis_ import dis diff --git a/run/dis.py b/run/dis.py deleted file mode 100644 index 3487b464..00000000 --- a/run/dis.py +++ /dev/null @@ -1,7 +0,0 @@ -import click -import rich - - -@click.command() -def dis(): - rich.print("Computing [red]dis[/]...") diff --git a/run/dis_.py b/run/dis_.py new file mode 100644 index 00000000..4e4f8811 --- /dev/null +++ b/run/dis_.py @@ -0,0 +1,25 @@ +import pathlib + +import click +import rich + +from . import tools + +root = pathlib.Path(__file__).absolute().parents[1] + + +@click.command() +def dis(): + rich.print("Computing [red]dis[/]...") + rich.print(select_datasets()) + + +def load_datasets(): + proc = root / "nnpdf31_proc" + dis_sets = [p for p in proc.iterdir() if (p / "observable.yaml").is_file()] + return dis_sets + + +def select_datasets(): + datasets = [p.stem for p in load_datasets()] + return tools.select_datasets(datasets) diff --git a/run/hadronic.py b/run/hadronic.py index 6b4dee1c..cab02e66 100644 --- a/run/hadronic.py +++ b/run/hadronic.py @@ -1,7 +1,25 @@ +import pathlib + import click import rich +from . import tools + +root = pathlib.Path(__file__).absolute().parents[1] + @click.command() def hadronic(): rich.print("Computing [blue]hadronic[/]...") + rich.print(select_datasets()) + + +def load_datasets(): + proc = root / "nnpdf31_proc" + hadronic_sets = [p for p in proc.iterdir() if not (p / "observable.yaml").is_file()] + return hadronic_sets + + +def select_datasets(): + datasets = [p.stem for p in load_datasets()] + return tools.select_datasets(datasets) diff --git a/run/tools.py b/run/tools.py new file mode 100644 index 00000000..460383fd --- /dev/null +++ b/run/tools.py @@ -0,0 +1,55 @@ +from difflib import SequenceMatcher + +import rich + + +def similar(a, b): + """ + Compare strings + + .. todo:: + + use to suggest dataset in prompt + """ + return SequenceMatcher(None, a, b).ratio() + + +import re +import readline + +COMMANDS = ["extra", "extension", "stuff", "errors", "email", "foobar", "foo"] + + +re_space = re.compile(".*\s+$", re.M) + + +class Completer: + def __init__(self, tokens): + self.tokens = tokens + + def complete(self, text, state): + "Generic readline completion entry point." + buffer = readline.get_line_buffer() + line = readline.get_line_buffer().split() + # show all commands + if not line: + return [c + " " for c in self.tokens][state] + # account for last argument ending in a space + if re_space.match(buffer): + line.append("") + # resolve command to the implementation function + token = line[-1].strip() + results = [c + " " for c in self.tokens if c.startswith(token)] + [None] + return results[state] + + +def select_datasets(datasets_list): + comp = Completer(datasets_list) + # we want to treat '/' as part of a word, so override the delimiters + readline.set_completer_delims(" \t\n;") + readline.parse_and_bind("tab: complete") + readline.set_completer(comp.complete) + rich.print("[i magenta]Enter dataset name:") + ans = input("> ") + readline.set_completer() + return ans.split() From 8a54806e961406c602fa3a426b8486e1184ad87b Mon Sep 17 00:00:00 2001 From: Alessandro Candido Date: Thu, 22 Jul 2021 11:47:22 +0200 Subject: [PATCH 03/63] Replace run_dis.py with package function --- .gitignore | 2 + poetry.lock | 341 +++++++++++++++++++++++++++++++++++++++++++++++- pyproject.toml | 4 +- run/dis_.py | 32 ++++- run/paths.py | 5 + run/theory.yaml | 43 ++++++ run_dis.py | 73 ----------- 7 files changed, 417 insertions(+), 83 deletions(-) create mode 100644 run/paths.py create mode 100644 run/theory.yaml delete mode 100755 run_dis.py diff --git a/.gitignore b/.gitignore index 8bb8988b..99a9bcf6 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,6 @@ .prefix/ +# ignore any folder like '-YYYYMMDDHHmmss' +*-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]/ ### Python # Byte-compiled / optimized / DLL files diff --git a/poetry.lock b/poetry.lock index a8728b2a..2b2445ff 100644 --- a/poetry.lock +++ b/poetry.lock @@ -30,6 +30,7 @@ python-versions = ">=3.6" [package.dependencies] colorama = {version = "*", markers = "platform_system == \"Windows\""} +importlib-metadata = {version = "*", markers = "python_version < \"3.8\""} [[package]] name = "colorama" @@ -50,6 +51,45 @@ python-versions = "*" [package.extras] test = ["flake8 (==3.7.8)", "hypothesis (==3.55.3)"] +[[package]] +name = "eko" +version = "0.6.0" +description = "Evolution Kernel Operator" +category = "main" +optional = false +python-versions = ">=3.7" + +[package.dependencies] +numba = "*" +numpy = "*" +pyyaml = "*" +scipy = "*" + +[[package]] +name = "importlib-metadata" +version = "4.6.1" +description = "Read metadata from Python packages" +category = "main" +optional = false +python-versions = ">=3.6" + +[package.dependencies] +typing-extensions = {version = ">=3.6.4", markers = "python_version < \"3.8\""} +zipp = ">=0.5" + +[package.extras] +docs = ["sphinx", "jaraco.packaging (>=8.2)", "rst.linker (>=1.9)"] +perf = ["ipython"] +testing = ["pytest (>=4.6)", "pytest-checkdocs (>=2.4)", "pytest-flake8", "pytest-cov", "pytest-enabler (>=1.0.1)", "packaging", "pep517", "pyfakefs", "flufl.flake8", "pytest-perf (>=0.9.2)", "pytest-black (>=0.3.7)", "pytest-mypy", "importlib-resources (>=1.3)"] + +[[package]] +name = "llvmlite" +version = "0.36.0" +description = "lightweight wrapper around basic LLVM functionality" +category = "main" +optional = false +python-versions = ">=3.6,<3.10" + [[package]] name = "more-itertools" version = "8.8.0" @@ -58,6 +98,26 @@ category = "dev" optional = false python-versions = ">=3.5" +[[package]] +name = "numba" +version = "0.53.1" +description = "compiling Python code using LLVM" +category = "main" +optional = false +python-versions = ">=3.6,<3.10" + +[package.dependencies] +llvmlite = ">=0.36.0rc1,<0.37" +numpy = ">=1.15" + +[[package]] +name = "numpy" +version = "1.21.1" +description = "NumPy is the fundamental package for array computing with Python." +category = "main" +optional = false +python-versions = ">=3.7" + [[package]] name = "packaging" version = "21.0" @@ -69,6 +129,22 @@ python-versions = ">=3.6" [package.dependencies] pyparsing = ">=2.0.2" +[[package]] +name = "pandas" +version = "1.1.5" +description = "Powerful data structures for data analysis, time series, and statistics" +category = "main" +optional = false +python-versions = ">=3.6.1" + +[package.dependencies] +numpy = ">=1.15.4" +python-dateutil = ">=2.7.3" +pytz = ">=2017.2" + +[package.extras] +test = ["pytest (>=4.0.2)", "pytest-xdist", "hypothesis (>=3.58)"] + [[package]] name = "pluggy" version = "0.13.1" @@ -77,6 +153,9 @@ category = "dev" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" +[package.dependencies] +importlib-metadata = {version = ">=0.12", markers = "python_version < \"3.8\""} + [package.extras] dev = ["pre-commit", "tox"] @@ -141,6 +220,7 @@ python-versions = ">=3.5" atomicwrites = {version = ">=1.0", markers = "sys_platform == \"win32\""} attrs = ">=17.4.0" colorama = {version = "*", markers = "sys_platform == \"win32\""} +importlib-metadata = {version = ">=0.12", markers = "python_version < \"3.8\""} more-itertools = ">=4.0.0" packaging = "*" pluggy = ">=0.12,<1.0" @@ -151,6 +231,33 @@ wcwidth = "*" checkqa-mypy = ["mypy (==v0.761)"] testing = ["argcomplete", "hypothesis (>=3.56)", "mock", "nose", "requests", "xmlschema"] +[[package]] +name = "python-dateutil" +version = "2.8.2" +description = "Extensions to the standard Python datetime module" +category = "main" +optional = false +python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,>=2.7" + +[package.dependencies] +six = ">=1.5" + +[[package]] +name = "pytz" +version = "2021.1" +description = "World timezone definitions, modern and historical" +category = "main" +optional = false +python-versions = "*" + +[[package]] +name = "pyyaml" +version = "5.4.1" +description = "YAML parser and emitter for Python" +category = "main" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*" + [[package]] name = "regex" version = "2021.7.6" @@ -171,10 +278,22 @@ python-versions = ">=3.6,<4.0" colorama = ">=0.4.0,<0.5.0" commonmark = ">=0.9.0,<0.10.0" pygments = ">=2.6.0,<3.0.0" +typing-extensions = {version = ">=3.7.4,<4.0.0", markers = "python_version < \"3.8\""} [package.extras] jupyter = ["ipywidgets (>=7.5.1,<8.0.0)"] +[[package]] +name = "scipy" +version = "1.7.0" +description = "SciPy: Scientific Library for Python" +category = "main" +optional = false +python-versions = ">=3.7,<3.10" + +[package.dependencies] +numpy = ">=1.16.5,<1.23.0" + [[package]] name = "six" version = "1.16.0" @@ -183,6 +302,14 @@ category = "main" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*" +[[package]] +name = "typing-extensions" +version = "3.10.0.0" +description = "Backported and Experimental Type Hints for Python 3.5+" +category = "main" +optional = false +python-versions = "*" + [[package]] name = "wcwidth" version = "0.2.5" @@ -191,10 +318,38 @@ category = "main" optional = false python-versions = "*" +[[package]] +name = "yadism" +version = "0.7.0" +description = "Yet Another Deep-Inelastic Scattering Module" +category = "main" +optional = false +python-versions = ">=3.7" + +[package.dependencies] +eko = "<0.7" +numba = "*" +numpy = "*" +pandas = "*" +rich = "*" +scipy = "*" + +[[package]] +name = "zipp" +version = "3.5.0" +description = "Backport of pathlib-compatible object wrapper for zip files" +category = "main" +optional = false +python-versions = ">=3.6" + +[package.extras] +docs = ["sphinx", "jaraco.packaging (>=8.2)", "rst.linker (>=1.9)"] +testing = ["pytest (>=4.6)", "pytest-checkdocs (>=2.4)", "pytest-flake8", "pytest-cov", "pytest-enabler (>=1.0.1)", "jaraco.itertools", "func-timeout", "pytest-black (>=0.3.7)", "pytest-mypy"] + [metadata] lock-version = "1.1" -python-versions = "^3.9" -content-hash = "02874a31b3d753c9cb82872cc72b54d32e8ec3c0f028f214411eb9e89189a41e" +python-versions = ">=3.7,<3.10" +content-hash = "ccff0076beadcc4a2cfaec16cb83855fdeac323b230ade21aecb1bc07b6078fa" [metadata.files] atomicwrites = [ @@ -217,14 +372,124 @@ commonmark = [ {file = "commonmark-0.9.1-py2.py3-none-any.whl", hash = "sha256:da2f38c92590f83de410ba1a3cbceafbc74fee9def35f9251ba9a971d6d66fd9"}, {file = "commonmark-0.9.1.tar.gz", hash = "sha256:452f9dc859be7f06631ddcb328b6919c67984aca654e5fefb3914d54691aed60"}, ] +eko = [ + {file = "eko-0.6.0-py3-none-any.whl", hash = "sha256:bea01597305ea64012af5bbd2f8a93e9d1e9b9471d192a680023997e780f82a3"}, + {file = "eko-0.6.0.tar.gz", hash = "sha256:3c6f921c152254fcd69ececc87ab94ab9daee9841b99bdd1d2837a9bb36460d8"}, +] +importlib-metadata = [ + {file = "importlib_metadata-4.6.1-py3-none-any.whl", hash = "sha256:9f55f560e116f8643ecf2922d9cd3e1c7e8d52e683178fecd9d08f6aa357e11e"}, + {file = "importlib_metadata-4.6.1.tar.gz", hash = "sha256:079ada16b7fc30dfbb5d13399a5113110dab1aa7c2bc62f66af75f0b717c8cac"}, +] +llvmlite = [ + {file = "llvmlite-0.36.0-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:cc0f9b9644b4ab0e4a5edb17f1531d791630c88858220d3cc688d6edf10da100"}, + {file = "llvmlite-0.36.0-cp36-cp36m-manylinux2010_i686.whl", hash = "sha256:f7918dbac02b1ebbfd7302ad8e8307d7877ab57d782d5f04b70ff9696b53c21b"}, + {file = "llvmlite-0.36.0-cp36-cp36m-manylinux2010_x86_64.whl", hash = "sha256:7768658646c418b9b3beccb7044277a608bc8c62b82a85e73c7e5c065e4157c2"}, + {file = "llvmlite-0.36.0-cp36-cp36m-win32.whl", hash = "sha256:05f807209a360d39526d98141b6f281b9c7c771c77a4d1fc22002440642c8de2"}, + {file = "llvmlite-0.36.0-cp36-cp36m-win_amd64.whl", hash = "sha256:d1fdd63c371626c25ad834e1c6297eb76cf2f093a40dbb401a87b6476ab4e34e"}, + {file = "llvmlite-0.36.0-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:7c4e7066447305d5095d0b0a9cae7b835d2f0fde143456b3124110eab0856426"}, + {file = "llvmlite-0.36.0-cp37-cp37m-manylinux2010_i686.whl", hash = "sha256:9dad7e4bb042492914292aea3f4172eca84db731f9478250240955aedba95e08"}, + {file = "llvmlite-0.36.0-cp37-cp37m-manylinux2010_x86_64.whl", hash = "sha256:1ce5bc0a638d874a08d4222be0a7e48e5df305d094c2ff8dec525ef32b581551"}, + {file = "llvmlite-0.36.0-cp37-cp37m-win32.whl", hash = "sha256:dbedff0f6d417b374253a6bab39aa4b5364f1caab30c06ba8726904776fcf1cb"}, + {file = "llvmlite-0.36.0-cp37-cp37m-win_amd64.whl", hash = "sha256:3b17fc4b0dd17bd29d7297d054e2915fad535889907c3f65232ee21f483447c5"}, + {file = "llvmlite-0.36.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:b3a77e46e6053e2a86e607e87b97651dda81e619febb914824a927bff4e88737"}, + {file = "llvmlite-0.36.0-cp38-cp38-manylinux2010_i686.whl", hash = "sha256:048a7c117641c9be87b90005684e64a6f33ea0897ebab1df8a01214a10d6e79a"}, + {file = "llvmlite-0.36.0-cp38-cp38-manylinux2010_x86_64.whl", hash = "sha256:7db4b0eef93125af1c4092c64a3c73c7dc904101117ef53f8d78a1a499b8d5f4"}, + {file = "llvmlite-0.36.0-cp38-cp38-win32.whl", hash = "sha256:50b1828bde514b31431b2bba1aa20b387f5625b81ad6e12fede430a04645e47a"}, + {file = "llvmlite-0.36.0-cp38-cp38-win_amd64.whl", hash = "sha256:f608bae781b2d343e15e080c546468c5a6f35f57f0446923ea198dd21f23757e"}, + {file = "llvmlite-0.36.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:6a3abc8a8889aeb06bf9c4a7e5df5bc7bb1aa0aedd91a599813809abeec80b5a"}, + {file = "llvmlite-0.36.0-cp39-cp39-manylinux2010_i686.whl", hash = "sha256:705f0323d931684428bb3451549603299bb5e17dd60fb979d67c3807de0debc1"}, + {file = "llvmlite-0.36.0-cp39-cp39-manylinux2010_x86_64.whl", hash = "sha256:5a6548b4899facb182145147185e9166c69826fb424895f227e6b7cf924a8da1"}, + {file = "llvmlite-0.36.0-cp39-cp39-win32.whl", hash = "sha256:ff52fb9c2be66b95b0e67d56fce11038397e5be1ea410ee53f5f1175fdbb107a"}, + {file = "llvmlite-0.36.0-cp39-cp39-win_amd64.whl", hash = "sha256:1dee416ea49fd338c74ec15c0c013e5273b0961528169af06ff90772614f7f6c"}, + {file = "llvmlite-0.36.0.tar.gz", hash = "sha256:765128fdf5f149ed0b889ffbe2b05eb1717f8e20a5c87fa2b4018fbcce0fcfc9"}, +] more-itertools = [ {file = "more-itertools-8.8.0.tar.gz", hash = "sha256:83f0308e05477c68f56ea3a888172c78ed5d5b3c282addb67508e7ba6c8f813a"}, {file = "more_itertools-8.8.0-py3-none-any.whl", hash = "sha256:2cf89ec599962f2ddc4d568a05defc40e0a587fbc10d5989713638864c36be4d"}, ] +numba = [ + {file = "numba-0.53.1-cp36-cp36m-macosx_10_14_x86_64.whl", hash = "sha256:b23de6b6837c132087d06b8b92d343edb54b885873b824a037967fbd5272ebb7"}, + {file = "numba-0.53.1-cp36-cp36m-manylinux2014_i686.whl", hash = "sha256:6545b9e9b0c112b81de7f88a3c787469a357eeff8211e90b8f45ee243d521cc2"}, + {file = "numba-0.53.1-cp36-cp36m-manylinux2014_x86_64.whl", hash = "sha256:8fa5c963a43855050a868106a87cd614f3c3f459951c8fc468aec263ef80d063"}, + {file = "numba-0.53.1-cp36-cp36m-win32.whl", hash = "sha256:aaa6ebf56afb0b6752607b9f3bf39e99b0efe3c1fa6849698373925ee6838fd7"}, + {file = "numba-0.53.1-cp36-cp36m-win_amd64.whl", hash = "sha256:b08b3df38aab769df79ed948d70f0a54a3cdda49d58af65369235c204ec5d0f3"}, + {file = "numba-0.53.1-cp37-cp37m-macosx_10_14_x86_64.whl", hash = "sha256:bf5c463b62d013e3f709cc8277adf2f4f4d8cc6757293e29c6db121b77e6b760"}, + {file = "numba-0.53.1-cp37-cp37m-manylinux2014_i686.whl", hash = "sha256:74df02e73155f669e60dcff07c4eef4a03dbf5b388594db74142ab40914fe4f5"}, + {file = "numba-0.53.1-cp37-cp37m-manylinux2014_x86_64.whl", hash = "sha256:5165709bf62f28667e10b9afe6df0ce1037722adab92d620f59cb8bbb8104641"}, + {file = "numba-0.53.1-cp37-cp37m-win32.whl", hash = "sha256:2e96958ed2ca7e6d967b2ce29c8da0ca47117e1de28e7c30b2c8c57386506fa5"}, + {file = "numba-0.53.1-cp37-cp37m-win_amd64.whl", hash = "sha256:276f9d1674fe08d95872d81b97267c6b39dd830f05eb992608cbede50fcf48a9"}, + {file = "numba-0.53.1-cp38-cp38-macosx_10_14_x86_64.whl", hash = "sha256:4c4c8d102512ae472af52c76ad9522da718c392cb59f4cd6785d711fa5051a2a"}, + {file = "numba-0.53.1-cp38-cp38-manylinux2014_i686.whl", hash = "sha256:691adbeac17dbdf6ed7c759e9e33a522351f07d2065fe926b264b6b2c15fd89b"}, + {file = "numba-0.53.1-cp38-cp38-manylinux2014_x86_64.whl", hash = "sha256:94aab3e0e9e8754116325ce026e1b29ae72443c706a3104cf7f3368dc3012912"}, + {file = "numba-0.53.1-cp38-cp38-win32.whl", hash = "sha256:aabeec89bb3e3162136eea492cea7ee8882ddcda2201f05caecdece192c40896"}, + {file = "numba-0.53.1-cp38-cp38-win_amd64.whl", hash = "sha256:1895ebd256819ff22256cd6fe24aa8f7470b18acc73e7917e8e93c9ac7f565dc"}, + {file = "numba-0.53.1-cp39-cp39-macosx_10_14_x86_64.whl", hash = "sha256:224d197a46a9e602a16780d87636e199e2cdef528caef084a4d8fd8909c2455c"}, + {file = "numba-0.53.1-cp39-cp39-manylinux2014_i686.whl", hash = "sha256:aba7acb247a09d7f12bd17a8e28bbb04e8adef9fc20ca29835d03b7894e1b49f"}, + {file = "numba-0.53.1-cp39-cp39-manylinux2014_x86_64.whl", hash = "sha256:bd126f1f49da6fc4b3169cf1d96f1c3b3f84a7badd11fe22da344b923a00e744"}, + {file = "numba-0.53.1-cp39-cp39-win32.whl", hash = "sha256:0ef9d1f347b251282ae46e5a5033600aa2d0dfa1ee8c16cb8137b8cd6f79e221"}, + {file = "numba-0.53.1-cp39-cp39-win_amd64.whl", hash = "sha256:17146885cbe4e89c9d4abd4fcb8886dee06d4591943dc4343500c36ce2fcfa69"}, + {file = "numba-0.53.1.tar.gz", hash = "sha256:9cd4e5216acdc66c4e9dab2dfd22ddb5bef151185c070d4a3cd8e78638aff5b0"}, +] +numpy = [ + {file = "numpy-1.21.1-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:38e8648f9449a549a7dfe8d8755a5979b45b3538520d1e735637ef28e8c2dc50"}, + {file = "numpy-1.21.1-cp37-cp37m-manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:fd7d7409fa643a91d0a05c7554dd68aa9c9bb16e186f6ccfe40d6e003156e33a"}, + {file = "numpy-1.21.1-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:a75b4498b1e93d8b700282dc8e655b8bd559c0904b3910b144646dbbbc03e062"}, + {file = "numpy-1.21.1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1412aa0aec3e00bc23fbb8664d76552b4efde98fb71f60737c83efbac24112f1"}, + {file = "numpy-1.21.1-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:e46ceaff65609b5399163de5893d8f2a82d3c77d5e56d976c8b5fb01faa6b671"}, + {file = "numpy-1.21.1-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:c6a2324085dd52f96498419ba95b5777e40b6bcbc20088fddb9e8cbb58885e8e"}, + {file = "numpy-1.21.1-cp37-cp37m-win32.whl", hash = "sha256:73101b2a1fef16602696d133db402a7e7586654682244344b8329cdcbbb82172"}, + {file = "numpy-1.21.1-cp37-cp37m-win_amd64.whl", hash = "sha256:7a708a79c9a9d26904d1cca8d383bf869edf6f8e7650d85dbc77b041e8c5a0f8"}, + {file = "numpy-1.21.1-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:95b995d0c413f5d0428b3f880e8fe1660ff9396dcd1f9eedbc311f37b5652e16"}, + {file = "numpy-1.21.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:635e6bd31c9fb3d475c8f44a089569070d10a9ef18ed13738b03049280281267"}, + {file = "numpy-1.21.1-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:4a3d5fb89bfe21be2ef47c0614b9c9c707b7362386c9a3ff1feae63e0267ccb6"}, + {file = "numpy-1.21.1-cp38-cp38-manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:8a326af80e86d0e9ce92bcc1e65c8ff88297de4fa14ee936cb2293d414c9ec63"}, + {file = "numpy-1.21.1-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:791492091744b0fe390a6ce85cc1bf5149968ac7d5f0477288f78c89b385d9af"}, + {file = "numpy-1.21.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0318c465786c1f63ac05d7c4dbcecd4d2d7e13f0959b01b534ea1e92202235c5"}, + {file = "numpy-1.21.1-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:9a513bd9c1551894ee3d31369f9b07460ef223694098cf27d399513415855b68"}, + {file = "numpy-1.21.1-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:91c6f5fc58df1e0a3cc0c3a717bb3308ff850abdaa6d2d802573ee2b11f674a8"}, + {file = "numpy-1.21.1-cp38-cp38-win32.whl", hash = "sha256:978010b68e17150db8765355d1ccdd450f9fc916824e8c4e35ee620590e234cd"}, + {file = "numpy-1.21.1-cp38-cp38-win_amd64.whl", hash = "sha256:9749a40a5b22333467f02fe11edc98f022133ee1bfa8ab99bda5e5437b831214"}, + {file = "numpy-1.21.1-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:d7a4aeac3b94af92a9373d6e77b37691b86411f9745190d2c351f410ab3a791f"}, + {file = "numpy-1.21.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:d9e7912a56108aba9b31df688a4c4f5cb0d9d3787386b87d504762b6754fbb1b"}, + {file = "numpy-1.21.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:25b40b98ebdd272bc3020935427a4530b7d60dfbe1ab9381a39147834e985eac"}, + {file = "numpy-1.21.1-cp39-cp39-manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:8a92c5aea763d14ba9d6475803fc7904bda7decc2a0a68153f587ad82941fec1"}, + {file = "numpy-1.21.1-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:05a0f648eb28bae4bcb204e6fd14603de2908de982e761a2fc78efe0f19e96e1"}, + {file = "numpy-1.21.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f01f28075a92eede918b965e86e8f0ba7b7797a95aa8d35e1cc8821f5fc3ad6a"}, + {file = "numpy-1.21.1-cp39-cp39-win32.whl", hash = "sha256:88c0b89ad1cc24a5efbb99ff9ab5db0f9a86e9cc50240177a571fbe9c2860ac2"}, + {file = "numpy-1.21.1-cp39-cp39-win_amd64.whl", hash = "sha256:01721eefe70544d548425a07c80be8377096a54118070b8a62476866d5208e33"}, + {file = "numpy-1.21.1-pp37-pypy37_pp73-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:2d4d1de6e6fb3d28781c73fbde702ac97f03d79e4ffd6598b880b2d95d62ead4"}, + {file = "numpy-1.21.1.zip", hash = "sha256:dff4af63638afcc57a3dfb9e4b26d434a7a602d225b42d746ea7fe2edf1342fd"}, +] packaging = [ {file = "packaging-21.0-py3-none-any.whl", hash = "sha256:c86254f9220d55e31cc94d69bade760f0847da8000def4dfe1c6b872fd14ff14"}, {file = "packaging-21.0.tar.gz", hash = "sha256:7dc96269f53a4ccec5c0670940a4281106dd0bb343f47b7471f779df49c2fbe7"}, ] +pandas = [ + {file = "pandas-1.1.5-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:bf23a3b54d128b50f4f9d4675b3c1857a688cc6731a32f931837d72effb2698d"}, + {file = "pandas-1.1.5-cp36-cp36m-manylinux1_i686.whl", hash = "sha256:5a780260afc88268a9d3ac3511d8f494fdcf637eece62fb9eb656a63d53eb7ca"}, + {file = "pandas-1.1.5-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:b61080750d19a0122469ab59b087380721d6b72a4e7d962e4d7e63e0c4504814"}, + {file = "pandas-1.1.5-cp36-cp36m-manylinux2014_aarch64.whl", hash = "sha256:0de3ddb414d30798cbf56e642d82cac30a80223ad6fe484d66c0ce01a84d6f2f"}, + {file = "pandas-1.1.5-cp36-cp36m-win32.whl", hash = "sha256:70865f96bb38fec46f7ebd66d4b5cfd0aa6b842073f298d621385ae3898d28b5"}, + {file = "pandas-1.1.5-cp36-cp36m-win_amd64.whl", hash = "sha256:19a2148a1d02791352e9fa637899a78e371a3516ac6da5c4edc718f60cbae648"}, + {file = "pandas-1.1.5-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:26fa92d3ac743a149a31b21d6f4337b0594b6302ea5575b37af9ca9611e8981a"}, + {file = "pandas-1.1.5-cp37-cp37m-manylinux1_i686.whl", hash = "sha256:c16d59c15d946111d2716856dd5479221c9e4f2f5c7bc2d617f39d870031e086"}, + {file = "pandas-1.1.5-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:3be7a7a0ca71a2640e81d9276f526bca63505850add10206d0da2e8a0a325dae"}, + {file = "pandas-1.1.5-cp37-cp37m-manylinux2014_aarch64.whl", hash = "sha256:573fba5b05bf2c69271a32e52399c8de599e4a15ab7cec47d3b9c904125ab788"}, + {file = "pandas-1.1.5-cp37-cp37m-win32.whl", hash = "sha256:21b5a2b033380adbdd36b3116faaf9a4663e375325831dac1b519a44f9e439bb"}, + {file = "pandas-1.1.5-cp37-cp37m-win_amd64.whl", hash = "sha256:24c7f8d4aee71bfa6401faeba367dd654f696a77151a8a28bc2013f7ced4af98"}, + {file = "pandas-1.1.5-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:2860a97cbb25444ffc0088b457da0a79dc79f9c601238a3e0644312fcc14bf11"}, + {file = "pandas-1.1.5-cp38-cp38-manylinux1_i686.whl", hash = "sha256:5008374ebb990dad9ed48b0f5d0038124c73748f5384cc8c46904dace27082d9"}, + {file = "pandas-1.1.5-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:2c2f7c670ea4e60318e4b7e474d56447cf0c7d83b3c2a5405a0dbb2600b9c48e"}, + {file = "pandas-1.1.5-cp38-cp38-manylinux2014_aarch64.whl", hash = "sha256:0a643bae4283a37732ddfcecab3f62dd082996021b980f580903f4e8e01b3c5b"}, + {file = "pandas-1.1.5-cp38-cp38-win32.whl", hash = "sha256:5447ea7af4005b0daf695a316a423b96374c9c73ffbd4533209c5ddc369e644b"}, + {file = "pandas-1.1.5-cp38-cp38-win_amd64.whl", hash = "sha256:4c62e94d5d49db116bef1bd5c2486723a292d79409fc9abd51adf9e05329101d"}, + {file = "pandas-1.1.5-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:731568be71fba1e13cae212c362f3d2ca8932e83cb1b85e3f1b4dd77d019254a"}, + {file = "pandas-1.1.5-cp39-cp39-manylinux1_i686.whl", hash = "sha256:c61c043aafb69329d0f961b19faa30b1dab709dd34c9388143fc55680059e55a"}, + {file = "pandas-1.1.5-cp39-cp39-manylinux1_x86_64.whl", hash = "sha256:2b1c6cd28a0dfda75c7b5957363333f01d370936e4c6276b7b8e696dd500582a"}, + {file = "pandas-1.1.5-cp39-cp39-win32.whl", hash = "sha256:c94ff2780a1fd89f190390130d6d36173ca59fcfb3fe0ff596f9a56518191ccb"}, + {file = "pandas-1.1.5-cp39-cp39-win_amd64.whl", hash = "sha256:edda9bacc3843dfbeebaf7a701763e68e741b08fccb889c003b0a52f0ee95782"}, + {file = "pandas-1.1.5.tar.gz", hash = "sha256:f10fc41ee3c75a474d3bdf68d396f10782d013d7f67db99c0efbfd0acb99701b"}, +] pluggy = [ {file = "pluggy-0.13.1-py2.py3-none-any.whl", hash = "sha256:966c145cd83c96502c3c3868f50408687b38434af77734af1e9ca461a4081d2d"}, {file = "pluggy-0.13.1.tar.gz", hash = "sha256:15b2acde666561e1298d71b523007ed7364de07029219b604cf808bfa1c765b0"}, @@ -253,6 +518,45 @@ pytest = [ {file = "pytest-5.4.3-py3-none-any.whl", hash = "sha256:5c0db86b698e8f170ba4582a492248919255fcd4c79b1ee64ace34301fb589a1"}, {file = "pytest-5.4.3.tar.gz", hash = "sha256:7979331bfcba207414f5e1263b5a0f8f521d0f457318836a7355531ed1a4c7d8"}, ] +python-dateutil = [ + {file = "python-dateutil-2.8.2.tar.gz", hash = "sha256:0123cacc1627ae19ddf3c27a5de5bd67ee4586fbdd6440d9748f8abb483d3e86"}, + {file = "python_dateutil-2.8.2-py2.py3-none-any.whl", hash = "sha256:961d03dc3453ebbc59dbdea9e4e11c5651520a876d0f4db161e8674aae935da9"}, +] +pytz = [ + {file = "pytz-2021.1-py2.py3-none-any.whl", hash = "sha256:eb10ce3e7736052ed3623d49975ce333bcd712c7bb19a58b9e2089d4057d0798"}, + {file = "pytz-2021.1.tar.gz", hash = "sha256:83a4a90894bf38e243cf052c8b58f381bfe9a7a483f6a9cab140bc7f702ac4da"}, +] +pyyaml = [ + {file = "PyYAML-5.4.1-cp27-cp27m-macosx_10_9_x86_64.whl", hash = "sha256:3b2b1824fe7112845700f815ff6a489360226a5609b96ec2190a45e62a9fc922"}, + {file = "PyYAML-5.4.1-cp27-cp27m-win32.whl", hash = "sha256:129def1b7c1bf22faffd67b8f3724645203b79d8f4cc81f674654d9902cb4393"}, + {file = "PyYAML-5.4.1-cp27-cp27m-win_amd64.whl", hash = "sha256:4465124ef1b18d9ace298060f4eccc64b0850899ac4ac53294547536533800c8"}, + {file = "PyYAML-5.4.1-cp27-cp27mu-manylinux1_x86_64.whl", hash = "sha256:bb4191dfc9306777bc594117aee052446b3fa88737cd13b7188d0e7aa8162185"}, + {file = "PyYAML-5.4.1-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:6c78645d400265a062508ae399b60b8c167bf003db364ecb26dcab2bda048253"}, + {file = "PyYAML-5.4.1-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:4e0583d24c881e14342eaf4ec5fbc97f934b999a6828693a99157fde912540cc"}, + {file = "PyYAML-5.4.1-cp36-cp36m-manylinux2014_aarch64.whl", hash = "sha256:72a01f726a9c7851ca9bfad6fd09ca4e090a023c00945ea05ba1638c09dc3347"}, + {file = "PyYAML-5.4.1-cp36-cp36m-manylinux2014_s390x.whl", hash = "sha256:895f61ef02e8fed38159bb70f7e100e00f471eae2bc838cd0f4ebb21e28f8541"}, + {file = "PyYAML-5.4.1-cp36-cp36m-win32.whl", hash = "sha256:3bd0e463264cf257d1ffd2e40223b197271046d09dadf73a0fe82b9c1fc385a5"}, + {file = "PyYAML-5.4.1-cp36-cp36m-win_amd64.whl", hash = "sha256:e4fac90784481d221a8e4b1162afa7c47ed953be40d31ab4629ae917510051df"}, + {file = "PyYAML-5.4.1-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:5accb17103e43963b80e6f837831f38d314a0495500067cb25afab2e8d7a4018"}, + {file = "PyYAML-5.4.1-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:e1d4970ea66be07ae37a3c2e48b5ec63f7ba6804bdddfdbd3cfd954d25a82e63"}, + {file = "PyYAML-5.4.1-cp37-cp37m-manylinux2014_aarch64.whl", hash = "sha256:cb333c16912324fd5f769fff6bc5de372e9e7a202247b48870bc251ed40239aa"}, + {file = "PyYAML-5.4.1-cp37-cp37m-manylinux2014_s390x.whl", hash = "sha256:fe69978f3f768926cfa37b867e3843918e012cf83f680806599ddce33c2c68b0"}, + {file = "PyYAML-5.4.1-cp37-cp37m-win32.whl", hash = "sha256:dd5de0646207f053eb0d6c74ae45ba98c3395a571a2891858e87df7c9b9bd51b"}, + {file = "PyYAML-5.4.1-cp37-cp37m-win_amd64.whl", hash = "sha256:08682f6b72c722394747bddaf0aa62277e02557c0fd1c42cb853016a38f8dedf"}, + {file = "PyYAML-5.4.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:d2d9808ea7b4af864f35ea216be506ecec180628aced0704e34aca0b040ffe46"}, + {file = "PyYAML-5.4.1-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:8c1be557ee92a20f184922c7b6424e8ab6691788e6d86137c5d93c1a6ec1b8fb"}, + {file = "PyYAML-5.4.1-cp38-cp38-manylinux2014_aarch64.whl", hash = "sha256:fd7f6999a8070df521b6384004ef42833b9bd62cfee11a09bda1079b4b704247"}, + {file = "PyYAML-5.4.1-cp38-cp38-manylinux2014_s390x.whl", hash = "sha256:bfb51918d4ff3d77c1c856a9699f8492c612cde32fd3bcd344af9be34999bfdc"}, + {file = "PyYAML-5.4.1-cp38-cp38-win32.whl", hash = "sha256:fa5ae20527d8e831e8230cbffd9f8fe952815b2b7dae6ffec25318803a7528fc"}, + {file = "PyYAML-5.4.1-cp38-cp38-win_amd64.whl", hash = "sha256:0f5f5786c0e09baddcd8b4b45f20a7b5d61a7e7e99846e3c799b05c7c53fa696"}, + {file = "PyYAML-5.4.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:294db365efa064d00b8d1ef65d8ea2c3426ac366c0c4368d930bf1c5fb497f77"}, + {file = "PyYAML-5.4.1-cp39-cp39-manylinux1_x86_64.whl", hash = "sha256:74c1485f7707cf707a7aef42ef6322b8f97921bd89be2ab6317fd782c2d53183"}, + {file = "PyYAML-5.4.1-cp39-cp39-manylinux2014_aarch64.whl", hash = "sha256:d483ad4e639292c90170eb6f7783ad19490e7a8defb3e46f97dfe4bacae89122"}, + {file = "PyYAML-5.4.1-cp39-cp39-manylinux2014_s390x.whl", hash = "sha256:fdc842473cd33f45ff6bce46aea678a54e3d21f1b61a7750ce3c498eedfe25d6"}, + {file = "PyYAML-5.4.1-cp39-cp39-win32.whl", hash = "sha256:49d4cdd9065b9b6e206d0595fee27a96b5dd22618e7520c33204a4a3239d5b10"}, + {file = "PyYAML-5.4.1-cp39-cp39-win_amd64.whl", hash = "sha256:c20cfa2d49991c8b4147af39859b167664f2ad4561704ee74c1de03318e898db"}, + {file = "PyYAML-5.4.1.tar.gz", hash = "sha256:607774cbba28732bfa802b54baa7484215f530991055bb562efbed5b2f20a45e"}, +] regex = [ {file = "regex-2021.7.6-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:e6a1e5ca97d411a461041d057348e578dc344ecd2add3555aedba3b408c9f874"}, {file = "regex-2021.7.6-cp36-cp36m-manylinux1_i686.whl", hash = "sha256:6afe6a627888c9a6cfbb603d1d017ce204cebd589d66e0703309b8048c3b0854"}, @@ -300,11 +604,44 @@ rich = [ {file = "rich-10.6.0-py3-none-any.whl", hash = "sha256:d3f72827cd5df13b2ef7f1a97f81ec65548d4fdeb92cef653234f227580bbb2a"}, {file = "rich-10.6.0.tar.gz", hash = "sha256:128261b3e2419a4ef9c97066ccc2abbfb49fa7c5e89c3fe4056d00aa5e9c1e65"}, ] +scipy = [ + {file = "scipy-1.7.0-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:821e75f5c16cd7b0ab0ffe7eb9917e5af7b48c25306b4777287de8d792a5f7f3"}, + {file = "scipy-1.7.0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3e7df79b42c3015058a5554bfeab6fd4c9906c46560c9ddebb5c652840f3e182"}, + {file = "scipy-1.7.0-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:0572256c10ddd058e3d315c555538671ddb2737f27eb56189bfbc3483391403f"}, + {file = "scipy-1.7.0-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:b77ee5e3a9507622e7f98b16122242a3903397f98d1fe3bc269d904a9025e2bc"}, + {file = "scipy-1.7.0-cp37-cp37m-win32.whl", hash = "sha256:53116abd5060a5b4a58489cf689bee259b779e6b7ecd4ce366e7147aa7c9626e"}, + {file = "scipy-1.7.0-cp37-cp37m-win_amd64.whl", hash = "sha256:e7b733d4d98e604109715e11f2ab9340eb45d53f803634ed730039070fc3bc11"}, + {file = "scipy-1.7.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:4ef3d4df8af40cb6f4d4eaf7b02780109ebabeec334cda26a7899ec9d8de9176"}, + {file = "scipy-1.7.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:bd4399d4388ca0239a4825e312b3e61b60f743dd6daf49e5870837716502a92a"}, + {file = "scipy-1.7.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:80df8af7039bce92fb4cd1ceb056258631b11b3c627384e2d29bb48d44c0cae7"}, + {file = "scipy-1.7.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:6130e22bf6ee506f7cddde7e0515296d97eb6c6c94f7ef5103c2b77aec5833a7"}, + {file = "scipy-1.7.0-cp38-cp38-win32.whl", hash = "sha256:97ca4552ace1c313707058e774609af59644321e278c3a539322fab2fb09b943"}, + {file = "scipy-1.7.0-cp38-cp38-win_amd64.whl", hash = "sha256:c5d012cb82cc1dcfa72609abaabb4a4ed8113e3e8ac43464508a418c146be57d"}, + {file = "scipy-1.7.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:5eb8f054eebb351af7490bbb57465ba9662c4e16e1786655c6c7ed530eb9a74e"}, + {file = "scipy-1.7.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7f4b89c223bd09460b52b669e2e642cab73c28855b540e6ed029692546a86f8d"}, + {file = "scipy-1.7.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:2e685fdbfa5b989af4338b29c408b9157ea6addec15d661104c437980c292be5"}, + {file = "scipy-1.7.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:3595c8b64970c9e5a3f137fa1a9eb64da417e78fb7991d0b098b18a00b776d88"}, + {file = "scipy-1.7.0-cp39-cp39-win32.whl", hash = "sha256:5a983d3cebc27294897951a494cebd78af2eae37facf75d9e4ad4f1f62229860"}, + {file = "scipy-1.7.0-cp39-cp39-win_amd64.whl", hash = "sha256:aef6e922aea6f2e6bbb539b413c85210a9ee32757535b84204ebd22723e69704"}, + {file = "scipy-1.7.0.tar.gz", hash = "sha256:998c5e6ea649489302de2c0bc026ed34284f531df89d2bdc8df3a0d44d165739"}, +] six = [ {file = "six-1.16.0-py2.py3-none-any.whl", hash = "sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254"}, {file = "six-1.16.0.tar.gz", hash = "sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926"}, ] +typing-extensions = [ + {file = "typing_extensions-3.10.0.0-py2-none-any.whl", hash = "sha256:0ac0f89795dd19de6b97debb0c6af1c70987fd80a2d62d1958f7e56fcc31b497"}, + {file = "typing_extensions-3.10.0.0-py3-none-any.whl", hash = "sha256:779383f6086d90c99ae41cf0ff39aac8a7937a9283ce0a414e5dd782f4c94a84"}, + {file = "typing_extensions-3.10.0.0.tar.gz", hash = "sha256:50b6f157849174217d0656f99dc82fe932884fb250826c18350e159ec6cdf342"}, +] wcwidth = [ {file = "wcwidth-0.2.5-py2.py3-none-any.whl", hash = "sha256:beb4802a9cebb9144e99086eff703a642a13d6a0052920003a230f3294bbe784"}, {file = "wcwidth-0.2.5.tar.gz", hash = "sha256:c4d647b99872929fdb7bdcaa4fbe7f01413ed3d98077df798530e5b04f116c83"}, ] +yadism = [ + {file = "yadism-0.7.0-py3-none-any.whl", hash = "sha256:5da4afecfd52796318b572e399807537a7784c8398df298e947fa330e71f62fc"}, +] +zipp = [ + {file = "zipp-3.5.0-py3-none-any.whl", hash = "sha256:957cfda87797e389580cb8b9e3870841ca991e2125350677b2ca83a0e99390a3"}, + {file = "zipp-3.5.0.tar.gz", hash = "sha256:f5812b1e007e48cff63449a5e9f4e7ebea716b4111f9c4f9a645f91d579bf0c4"}, +] diff --git a/pyproject.toml b/pyproject.toml index 03fa86da..8a268e44 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,10 +5,12 @@ description = "generate runcards" authors = ["Alessandro Candido "] [tool.poetry.dependencies] -python = "^3.9" +python = ">=3.7,<3.10" click = "^8.0.1" PyInquirer = "^1.0.3" rich = "^10.6.0" +PyYAML = "^5.4.1" +yadism = "^0.7.0" [tool.poetry.dev-dependencies] pytest = "^5.2" diff --git a/run/dis_.py b/run/dis_.py index 4e4f8811..c563fa31 100644 --- a/run/dis_.py +++ b/run/dis_.py @@ -1,25 +1,43 @@ -import pathlib +import datetime import click import rich +import yaml +import yadism -from . import tools - -root = pathlib.Path(__file__).absolute().parents[1] +from . import tools, paths @click.command() def dis(): rich.print("Computing [red]dis[/]...") - rich.print(select_datasets()) + datasets = select_datasets() + rich.print(datasets) + for name in datasets: + run_dataset(name) def load_datasets(): - proc = root / "nnpdf31_proc" - dis_sets = [p for p in proc.iterdir() if (p / "observable.yaml").is_file()] + dis_sets = [ + p for p in paths.runcards.iterdir() if (p / "observable.yaml").is_file() + ] return dis_sets def select_datasets(): datasets = [p.stem for p in load_datasets()] return tools.select_datasets(datasets) + + +def run_dataset(name): + with open(paths.pkg / "theory.yaml") as t: + theory = yaml.safe_load(t) + with open(paths.runcards / name / "observable.yaml") as o: + obs = yaml.safe_load(o) + + out = yadism.run_yadism(theory, obs) + target = paths.root / (name + datetime.datetime.now().strftime("-%Y%m%d%H%M%S")) + target.mkdir(exist_ok=True) + out.dump_pineappl_to_file( + str(target / f"{name}.pineappl"), next(iter(obs["observables"].keys())) + ) diff --git a/run/paths.py b/run/paths.py new file mode 100644 index 00000000..eab2152d --- /dev/null +++ b/run/paths.py @@ -0,0 +1,5 @@ +import pathlib + +pkg = pathlib.Path(__file__).absolute().parent +root = pkg.parent +runcards = root / "nnpdf31_proc" diff --git a/run/theory.yaml b/run/theory.yaml new file mode 100644 index 00000000..2abf778d --- /dev/null +++ b/run/theory.yaml @@ -0,0 +1,43 @@ +CKM: "0.97428 0.22530 0.003470 0.22520 0.97345 0.041000 0.00862 0.04030 0.999152" +Comments: "LO baseline for small-x res" +DAMP: 0 +EScaleVar: 1 +FNS: ZM-VFNS +GF: 1.1663787e-05 +HQ: POLE +IC: 0 +ID: 0 +MP: 0.938 +MW: 80.398 +MZ: 91.1876 +MaxNfAs: 6 +MaxNfPdf: 6 +ModEv: EXA +NfFF: 3 +PTO: 1 +Q0: 1.0 +QED: 0 +Qedref: 1.777 +Qmb: 4.5 +Qmc: 2.0 +Qmt: 173.07 +Qref: 91.2 +SIN2TW: 0.23126 +SxOrd: LL +SxRes: 0 +TMC: 0 +XIF: 1.0 +XIR: 1.0 +alphaqed: 0.007496251999999999 +alphas: 0.11800000000000001 +fact_to_ren_scale_ratio: 1.0 +global_nx: 0 +kDISbThr: 1.0 +kDIScThr: 1.0 +kDIStThr: 1.0 +kbThr: 1.0 +kcThr: 1.0 +ktThr: 1.0 +mb: 4.5 +mc: 2.0 +mt: 173.07 diff --git a/run_dis.py b/run_dis.py deleted file mode 100755 index e8f4ebd0..00000000 --- a/run_dis.py +++ /dev/null @@ -1,73 +0,0 @@ -import yadism -import yaml -import pathlib -import numpy as np -import argparse - -here = pathlib.Path(__file__).parent - -runcards = here / "nnpdf31_proc" - -theory = { - "CKM": "0.97428 0.22530 0.003470 0.22520 0.97345 0.041000 0.00862 0.04030 0.999152", - "Comments": "LO baseline for small-x res", - "DAMP": 0, - "EScaleVar": 1, - "FNS": "ZM-VFNS", - "GF": 1.1663787e-05, - "HQ": "POLE", - "IC": 0, - "ID": 0, - "MP": 0.938, - "MW": 80.398, - "MZ": 91.1876, - "MaxNfAs": 6, - "MaxNfPdf": 6, - "ModEv": "EXA", - "NfFF": 3, - "PTO": 1, - "Q0": 1.0, - "QED": 0, - "Qedref": 1.777, - "Qmb": 4.5, - "Qmc": 2.0, - "Qmt": 173.07, - "Qref": 91.2, - "SIN2TW": 0.23126, - "SxOrd": "LL", - "SxRes": 0, - "TMC": 0, - "XIF": 1.0, - "XIR": 1.0, - "alphaqed": 0.007496251999999999, - "alphas": 0.11800000000000001, - "fact_to_ren_scale_ratio": 1.0, - "global_nx": 0, - "kDISbThr": 1.0, - "kDIScThr": 1.0, - "kDIStThr": 1.0, - "kbThr": 1.0, - "kcThr": 1.0, - "ktThr": 1.0, - "mb": 4.5, - "mc": 2.0, - "mt": 173.07, -} - - -def run_dataset(name): - with open(runcards / name / "observable.yaml") as o: - obs = yaml.safe_load(o) - out = yadism.run_yadism(theory, obs) - target = here / name - target.mkdir(exist_ok=True) - out.dump_pineappl_to_file( - str(target / f"{name}.pineappl"), next(iter(obs["observables"].keys())) - ) - - -if __name__ == "__main__": - ap = argparse.ArgumentParser() - ap.add_argument("dataset") - args = ap.parse_args() - run_dataset(args.dataset) From 38e30986f0072d556958ae0116e3a6d960e01d02 Mon Sep 17 00:00:00 2001 From: Alessandro Candido Date: Thu, 22 Jul 2021 15:38:43 +0200 Subject: [PATCH 04/63] Add table comparison to dis --- poetry.lock | 57 +++++++++++++-------------- pyproject.toml | 3 +- run/dis_.py | 31 ++++++++++++--- run/table.py | 53 +++++++++++++++++++++++++ run/theory.yaml | 2 +- run_dis.sh | 100 +++++++++++++++++++----------------------------- 6 files changed, 147 insertions(+), 99 deletions(-) create mode 100644 run/table.py diff --git a/poetry.lock b/poetry.lock index 2b2445ff..a19daee4 100644 --- a/poetry.lock +++ b/poetry.lock @@ -131,19 +131,19 @@ pyparsing = ">=2.0.2" [[package]] name = "pandas" -version = "1.1.5" +version = "1.3.0" description = "Powerful data structures for data analysis, time series, and statistics" category = "main" optional = false -python-versions = ">=3.6.1" +python-versions = ">=3.7.1" [package.dependencies] -numpy = ">=1.15.4" +numpy = ">=1.17.3" python-dateutil = ">=2.7.3" -pytz = ">=2017.2" +pytz = ">=2017.3" [package.extras] -test = ["pytest (>=4.0.2)", "pytest-xdist", "hypothesis (>=3.58)"] +test = ["hypothesis (>=3.58)", "pytest (>=6.0)", "pytest-xdist"] [[package]] name = "pluggy" @@ -348,8 +348,8 @@ testing = ["pytest (>=4.6)", "pytest-checkdocs (>=2.4)", "pytest-flake8", "pytes [metadata] lock-version = "1.1" -python-versions = ">=3.7,<3.10" -content-hash = "ccff0076beadcc4a2cfaec16cb83855fdeac323b230ade21aecb1bc07b6078fa" +python-versions = ">=3.7.1,<3.10" +content-hash = "17db3fc95778bb75c4db8354779c31c09b7af257415a1cdf3816bcb6a7e543dd" [metadata.files] atomicwrites = [ @@ -465,30 +465,25 @@ packaging = [ {file = "packaging-21.0.tar.gz", hash = "sha256:7dc96269f53a4ccec5c0670940a4281106dd0bb343f47b7471f779df49c2fbe7"}, ] pandas = [ - {file = "pandas-1.1.5-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:bf23a3b54d128b50f4f9d4675b3c1857a688cc6731a32f931837d72effb2698d"}, - {file = "pandas-1.1.5-cp36-cp36m-manylinux1_i686.whl", hash = "sha256:5a780260afc88268a9d3ac3511d8f494fdcf637eece62fb9eb656a63d53eb7ca"}, - {file = "pandas-1.1.5-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:b61080750d19a0122469ab59b087380721d6b72a4e7d962e4d7e63e0c4504814"}, - {file = "pandas-1.1.5-cp36-cp36m-manylinux2014_aarch64.whl", hash = "sha256:0de3ddb414d30798cbf56e642d82cac30a80223ad6fe484d66c0ce01a84d6f2f"}, - {file = "pandas-1.1.5-cp36-cp36m-win32.whl", hash = "sha256:70865f96bb38fec46f7ebd66d4b5cfd0aa6b842073f298d621385ae3898d28b5"}, - {file = "pandas-1.1.5-cp36-cp36m-win_amd64.whl", hash = "sha256:19a2148a1d02791352e9fa637899a78e371a3516ac6da5c4edc718f60cbae648"}, - {file = "pandas-1.1.5-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:26fa92d3ac743a149a31b21d6f4337b0594b6302ea5575b37af9ca9611e8981a"}, - {file = "pandas-1.1.5-cp37-cp37m-manylinux1_i686.whl", hash = "sha256:c16d59c15d946111d2716856dd5479221c9e4f2f5c7bc2d617f39d870031e086"}, - {file = "pandas-1.1.5-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:3be7a7a0ca71a2640e81d9276f526bca63505850add10206d0da2e8a0a325dae"}, - {file = "pandas-1.1.5-cp37-cp37m-manylinux2014_aarch64.whl", hash = "sha256:573fba5b05bf2c69271a32e52399c8de599e4a15ab7cec47d3b9c904125ab788"}, - {file = "pandas-1.1.5-cp37-cp37m-win32.whl", hash = "sha256:21b5a2b033380adbdd36b3116faaf9a4663e375325831dac1b519a44f9e439bb"}, - {file = "pandas-1.1.5-cp37-cp37m-win_amd64.whl", hash = "sha256:24c7f8d4aee71bfa6401faeba367dd654f696a77151a8a28bc2013f7ced4af98"}, - {file = "pandas-1.1.5-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:2860a97cbb25444ffc0088b457da0a79dc79f9c601238a3e0644312fcc14bf11"}, - {file = "pandas-1.1.5-cp38-cp38-manylinux1_i686.whl", hash = "sha256:5008374ebb990dad9ed48b0f5d0038124c73748f5384cc8c46904dace27082d9"}, - {file = "pandas-1.1.5-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:2c2f7c670ea4e60318e4b7e474d56447cf0c7d83b3c2a5405a0dbb2600b9c48e"}, - {file = "pandas-1.1.5-cp38-cp38-manylinux2014_aarch64.whl", hash = "sha256:0a643bae4283a37732ddfcecab3f62dd082996021b980f580903f4e8e01b3c5b"}, - {file = "pandas-1.1.5-cp38-cp38-win32.whl", hash = "sha256:5447ea7af4005b0daf695a316a423b96374c9c73ffbd4533209c5ddc369e644b"}, - {file = "pandas-1.1.5-cp38-cp38-win_amd64.whl", hash = "sha256:4c62e94d5d49db116bef1bd5c2486723a292d79409fc9abd51adf9e05329101d"}, - {file = "pandas-1.1.5-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:731568be71fba1e13cae212c362f3d2ca8932e83cb1b85e3f1b4dd77d019254a"}, - {file = "pandas-1.1.5-cp39-cp39-manylinux1_i686.whl", hash = "sha256:c61c043aafb69329d0f961b19faa30b1dab709dd34c9388143fc55680059e55a"}, - {file = "pandas-1.1.5-cp39-cp39-manylinux1_x86_64.whl", hash = "sha256:2b1c6cd28a0dfda75c7b5957363333f01d370936e4c6276b7b8e696dd500582a"}, - {file = "pandas-1.1.5-cp39-cp39-win32.whl", hash = "sha256:c94ff2780a1fd89f190390130d6d36173ca59fcfb3fe0ff596f9a56518191ccb"}, - {file = "pandas-1.1.5-cp39-cp39-win_amd64.whl", hash = "sha256:edda9bacc3843dfbeebaf7a701763e68e741b08fccb889c003b0a52f0ee95782"}, - {file = "pandas-1.1.5.tar.gz", hash = "sha256:f10fc41ee3c75a474d3bdf68d396f10782d013d7f67db99c0efbfd0acb99701b"}, + {file = "pandas-1.3.0-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:c81b8d91e9ae861eb4406b4e0f8d4dabbc105b9c479b3d1e921fba1d35b5b62a"}, + {file = "pandas-1.3.0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:08eeff3da6a188e24db7f292b39a8ca9e073bf841fbbeadb946b3ad5c19d843e"}, + {file = "pandas-1.3.0-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:88864c1e28353b958b1f30e4193818519624ad9a1776921622a6a2a016d5d807"}, + {file = "pandas-1.3.0-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:872aa91e0f9ca913046ab639d4181a899f5e592030d954d28c2529b88756a736"}, + {file = "pandas-1.3.0-cp37-cp37m-win32.whl", hash = "sha256:92835113a67cbd34747c198d41f09f4b63f6fe11ca5643baebc7ab1e30e89e95"}, + {file = "pandas-1.3.0-cp37-cp37m-win_amd64.whl", hash = "sha256:7d3cd2c99faa94d717ca00ea489264a291ad7209453dffbf059bfb7971fd3a61"}, + {file = "pandas-1.3.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:823737830364d0e2af8c3912a28ba971296181a07950873492ed94e12d28c405"}, + {file = "pandas-1.3.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c746876cdd8380be0c3e70966d4566855901ac9aaa5e4b9ccaa5ca5311457d11"}, + {file = "pandas-1.3.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:fe7a549d10ca534797095586883a5c17d140d606747591258869c56e14d1b457"}, + {file = "pandas-1.3.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:f058c786e7b0a9e7fa5e0b9f4422e0ccdd3bf3aa3053c18d77ed2a459bd9a45a"}, + {file = "pandas-1.3.0-cp38-cp38-win32.whl", hash = "sha256:98efc2d4983d5bb47662fe2d97b2c81b91566cb08b266490918b9c7d74a5ef64"}, + {file = "pandas-1.3.0-cp38-cp38-win_amd64.whl", hash = "sha256:e6b75091fa54a53db3927b4d1bc997c23c5ba6f87acdfe1ee5a92c38c6b2ed6a"}, + {file = "pandas-1.3.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:1ff13eed501e07e7fb26a4ea18a846b6e5d7de549b497025601fd9ccb7c1d123"}, + {file = "pandas-1.3.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:798675317d0e4863a92a9a6bc5bd2490b5f6fef8c17b95f29e2e33f28bef9eca"}, + {file = "pandas-1.3.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:ed4fc66f23fe17c93a5d439230ca2d6b5f8eac7154198d327dbe8a16d98f3f10"}, + {file = "pandas-1.3.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:522bfea92f3ef6207cadc7428bda1e7605dae0383b8065030e7b5d0266717b48"}, + {file = "pandas-1.3.0-cp39-cp39-win32.whl", hash = "sha256:7897326cae660eee69d501cbfa950281a193fcf407393965e1bc07448e1cc35a"}, + {file = "pandas-1.3.0-cp39-cp39-win_amd64.whl", hash = "sha256:b10d7910ae9d7920a5ff7816d794d99acbc361f7b16a0f017d4fa83ced8cb55e"}, + {file = "pandas-1.3.0.tar.gz", hash = "sha256:c554e6c9cf2d5ea1aba5979cc837b3649539ced0e18ece186f055450c86622e2"}, ] pluggy = [ {file = "pluggy-0.13.1-py2.py3-none-any.whl", hash = "sha256:966c145cd83c96502c3c3868f50408687b38434af77734af1e9ca461a4081d2d"}, diff --git a/pyproject.toml b/pyproject.toml index 8a268e44..28259c83 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -5,12 +5,13 @@ description = "generate runcards" authors = ["Alessandro Candido "] [tool.poetry.dependencies] -python = ">=3.7,<3.10" +python = ">=3.7.1,<3.10" click = "^8.0.1" PyInquirer = "^1.0.3" rich = "^10.6.0" PyYAML = "^5.4.1" yadism = "^0.7.0" +pandas = "^1.3.0" [tool.poetry.dev-dependencies] pytest = "^5.2" diff --git a/run/dis_.py b/run/dis_.py index c563fa31..17d23876 100644 --- a/run/dis_.py +++ b/run/dis_.py @@ -4,14 +4,18 @@ import rich import yaml import yadism +import lhapdf -from . import tools, paths +from . import tools, paths, table @click.command() -def dis(): +@click.option("--datasets", multiple=True) +def dis(datasets): rich.print("Computing [red]dis[/]...") - datasets = select_datasets() + if len(datasets) == 0: + datasets = select_datasets() + rich.print(datasets) for name in datasets: run_dataset(name) @@ -29,15 +33,30 @@ def select_datasets(): return tools.select_datasets(datasets) +def yadism_results(out, pdf_name): + pdf = lhapdf.mkPDF(pdf_name) + pdf_out = out.apply_pdf_alphas_alphaqed_xir_xif( + pdf, lambda muR: lhapdf.mkAlphaS(pdf_name).alphasQ(muR), lambda muR: 0, 1.0, 1.0 + ) + pdf_out = next(iter(pdf_out.tables.values())) + return pdf_out + + def run_dataset(name): + # load runcards with open(paths.pkg / "theory.yaml") as t: theory = yaml.safe_load(t) with open(paths.runcards / name / "observable.yaml") as o: obs = yaml.safe_load(o) + # run yadism out = yadism.run_yadism(theory, obs) + + # dump pineappl target = paths.root / (name + datetime.datetime.now().strftime("-%Y%m%d%H%M%S")) target.mkdir(exist_ok=True) - out.dump_pineappl_to_file( - str(target / f"{name}.pineappl"), next(iter(obs["observables"].keys())) - ) + grid_path = target / f"{name}.pineappl" + out.dump_pineappl_to_file(str(grid_path), next(iter(obs["observables"].keys()))) + + pdf = "NNPDF31_nlo_as_0118_luxqed" + table.print_table(table.compute_data(grid_path, pdf), yadism_results(out, pdf)) diff --git a/run/table.py b/run/table.py new file mode 100644 index 00000000..2b933276 --- /dev/null +++ b/run/table.py @@ -0,0 +1,53 @@ +import subprocess +import io +import itertools + +import pandas as pd + + +def compute_data(grid, pdf_name): + pineappl_results = subprocess.run( + f"pineappl convolute {grid} {pdf_name} --scales 9 --absolute --integrated".split(), + capture_output=True, + ) + + output = pineappl_results.stdout.decode().splitlines()[2:-2] + header = output[0].split() + header = [ + header[0], + *itertools.chain(*[(e + "_min", e + "_max") for e in header[1:-10]]), + *header[-10:], + ] + output = output[2:] + + df = pd.DataFrame([row.split() for row in output], dtype=float, columns=header) + df.drop("bin", axis=1, inplace=True) + + return df + + +def print_table(pineappl_results, external_results): + labels = [ + "PineAPPL", + "MC", + "sigma 1/100", + "central sigma", + "min 1/1000", + "max 1/1000", + ] + comparison = pd.DataFrame() + comparison["PineAPPL"] = pineappl_results["integ"] + comparison["MC"] = external_results["result"] + comparison["sigma 1/100"] = ( + external_results["error"] / external_results["result"] * 100 + ).replace(float("inf"), 0.0) + comparison["central sigma"] = ( + (pineappl_results["integ"] - external_results["result"]).abs() + / external_results["error"] + ).replace(float("inf"), 0.0) + comparison["central 1/1000"] = ( + (pineappl_results["integ"] / external_results["result"] - 1).abs() * 1000 + ).replace(float("inf"), 0.0) + comparison["min 1/1000"] = 0.0 + comparison["max 1/1000"] = 0.0 + print(comparison) diff --git a/run/theory.yaml b/run/theory.yaml index 2abf778d..7faec805 100644 --- a/run/theory.yaml +++ b/run/theory.yaml @@ -14,7 +14,7 @@ MaxNfAs: 6 MaxNfPdf: 6 ModEv: EXA NfFF: 3 -PTO: 1 +PTO: 0 Q0: 1.0 QED: 0 Qedref: 1.777 diff --git a/run_dis.sh b/run_dis.sh index 8bce0eae..bf739066 100755 --- a/run_dis.sh +++ b/run_dis.sh @@ -4,63 +4,43 @@ prefix=$(pwd)/.prefix export LC_ALL=C -install_pineappl() {( - mkdir -p "${prefix}" - - cargo=$(which cargo 2> /dev/null || true) - git=$(which git 2> /dev/null) - pip=$(which pip 2> /dev/null || true) - - repo=https://github.com/N3PDF/pineappl.git - - if [[ ! -x ${cargo} ]]; then - export CARGO_HOME=${prefix}/cargo - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > /tmp/rustup-init - bash /tmp/rustup-init --profile minimal --no-modify-path -y - export PATH=${prefix}/cargo/bin:${PATH} - cargo="${prefix}"/cargo/bin/cargo - elif [[ -d ${prefix}/cargo ]]; then - export CARGO_HOME=${prefix}/cargo - fi - - if [[ -d ${prefix}/pineappl ]]; then - "${git}" pull - else - "${git}" clone ${repo} "${prefix}"/pineappl - fi - - "${cargo}" install --force cargo-c - - if [[ -x ${pip} ]]; then - pyver=$(python --version | cut -d' ' -f 2 | cut -d. -f1,2) - export PATH="${prefix}"/bin:${PATH} - export PYTHONPATH="${prefix}"/lib/python${pyver}/site-packages - "${pip}" install --prefix "${prefix}" maturin - fi - - pushd . > /dev/null - cd "${prefix}"/pineappl/pineappl_py - maturin build --manylinux off - popd > /dev/null - "${pip}" install --prefix "${prefix}" "${prefix}"/pineappl/target/wheels/pineappl_py*.whl -)} - -install_yadism() { - mkdir -p "${prefix}" - - pip=$(which pip 2> /dev/null || true) - - - if [[ -x ${pip} ]]; then - pyver=$(python --version | cut -d' ' -f 2 | cut -d. -f1,2) - export PATH="${prefix}"/bin:${PATH} - export PYTHONPATH="${prefix}"/lib/python${pyver}/site-packages - "${pip}" install --prefix "${prefix}" yadism - fi - -} - -#install_pineappl -install_yadism - -python run_dis.py "$@" +install_pineappl() { ( + mkdir -p "${prefix}" + + cargo=$(which cargo 2>/dev/null || true) + git=$(which git 2>/dev/null) + pip=$(which pip 2>/dev/null || true) + + repo=https://github.com/N3PDF/pineappl.git + + if [[ ! -x ${cargo} ]]; then + export CARGO_HOME=${prefix}/cargo + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs >/tmp/rustup-init + bash /tmp/rustup-init --profile minimal --no-modify-path -y + export PATH=${prefix}/cargo/bin:${PATH} + cargo="${prefix}"/cargo/bin/cargo + elif [[ -d ${prefix}/cargo ]]; then + export CARGO_HOME=${prefix}/cargo + fi + + if [[ -d ${prefix}/pineappl ]]; then + "${git}" pull + else + "${git}" clone ${repo} "${prefix}"/pineappl + fi + + "${cargo}" install --force cargo-c + + if [[ -x ${pip} ]]; then + pyver=$(python --version | cut -d' ' -f 2 | cut -d. -f1,2) + export PATH="${prefix}"/bin:${PATH} + export PYTHONPATH="${prefix}"/lib/python${pyver}/site-packages + "${pip}" install --prefix "${prefix}" maturin + fi + + pushd . >/dev/null + cd "${prefix}"/pineappl/pineappl_py + maturin build --manylinux off + popd >/dev/null + "${pip}" install --prefix "${prefix}" "${prefix}"/pineappl/target/wheels/pineappl_py*.whl +); } From db03d06aaf28ec6f6977ae62816f68bfe288ef98 Mon Sep 17 00:00:00 2001 From: Alessandro Candido Date: Thu, 22 Jul 2021 15:45:30 +0200 Subject: [PATCH 05/63] Arbitrary PDF set available --- run/dis_.py | 8 ++++---- run/table.py | 11 ++--------- 2 files changed, 6 insertions(+), 13 deletions(-) diff --git a/run/dis_.py b/run/dis_.py index 17d23876..5c881381 100644 --- a/run/dis_.py +++ b/run/dis_.py @@ -11,14 +11,15 @@ @click.command() @click.option("--datasets", multiple=True) -def dis(datasets): +@click.option("--pdf", default="NNPDF31_nlo_as_0118_luxqed") +def dis(datasets, pdf): rich.print("Computing [red]dis[/]...") if len(datasets) == 0: datasets = select_datasets() rich.print(datasets) for name in datasets: - run_dataset(name) + run_dataset(name, pdf) def load_datasets(): @@ -42,7 +43,7 @@ def yadism_results(out, pdf_name): return pdf_out -def run_dataset(name): +def run_dataset(name, pdf): # load runcards with open(paths.pkg / "theory.yaml") as t: theory = yaml.safe_load(t) @@ -58,5 +59,4 @@ def run_dataset(name): grid_path = target / f"{name}.pineappl" out.dump_pineappl_to_file(str(grid_path), next(iter(obs["observables"].keys()))) - pdf = "NNPDF31_nlo_as_0118_luxqed" table.print_table(table.compute_data(grid_path, pdf), yadism_results(out, pdf)) diff --git a/run/table.py b/run/table.py index 2b933276..92ef3a4b 100644 --- a/run/table.py +++ b/run/table.py @@ -27,14 +27,6 @@ def compute_data(grid, pdf_name): def print_table(pineappl_results, external_results): - labels = [ - "PineAPPL", - "MC", - "sigma 1/100", - "central sigma", - "min 1/1000", - "max 1/1000", - ] comparison = pd.DataFrame() comparison["PineAPPL"] = pineappl_results["integ"] comparison["MC"] = external_results["result"] @@ -50,4 +42,5 @@ def print_table(pineappl_results, external_results): ).replace(float("inf"), 0.0) comparison["min 1/1000"] = 0.0 comparison["max 1/1000"] = 0.0 - print(comparison) + with pd.option_context("display.max_rows", None): + print(comparison) From 3a72415f00594d64fec4efb39305f84c5a6e20c4 Mon Sep 17 00:00:00 2001 From: Alessandro Candido Date: Mon, 16 Aug 2021 16:20:07 +0200 Subject: [PATCH 06/63] Remove old dis runner --- run_dis.py | 68 ------------------------------------------------------ 1 file changed, 68 deletions(-) delete mode 100755 run_dis.py diff --git a/run_dis.py b/run_dis.py deleted file mode 100755 index bceb2c91..00000000 --- a/run_dis.py +++ /dev/null @@ -1,68 +0,0 @@ -import yadism -import yaml -import pathlib -import numpy as np -import argparse - -theory = { - "CKM": "0.97428 0.22530 0.003470 0.22520 0.97345 0.041000 0.00862 0.04030 0.999152", - "Comments": "LO baseline for small-x res", - "DAMP": 0, - "EScaleVar": 1, - "FNS": "ZM-VFNS", - "GF": 1.1663787e-05, - "HQ": "POLE", - "IC": 0, - "ID": 0, - "MP": 0.938, - "MW": 80.398, - "MZ": 91.1876, - "MaxNfAs": 6, - "MaxNfPdf": 6, - "ModEv": "EXA", - "NfFF": 3, - "PTO": 1, - "Q0": 1.0, - "QED": 0, - "Qedref": 1.777, - "Qmb": 4.5, - "Qmc": 2.0, - "Qmt": 173.07, - "Qref": 91.2, - "SIN2TW": 0.23126, - "SxOrd": "LL", - "SxRes": 0, - "TMC": 0, - "XIF": 1.0, - "XIR": 1.0, - "alphaqed": 0.007496251999999999, - "alphas": 0.11800000000000001, - "fact_to_ren_scale_ratio": 1.0, - "global_nx": 0, - "kDISbThr": 1.0, - "kDIScThr": 1.0, - "kDIStThr": 1.0, - "kbThr": 1.0, - "kcThr": 1.0, - "ktThr": 1.0, - "mb": 4.5, - "mc": 2.0, - "mt": 173.07, -} - - -def run_dataset(runcard, dataset): - with open(runcard) as o: - obs = yaml.safe_load(o) - out = yadism.run_yadism(theory, obs) - out.dump_pineappl_to_file( - str(f"{dataset}.pineappl"), next(iter(obs["observables"].keys())) - ) - - -if __name__ == "__main__": - ap = argparse.ArgumentParser() - ap.add_argument("runcard") - ap.add_argument("dataset") - args = ap.parse_args() - run_dataset(args.runcard, args.dataset) From a62810bc0b057518c1951848d2984bfc2266b470 Mon Sep 17 00:00:00 2001 From: Alessandro Candido Date: Tue, 17 Aug 2021 13:18:27 +0200 Subject: [PATCH 07/63] Add compression to dis runner --- pyproject.toml | 1 + run/dis_.py | 11 ++++++----- run/tools.py | 28 ++++++++++++++++++++++++++++ 3 files changed, 35 insertions(+), 5 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 28259c83..7c4db8f2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -12,6 +12,7 @@ rich = "^10.6.0" PyYAML = "^5.4.1" yadism = "^0.7.0" pandas = "^1.3.0" +lz4 = "^3.1.3" [tool.poetry.dev-dependencies] pytest = "^5.2" diff --git a/run/dis_.py b/run/dis_.py index 5c881381..2a7bb43c 100644 --- a/run/dis_.py +++ b/run/dis_.py @@ -1,5 +1,3 @@ -import datetime - import click import rich import yaml @@ -54,9 +52,12 @@ def run_dataset(name, pdf): out = yadism.run_yadism(theory, obs) # dump pineappl - target = paths.root / (name + datetime.datetime.now().strftime("-%Y%m%d%H%M%S")) - target.mkdir(exist_ok=True) - grid_path = target / f"{name}.pineappl" + grid_path = tools.create_folder(name) out.dump_pineappl_to_file(str(grid_path), next(iter(obs["observables"].keys()))) table.print_table(table.compute_data(grid_path, pdf), yadism_results(out, pdf)) + + # compress + tools.compress(grid_path) + if (grid_path.parent / (grid_path.name + ".lz4")).exists(): + grid_path.unlink() diff --git a/run/tools.py b/run/tools.py index 460383fd..73bede45 100644 --- a/run/tools.py +++ b/run/tools.py @@ -1,6 +1,10 @@ +import datetime from difflib import SequenceMatcher import rich +import lz4.frame + +from . import paths def similar(a, b): @@ -53,3 +57,27 @@ def select_datasets(datasets_list): ans = input("> ") readline.set_completer() return ans.split() + + +def create_folder(name): + target = paths.root / (name + datetime.datetime.now().strftime("-%Y%m%d%H%M%S")) + target.mkdir(exist_ok=True) + return target / f"{name}.pineappl" + + +def compress(path): + with open(path, "rb") as f: + data = f.read() + + with lz4.frame.open(path.parent / (path.name + ".lz4"), "wb") as f: + f.write(data) + + +def decompress(path): + with lz4.frame.open(path, "r") as f: + data = f.read() + + with open( + path.parent / (path.stem + ".".join(path.suffix.split(".")[:-1])), "wb" + ) as f: + f.write(data) From 690fa2027c9b68f72aa169ad965e19e8c0e784ad Mon Sep 17 00:00:00 2001 From: Alessandro Candido Date: Tue, 17 Aug 2021 14:32:17 +0200 Subject: [PATCH 08/63] Improve management of compressed paths --- run/dis_.py | 9 +++++---- run/tools.py | 14 ++++++++++---- 2 files changed, 15 insertions(+), 8 deletions(-) diff --git a/run/dis_.py b/run/dis_.py index 2a7bb43c..09b7c944 100644 --- a/run/dis_.py +++ b/run/dis_.py @@ -55,9 +55,10 @@ def run_dataset(name, pdf): grid_path = tools.create_folder(name) out.dump_pineappl_to_file(str(grid_path), next(iter(obs["observables"].keys()))) - table.print_table(table.compute_data(grid_path, pdf), yadism_results(out, pdf)) - # compress - tools.compress(grid_path) - if (grid_path.parent / (grid_path.name + ".lz4")).exists(): + cpath = tools.compress(grid_path) + if cpath.exists(): grid_path.unlink() + grid_path = cpath + + table.print_table(table.compute_data(grid_path, pdf), yadism_results(out, pdf)) diff --git a/run/tools.py b/run/tools.py index 73bede45..a80739da 100644 --- a/run/tools.py +++ b/run/tools.py @@ -69,15 +69,21 @@ def compress(path): with open(path, "rb") as f: data = f.read() - with lz4.frame.open(path.parent / (path.name + ".lz4"), "wb") as f: + compressed_path = path.parent / (path.name + ".lz4") + with lz4.frame.open(compressed_path, "wb") as f: f.write(data) + return compressed_path + def decompress(path): with lz4.frame.open(path, "r") as f: data = f.read() - with open( - path.parent / (path.stem + ".".join(path.suffix.split(".")[:-1])), "wb" - ) as f: + decompressed_path = path.parent / ( + path.stem + ".".join(path.suffix.split(".")[:-1]) + ) + with open(decompressed_path, "wb") as f: f.write(data) + + return decompressed_path From b688ce0cc707879f6157df86545cc19150a68eca Mon Sep 17 00:00:00 2001 From: Alessandro Candido Date: Tue, 17 Aug 2021 16:39:14 +0200 Subject: [PATCH 09/63] Add yadism scale variations --- run/dis_.py | 36 +++++++++++++++++++++++++++++++++++- run/table.py | 24 ++++++++++++++++++++---- run/theory.yaml | 2 +- run/tools.py | 5 +++++ 4 files changed, 61 insertions(+), 6 deletions(-) diff --git a/run/dis_.py b/run/dis_.py index 09b7c944..dc2ec080 100644 --- a/run/dis_.py +++ b/run/dis_.py @@ -3,6 +3,9 @@ import yaml import yadism import lhapdf +from functools import reduce + +import pandas as pd from . import tools, paths, table @@ -35,9 +38,40 @@ def select_datasets(): def yadism_results(out, pdf_name): pdf = lhapdf.mkPDF(pdf_name) pdf_out = out.apply_pdf_alphas_alphaqed_xir_xif( - pdf, lambda muR: lhapdf.mkAlphaS(pdf_name).alphasQ(muR), lambda muR: 0, 1.0, 1.0 + pdf, + lambda muR: lhapdf.mkAlphaS(pdf_name).alphasQ(muR), + lambda _muR: 0, + 1.0, + 1.0, ) pdf_out = next(iter(pdf_out.tables.values())) + + sv_pdf_out = [] + for xiR, xiF in tools.nine_points: + sv_point = out.apply_pdf_alphas_alphaqed_xir_xif( + pdf, + lambda muR: lhapdf.mkAlphaS(pdf_name).alphasQ(muR), + lambda _muR: 0.0, + xiR, + xiF, + ) + df = ( + next(iter(sv_point.tables.values())) + .rename({"result": (xiR, xiF)}, axis=1) + .drop("error", axis=1) + ) + sv_pdf_out.append(df) + + sv_pdf_merged = reduce( + lambda left, right: pd.merge(left, right, on=["x", "Q2"], how="outer"), + sv_pdf_out, + ) + svdf = sv_pdf_merged[ + list(filter(lambda name: isinstance(name, tuple), sv_pdf_merged.columns)) + ] + pdf_out["sv_max"] = svdf.max(axis=1) + pdf_out["sv_min"] = svdf.min(axis=1) + return pdf_out diff --git a/run/table.py b/run/table.py index 92ef3a4b..6de64421 100644 --- a/run/table.py +++ b/run/table.py @@ -1,5 +1,4 @@ import subprocess -import io import itertools import pandas as pd @@ -23,16 +22,24 @@ def compute_data(grid, pdf_name): df = pd.DataFrame([row.split() for row in output], dtype=float, columns=header) df.drop("bin", axis=1, inplace=True) + svdf = df[list(filter(lambda s: s[0] == "(", df.columns))] + df["sv_max"] = svdf.max(axis=1) + df["sv_min"] = svdf.min(axis=1) + return df def print_table(pineappl_results, external_results): comparison = pd.DataFrame() + + # bare results comparison["PineAPPL"] = pineappl_results["integ"] comparison["MC"] = external_results["result"] comparison["sigma 1/100"] = ( external_results["error"] / external_results["result"] * 100 ).replace(float("inf"), 0.0) + + # ratios comparison["central sigma"] = ( (pineappl_results["integ"] - external_results["result"]).abs() / external_results["error"] @@ -40,7 +47,16 @@ def print_table(pineappl_results, external_results): comparison["central 1/1000"] = ( (pineappl_results["integ"] / external_results["result"] - 1).abs() * 1000 ).replace(float("inf"), 0.0) - comparison["min 1/1000"] = 0.0 - comparison["max 1/1000"] = 0.0 - with pd.option_context("display.max_rows", None): + + # scale variation ratios + comparison["min 1/1000"] = ( + pineappl_results["sv_min"] / external_results["sv_min"] - 1.0 + ).abs() * 1e3 + comparison["max 1/1000"] = ( + pineappl_results["sv_max"] / external_results["sv_max"] - 1.0 + ).abs() * 1e3 + + with pd.option_context( + "display.max_rows", None, "display.float_format", lambda f: f"{f:.1e}" + ): print(comparison) diff --git a/run/theory.yaml b/run/theory.yaml index 7faec805..2abf778d 100644 --- a/run/theory.yaml +++ b/run/theory.yaml @@ -14,7 +14,7 @@ MaxNfAs: 6 MaxNfPdf: 6 ModEv: EXA NfFF: 3 -PTO: 0 +PTO: 1 Q0: 1.0 QED: 0 Qedref: 1.777 diff --git a/run/tools.py b/run/tools.py index a80739da..2b5511db 100644 --- a/run/tools.py +++ b/run/tools.py @@ -1,4 +1,5 @@ import datetime +import itertools from difflib import SequenceMatcher import rich @@ -87,3 +88,7 @@ def decompress(path): f.write(data) return decompressed_path + + +three_points = [0.5, 1.0, 2.0] +nine_points = itertools.product(three_points, three_points) From 5040c4a0e220c3f30e9e17e51978bc82b5945a9f Mon Sep 17 00:00:00 2001 From: Alessandro Candido Date: Tue, 17 Aug 2021 17:44:51 +0200 Subject: [PATCH 10/63] Replace only once inf with zero --- run/table.py | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/run/table.py b/run/table.py index 6de64421..d581825f 100644 --- a/run/table.py +++ b/run/table.py @@ -36,17 +36,16 @@ def print_table(pineappl_results, external_results): comparison["PineAPPL"] = pineappl_results["integ"] comparison["MC"] = external_results["result"] comparison["sigma 1/100"] = ( - external_results["error"] / external_results["result"] * 100 - ).replace(float("inf"), 0.0) + external_results["error"] / external_results["result"] * 1e2 + ) # ratios comparison["central sigma"] = ( - (pineappl_results["integ"] - external_results["result"]).abs() - / external_results["error"] - ).replace(float("inf"), 0.0) + pineappl_results["integ"] - external_results["result"] + ).abs() / external_results["error"] comparison["central 1/1000"] = ( - (pineappl_results["integ"] / external_results["result"] - 1).abs() * 1000 - ).replace(float("inf"), 0.0) + pineappl_results["integ"] / external_results["result"] - 1 + ).abs() * 1e3 # scale variation ratios comparison["min 1/1000"] = ( @@ -56,6 +55,8 @@ def print_table(pineappl_results, external_results): pineappl_results["sv_max"] / external_results["sv_max"] - 1.0 ).abs() * 1e3 + comparison.replace(float("inf"), 0.0, inplace=True) + with pd.option_context( "display.max_rows", None, "display.float_format", lambda f: f"{f:.1e}" ): From 441f215ba21002eac50842b6f60ec3e069976793 Mon Sep 17 00:00:00 2001 From: Alessandro Candido Date: Wed, 18 Aug 2021 14:46:46 +0200 Subject: [PATCH 11/63] Add madgraph installation --- poetry.lock | 167 ++++++++++++++++++++++++++++++++++++++++++++++++- pyproject.toml | 2 + run/install.py | 25 ++++++++ run/paths.py | 2 + 4 files changed, 195 insertions(+), 1 deletion(-) create mode 100644 run/install.py diff --git a/poetry.lock b/poetry.lock index a19daee4..7bcd37cb 100644 --- a/poetry.lock +++ b/poetry.lock @@ -20,6 +20,35 @@ docs = ["furo", "sphinx", "zope.interface", "sphinx-notfound-page"] tests = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "mypy", "pytest-mypy-plugins", "zope.interface"] tests_no_zope = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "mypy", "pytest-mypy-plugins"] +[[package]] +name = "breezy" +version = "3.2.1" +description = "Friendly distributed version control system" +category = "main" +optional = false +python-versions = ">=3.5" + +[package.dependencies] +configobj = "*" +dulwich = ">=0.20.23" +patiencediff = "*" + +[package.extras] +cext = ["cython (>=0.29)"] +doc = ["sphinx-epytext", "setuptools (<45)", "sphinx (==1.8.5)"] +fastimport = ["fastimport (<0.9.8)", "fastimport"] +git = ["dulwich (>=0.20.23)"] +launchpad = ["launchpadlib (>=1.6.3)"] +workspace = ["pyinotify"] + +[[package]] +name = "certifi" +version = "2021.5.30" +description = "Python package for providing Mozilla's CA Bundle." +category = "main" +optional = false +python-versions = "*" + [[package]] name = "click" version = "8.0.1" @@ -51,6 +80,35 @@ python-versions = "*" [package.extras] test = ["flake8 (==3.7.8)", "hypothesis (==3.55.3)"] +[[package]] +name = "configobj" +version = "5.0.6" +description = "Config file reading, writing and validation." +category = "main" +optional = false +python-versions = "*" + +[package.dependencies] +six = "*" + +[[package]] +name = "dulwich" +version = "0.20.24" +description = "Python Git Library" +category = "main" +optional = false +python-versions = ">=3.5" + +[package.dependencies] +certifi = "*" +urllib3 = ">=1.24.1" + +[package.extras] +fastimport = ["fastimport"] +https = ["urllib3[secure] (>=1.24.1)"] +pgp = ["gpg"] +watch = ["pyinotify"] + [[package]] name = "eko" version = "0.6.0" @@ -90,6 +148,19 @@ category = "main" optional = false python-versions = ">=3.6,<3.10" +[[package]] +name = "lz4" +version = "3.1.3" +description = "LZ4 Bindings for Python" +category = "main" +optional = false +python-versions = ">=3.5" + +[package.extras] +docs = ["sphinx (>=1.6.0)", "sphinx-bootstrap-theme"] +flake8 = ["flake8"] +tests = ["pytest (!=3.3.0)", "psutil", "pytest-cov"] + [[package]] name = "more-itertools" version = "8.8.0" @@ -145,6 +216,14 @@ pytz = ">=2017.3" [package.extras] test = ["hypothesis (>=3.58)", "pytest (>=6.0)", "pytest-xdist"] +[[package]] +name = "patiencediff" +version = "0.2.2" +description = "Python implementation of the patiencediff algorithm." +category = "main" +optional = false +python-versions = "*" + [[package]] name = "pluggy" version = "0.13.1" @@ -310,6 +389,19 @@ category = "main" optional = false python-versions = "*" +[[package]] +name = "urllib3" +version = "1.26.6" +description = "HTTP library with thread-safe connection pooling, file post, and more." +category = "main" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, <4" + +[package.extras] +brotli = ["brotlipy (>=0.6.0)"] +secure = ["pyOpenSSL (>=0.14)", "cryptography (>=1.3.4)", "idna (>=2.0.0)", "certifi", "ipaddress"] +socks = ["PySocks (>=1.5.6,!=1.5.7,<2.0)"] + [[package]] name = "wcwidth" version = "0.2.5" @@ -349,7 +441,7 @@ testing = ["pytest (>=4.6)", "pytest-checkdocs (>=2.4)", "pytest-flake8", "pytes [metadata] lock-version = "1.1" python-versions = ">=3.7.1,<3.10" -content-hash = "17db3fc95778bb75c4db8354779c31c09b7af257415a1cdf3816bcb6a7e543dd" +content-hash = "78c9689f561a55a13858c6933ef51e61316843e58f68c306914aafbc85d5a054" [metadata.files] atomicwrites = [ @@ -360,6 +452,13 @@ attrs = [ {file = "attrs-21.2.0-py2.py3-none-any.whl", hash = "sha256:149e90d6d8ac20db7a955ad60cf0e6881a3f20d37096140088356da6c716b0b1"}, {file = "attrs-21.2.0.tar.gz", hash = "sha256:ef6aaac3ca6cd92904cdd0d83f629a15f18053ec84e6432106f7a4d04ae4f5fb"}, ] +breezy = [ + {file = "breezy-3.2.1.tar.gz", hash = "sha256:e0b268eb1a28a2af045280c37d021ae32d7ff175f4c9b99f33aad7db0b29d85c"}, +] +certifi = [ + {file = "certifi-2021.5.30-py2.py3-none-any.whl", hash = "sha256:50b1e4f8446b06f41be7dd6338db18e0990601dce795c2b1686458aa7e8fa7d8"}, + {file = "certifi-2021.5.30.tar.gz", hash = "sha256:2bbf76fd432960138b3ef6dda3dde0544f27cbf8546c458e60baf371917ba9ee"}, +] click = [ {file = "click-8.0.1-py3-none-any.whl", hash = "sha256:fba402a4a47334742d782209a7c79bc448911afe1149d07bdabdf480b3e2f4b6"}, {file = "click-8.0.1.tar.gz", hash = "sha256:8c04c11192119b1ef78ea049e0a6f0463e4c48ef00a30160c704337586f3ad7a"}, @@ -372,6 +471,28 @@ commonmark = [ {file = "commonmark-0.9.1-py2.py3-none-any.whl", hash = "sha256:da2f38c92590f83de410ba1a3cbceafbc74fee9def35f9251ba9a971d6d66fd9"}, {file = "commonmark-0.9.1.tar.gz", hash = "sha256:452f9dc859be7f06631ddcb328b6919c67984aca654e5fefb3914d54691aed60"}, ] +configobj = [ + {file = "configobj-5.0.6.tar.gz", hash = "sha256:a2f5650770e1c87fb335af19a9b7eb73fc05ccf22144eb68db7d00cd2bcb0902"}, +] +dulwich = [ + {file = "dulwich-0.20.24-cp36-cp36m-macosx_10_14_x86_64.whl", hash = "sha256:555c88a1076cd1cab12c5dac93239e63e2dc4347ae475c5ca0ea5494098eab0f"}, + {file = "dulwich-0.20.24-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5ff59d02a4d61ee273708b85a8b370d46ea4bedd097904ab92682a2d44553284"}, + {file = "dulwich-0.20.24-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:bab10f9580372267c3385e3ab9b3939e212a713f398c410d6f1392f96d6f0ffa"}, + {file = "dulwich-0.20.24-cp36-cp36m-win_amd64.whl", hash = "sha256:3d4249dd7bd608932ff3e8362b18f9b8ad899436063f8dd395355fd345da92c3"}, + {file = "dulwich-0.20.24-cp37-cp37m-macosx_10_14_x86_64.whl", hash = "sha256:fe649f2c95c209452639075d0ccd8cad6bda960044cf9b2e6268e1ac6ed30bac"}, + {file = "dulwich-0.20.24-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:df138aa678e3c6d9c1b21fa8e591311c0871b72fca635cc3c35361a540cc3ad1"}, + {file = "dulwich-0.20.24-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:b9266eba455b399cbda79eac0a138dd80fd8af180e5dcf759d242749936eaeb3"}, + {file = "dulwich-0.20.24-cp37-cp37m-win_amd64.whl", hash = "sha256:bcd9c85ea319f7c7076de2717da0532dc99b1e4fd0bea374522af7436179f72f"}, + {file = "dulwich-0.20.24-cp38-cp38-macosx_10_14_x86_64.whl", hash = "sha256:aba891770d741613a13fc2d76972d99fff9b26a15383ad0f0bfbd3890e2b7a00"}, + {file = "dulwich-0.20.24-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8025f7249f9ed719af5cf041ac9a8de8fae0bf08875e9dcaedbccc98f4ea67a7"}, + {file = "dulwich-0.20.24-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:68cbdeae2e0c247690243c77c8b5cc671d6a091d6fbfcd43ff5eae13210e384f"}, + {file = "dulwich-0.20.24-cp38-cp38-win_amd64.whl", hash = "sha256:08a09353620981c8e9cc7ace76f71c8859bf035ae91c1b2bddb54494fe3b7638"}, + {file = "dulwich-0.20.24-cp39-cp39-macosx_10_14_x86_64.whl", hash = "sha256:3ab53d08bc8405cc99a1018e837b2866e0e1d0797999ab94bdfdc3b5369ec325"}, + {file = "dulwich-0.20.24-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:fc97a857b274f5ed41f73c4593e665924a38f613835cfd72c55393a710a64a49"}, + {file = "dulwich-0.20.24-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:7bee1516e0516ff441a93206d0bc0816781ee7f6df37c9f01a9578e2bff7cc7c"}, + {file = "dulwich-0.20.24-cp39-cp39-win_amd64.whl", hash = "sha256:8853b0306406f6fb82812d2fc2af43d4cda50ea0223551c3b27df5eb008b655f"}, + {file = "dulwich-0.20.24.tar.gz", hash = "sha256:6b61ac0a2a8b1b1e18914310f3f7a422396334208b426b9de570f1de31644cf1"}, +] eko = [ {file = "eko-0.6.0-py3-none-any.whl", hash = "sha256:bea01597305ea64012af5bbd2f8a93e9d1e9b9471d192a680023997e780f82a3"}, {file = "eko-0.6.0.tar.gz", hash = "sha256:3c6f921c152254fcd69ececc87ab94ab9daee9841b99bdd1d2837a9bb36460d8"}, @@ -403,6 +524,39 @@ llvmlite = [ {file = "llvmlite-0.36.0-cp39-cp39-win_amd64.whl", hash = "sha256:1dee416ea49fd338c74ec15c0c013e5273b0961528169af06ff90772614f7f6c"}, {file = "llvmlite-0.36.0.tar.gz", hash = "sha256:765128fdf5f149ed0b889ffbe2b05eb1717f8e20a5c87fa2b4018fbcce0fcfc9"}, ] +lz4 = [ + {file = "lz4-3.1.3-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:5aa4dd12debc5cb90980e6bb26be8b1586e57b87aaf6c773b9b799bca16edd99"}, + {file = "lz4-3.1.3-cp36-cp36m-manylinux1_i686.whl", hash = "sha256:7cf0e6e1020dbf8ea72ff57ece3f321f603cfa54f14337b96f7b68a7c1a742b4"}, + {file = "lz4-3.1.3-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:af1bc2952214c5a3ec6706cb86bd3e321570c62136539d32e4a57da777b002f0"}, + {file = "lz4-3.1.3-cp36-cp36m-manylinux2010_i686.whl", hash = "sha256:57dbd50d6abeb85f8d273b9f24f0063c4b97aae07d267302101884611a2413da"}, + {file = "lz4-3.1.3-cp36-cp36m-manylinux2010_x86_64.whl", hash = "sha256:1f8320b7b047ec4ba9a7de3509a067ccaac84dab2cadf629d0518760594c3b6a"}, + {file = "lz4-3.1.3-cp36-cp36m-win32.whl", hash = "sha256:502d6dc17aca64e4dc95d6e7920dca906b5eabc1e657213bd07066c97fbc8cd3"}, + {file = "lz4-3.1.3-cp36-cp36m-win_amd64.whl", hash = "sha256:b91fbc9571d3f3fea587ce541f38a2e71ef192075b59c2846182cb98f99862a0"}, + {file = "lz4-3.1.3-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:0f889e854114f87b5f99e8c82c9bf85417468b291b99a2cb27bcdcc864841a33"}, + {file = "lz4-3.1.3-cp37-cp37m-manylinux1_i686.whl", hash = "sha256:c41759a97ccac751f69e48f12671c2c3e5e1ae3000d3ee5dfe750b31511d1576"}, + {file = "lz4-3.1.3-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:0acbc2b797fe3c51917011c8d7f6c99398ae33cc4a1ca23c3a246d60bbf56fc8"}, + {file = "lz4-3.1.3-cp37-cp37m-manylinux2010_i686.whl", hash = "sha256:c0a5f9b6962aaa4632e4385143a12f5b49ee8605a42589073e54c8f23ce111b2"}, + {file = "lz4-3.1.3-cp37-cp37m-manylinux2010_x86_64.whl", hash = "sha256:3c00b56fd9aef8d3f776653c92cec262d42b6ea144e9a41b58b8c22a85f90045"}, + {file = "lz4-3.1.3-cp37-cp37m-manylinux2014_aarch64.whl", hash = "sha256:4c3558f4b98adb7acee6f4b45edd848684daae6a92a5ff31f8071eb910779568"}, + {file = "lz4-3.1.3-cp37-cp37m-win32.whl", hash = "sha256:e3029738e64a0af1b04a32a39b32b0bba0e2088f61805e074c9a7e4bc212568f"}, + {file = "lz4-3.1.3-cp37-cp37m-win_amd64.whl", hash = "sha256:511c755d89048a2583ab88088fe451f7e3f15cde30560c058d80c9ac097dab21"}, + {file = "lz4-3.1.3-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:81b54fc66555fc7653467bf5b789d0e480ab88d17c858405e326d9c898baff2e"}, + {file = "lz4-3.1.3-cp38-cp38-manylinux1_i686.whl", hash = "sha256:57e5b0a818addacae254b9160a183122b6bc4737bc77c988b72e1c57bd22ed9e"}, + {file = "lz4-3.1.3-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:41a388a34eab3cca6180cdb179bd8fdfcf7fd1a569f0e9e6084ad0540a0d53a9"}, + {file = "lz4-3.1.3-cp38-cp38-manylinux2010_i686.whl", hash = "sha256:de2aac0cfda79c5a3eda9dbed21d78dc05c4a9ac00061748c3b57ea0e4a0b6a8"}, + {file = "lz4-3.1.3-cp38-cp38-manylinux2010_x86_64.whl", hash = "sha256:d6afa929d2c8afafd8b89e898498484b145a94cf3c140bb68094a94590ab2c2a"}, + {file = "lz4-3.1.3-cp38-cp38-manylinux2014_aarch64.whl", hash = "sha256:0a3b7eeb879577f2c7c0872156c70f4ddfbb023c1198e33d54422e24fa5494ae"}, + {file = "lz4-3.1.3-cp38-cp38-win32.whl", hash = "sha256:c25dffdb8ab9eb449aacf94ba45b3e6f573b38a1041be9370716cc68dea445a6"}, + {file = "lz4-3.1.3-cp38-cp38-win_amd64.whl", hash = "sha256:b4b56ae630a41980b6cf17a043b57691ff1f1677425b67556453fd96257b2a9b"}, + {file = "lz4-3.1.3-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:71f6f4dc48669ba3807a5cb5876048dc9b6467c3db312acf2040a61ea9487161"}, + {file = "lz4-3.1.3-cp39-cp39-manylinux1_i686.whl", hash = "sha256:408b2c1b65697d9bc6468c987977314acefc71573b996bd86190053ae7ffe8d1"}, + {file = "lz4-3.1.3-cp39-cp39-manylinux1_x86_64.whl", hash = "sha256:19d3b8dca0c18991ee243acf86932eb917f14e2e61dd34c7852a1088659d5499"}, + {file = "lz4-3.1.3-cp39-cp39-manylinux2010_i686.whl", hash = "sha256:d50c9584fb355d5d51414b802f7012578240bcb259550b48de628e19cd5bff6c"}, + {file = "lz4-3.1.3-cp39-cp39-manylinux2010_x86_64.whl", hash = "sha256:38266a6fa124e3ec2ce3ed6fd34f8e86b13c588f12b005873421afb295caee2d"}, + {file = "lz4-3.1.3-cp39-cp39-win32.whl", hash = "sha256:869734b6f0e8a19af10a75c769db179dcd3d867e29c29b3808ef884e76799071"}, + {file = "lz4-3.1.3-cp39-cp39-win_amd64.whl", hash = "sha256:37c23ca41040751649e0266f9f267c0148db12968a0a031272ee2a99cef7c753"}, + {file = "lz4-3.1.3.tar.gz", hash = "sha256:081ef0a3b5941cb03127f314229a1c78bd70c9c220bb3f4dd80033e707feaa18"}, +] more-itertools = [ {file = "more-itertools-8.8.0.tar.gz", hash = "sha256:83f0308e05477c68f56ea3a888172c78ed5d5b3c282addb67508e7ba6c8f813a"}, {file = "more_itertools-8.8.0-py3-none-any.whl", hash = "sha256:2cf89ec599962f2ddc4d568a05defc40e0a587fbc10d5989713638864c36be4d"}, @@ -485,6 +639,13 @@ pandas = [ {file = "pandas-1.3.0-cp39-cp39-win_amd64.whl", hash = "sha256:b10d7910ae9d7920a5ff7816d794d99acbc361f7b16a0f017d4fa83ced8cb55e"}, {file = "pandas-1.3.0.tar.gz", hash = "sha256:c554e6c9cf2d5ea1aba5979cc837b3649539ced0e18ece186f055450c86622e2"}, ] +patiencediff = [ + {file = "patiencediff-0.2.2-cp36-cp36m-manylinux2014_aarch64.whl", hash = "sha256:e15b894d1941ed773b6c5f7479985fc17ec81bab33f82e3b736ab1920c1804d6"}, + {file = "patiencediff-0.2.2-cp37-cp37m-manylinux2014_aarch64.whl", hash = "sha256:f196516e980f17302317f2f6f6a4c2897c6107c34c5268d9d37b820e98fd0deb"}, + {file = "patiencediff-0.2.2-cp38-cp38-manylinux2014_aarch64.whl", hash = "sha256:830be20a2e74972843362d7bc4b7a7929ff63205eade553d83256e51843b64d4"}, + {file = "patiencediff-0.2.2-cp39-cp39-manylinux2014_aarch64.whl", hash = "sha256:5fcc3f9dc12040ddfb8165317af3425c4d2be49b147def22a72a44d43fff5141"}, + {file = "patiencediff-0.2.2.tar.gz", hash = "sha256:456d9fc47fe43f9aea863059ea2c6df5b997285590e4b7f9ee8fbb6c3419b5a7"}, +] pluggy = [ {file = "pluggy-0.13.1-py2.py3-none-any.whl", hash = "sha256:966c145cd83c96502c3c3868f50408687b38434af77734af1e9ca461a4081d2d"}, {file = "pluggy-0.13.1.tar.gz", hash = "sha256:15b2acde666561e1298d71b523007ed7364de07029219b604cf808bfa1c765b0"}, @@ -629,6 +790,10 @@ typing-extensions = [ {file = "typing_extensions-3.10.0.0-py3-none-any.whl", hash = "sha256:779383f6086d90c99ae41cf0ff39aac8a7937a9283ce0a414e5dd782f4c94a84"}, {file = "typing_extensions-3.10.0.0.tar.gz", hash = "sha256:50b6f157849174217d0656f99dc82fe932884fb250826c18350e159ec6cdf342"}, ] +urllib3 = [ + {file = "urllib3-1.26.6-py2.py3-none-any.whl", hash = "sha256:39fb8672126159acb139a7718dd10806104dec1e2f0f6c88aab05d17df10c8d4"}, + {file = "urllib3-1.26.6.tar.gz", hash = "sha256:f57b4c16c62fa2760b7e3d97c35b255512fb6b59a259730f36ba32ce9f8e342f"}, +] wcwidth = [ {file = "wcwidth-0.2.5-py2.py3-none-any.whl", hash = "sha256:beb4802a9cebb9144e99086eff703a642a13d6a0052920003a230f3294bbe784"}, {file = "wcwidth-0.2.5.tar.gz", hash = "sha256:c4d647b99872929fdb7bdcaa4fbe7f01413ed3d98077df798530e5b04f116c83"}, diff --git a/pyproject.toml b/pyproject.toml index 7c4db8f2..163959d3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,6 +13,8 @@ PyYAML = "^5.4.1" yadism = "^0.7.0" pandas = "^1.3.0" lz4 = "^3.1.3" +breezy = "^3.2.1" +six = "^1.16.0" [tool.poetry.dev-dependencies] pytest = "^5.2" diff --git a/run/install.py b/run/install.py new file mode 100644 index 00000000..3998ca7d --- /dev/null +++ b/run/install.py @@ -0,0 +1,25 @@ +import os +import subprocess +import io + +from . import paths + + +paths.prefix.mkdir(exist_ok=True) + + +def install_mg5amc(): + mg5_repo = "lp:~maddevelopers/mg5amcnlo/3.2.0" + mg5_convert = """ +set auto_convert_model True +import model loop_qcd_qed_sm_Gmu +quit +""" + mg5_exe = paths.mg5amc / "bin" / "mg5_aMC" + + # download madgraph in prefix (if not present) + if not (mg5_exe.exists() and os.access(mg5_exe, os.X_OK)): + subprocess.run(f"brz branch {mg5_repo} {paths.mg5amc}".split()) + + # in case we're using python3, we need to convert the model file + subprocess.run(f"{mg5_exe}", input=mg5_convert, encoding="ascii") diff --git a/run/paths.py b/run/paths.py index eab2152d..235258ba 100644 --- a/run/paths.py +++ b/run/paths.py @@ -3,3 +3,5 @@ pkg = pathlib.Path(__file__).absolute().parent root = pkg.parent runcards = root / "nnpdf31_proc" +prefix = root / ".prefix" +mg5amc = prefix / "mg5amc" From f2dd115c71ecdd5db3d94633f0f2acc72f78e683 Mon Sep 17 00:00:00 2001 From: Alessandro Candido Date: Wed, 18 Aug 2021 18:14:56 +0200 Subject: [PATCH 12/63] Introduce mg5amc and pineappl installation --- poetry.lock | 167 ++++++++++++++++++++++++++++++++++++++++++++++++- pyproject.toml | 3 + run/install.py | 131 +++++++++++++++++++++++++++++++++++--- run/paths.py | 8 +++ run/tools.py | 22 +++++++ 5 files changed, 321 insertions(+), 10 deletions(-) diff --git a/poetry.lock b/poetry.lock index 7bcd37cb..9cc307f8 100644 --- a/poetry.lock +++ b/poetry.lock @@ -49,6 +49,28 @@ category = "main" optional = false python-versions = "*" +[[package]] +name = "cffi" +version = "1.14.6" +description = "Foreign Function Interface for Python calling C code." +category = "main" +optional = false +python-versions = "*" + +[package.dependencies] +pycparser = "*" + +[[package]] +name = "charset-normalizer" +version = "2.0.4" +description = "The Real First Universal Charset Detector. Open, modern and actively maintained alternative to Chardet." +category = "main" +optional = false +python-versions = ">=3.5.0" + +[package.extras] +unicode_backport = ["unicodedata2"] + [[package]] name = "click" version = "8.0.1" @@ -123,6 +145,14 @@ numpy = "*" pyyaml = "*" scipy = "*" +[[package]] +name = "idna" +version = "3.2" +description = "Internationalized Domain Names in Applications (IDNA)" +category = "main" +optional = false +python-versions = ">=3.5" + [[package]] name = "importlib-metadata" version = "4.6.1" @@ -224,6 +254,14 @@ category = "main" optional = false python-versions = "*" +[[package]] +name = "pkgconfig" +version = "1.5.5" +description = "Interface Python with pkg-config" +category = "main" +optional = false +python-versions = ">=3.3,<4.0" + [[package]] name = "pluggy" version = "0.13.1" @@ -258,6 +296,25 @@ category = "dev" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" +[[package]] +name = "pycparser" +version = "2.20" +description = "C parser in Python" +category = "main" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" + +[[package]] +name = "pygit2" +version = "1.6.1" +description = "Python bindings for libgit2." +category = "main" +optional = false +python-versions = "*" + +[package.dependencies] +cffi = ">=1.4.0" + [[package]] name = "pygments" version = "2.9.0" @@ -345,6 +402,24 @@ category = "main" optional = false python-versions = "*" +[[package]] +name = "requests" +version = "2.26.0" +description = "Python HTTP for Humans." +category = "main" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*" + +[package.dependencies] +certifi = ">=2017.4.17" +charset-normalizer = {version = ">=2.0.0,<2.1.0", markers = "python_version >= \"3\""} +idna = {version = ">=2.5,<4", markers = "python_version >= \"3\""} +urllib3 = ">=1.21.1,<1.27" + +[package.extras] +socks = ["PySocks (>=1.5.6,!=1.5.7)", "win-inet-pton"] +use_chardet_on_py3 = ["chardet (>=3.0.2,<5)"] + [[package]] name = "rich" version = "10.6.0" @@ -441,7 +516,7 @@ testing = ["pytest (>=4.6)", "pytest-checkdocs (>=2.4)", "pytest-flake8", "pytes [metadata] lock-version = "1.1" python-versions = ">=3.7.1,<3.10" -content-hash = "78c9689f561a55a13858c6933ef51e61316843e58f68c306914aafbc85d5a054" +content-hash = "2be298ddde6407aad138d2ba9f2dc9626a51ccef507b487a2ebef66a0cea684b" [metadata.files] atomicwrites = [ @@ -459,6 +534,57 @@ certifi = [ {file = "certifi-2021.5.30-py2.py3-none-any.whl", hash = "sha256:50b1e4f8446b06f41be7dd6338db18e0990601dce795c2b1686458aa7e8fa7d8"}, {file = "certifi-2021.5.30.tar.gz", hash = "sha256:2bbf76fd432960138b3ef6dda3dde0544f27cbf8546c458e60baf371917ba9ee"}, ] +cffi = [ + {file = "cffi-1.14.6-cp27-cp27m-macosx_10_9_x86_64.whl", hash = "sha256:22b9c3c320171c108e903d61a3723b51e37aaa8c81255b5e7ce102775bd01e2c"}, + {file = "cffi-1.14.6-cp27-cp27m-manylinux1_i686.whl", hash = "sha256:f0c5d1acbfca6ebdd6b1e3eded8d261affb6ddcf2186205518f1428b8569bb99"}, + {file = "cffi-1.14.6-cp27-cp27m-manylinux1_x86_64.whl", hash = "sha256:99f27fefe34c37ba9875f224a8f36e31d744d8083e00f520f133cab79ad5e819"}, + {file = "cffi-1.14.6-cp27-cp27m-win32.whl", hash = "sha256:55af55e32ae468e9946f741a5d51f9896da6b9bf0bbdd326843fec05c730eb20"}, + {file = "cffi-1.14.6-cp27-cp27m-win_amd64.whl", hash = "sha256:7bcac9a2b4fdbed2c16fa5681356d7121ecabf041f18d97ed5b8e0dd38a80224"}, + {file = "cffi-1.14.6-cp27-cp27mu-manylinux1_i686.whl", hash = "sha256:ed38b924ce794e505647f7c331b22a693bee1538fdf46b0222c4717b42f744e7"}, + {file = "cffi-1.14.6-cp27-cp27mu-manylinux1_x86_64.whl", hash = "sha256:e22dcb48709fc51a7b58a927391b23ab37eb3737a98ac4338e2448bef8559b33"}, + {file = "cffi-1.14.6-cp35-cp35m-macosx_10_9_x86_64.whl", hash = "sha256:aedb15f0a5a5949ecb129a82b72b19df97bbbca024081ed2ef88bd5c0a610534"}, + {file = "cffi-1.14.6-cp35-cp35m-manylinux1_i686.whl", hash = "sha256:48916e459c54c4a70e52745639f1db524542140433599e13911b2f329834276a"}, + {file = "cffi-1.14.6-cp35-cp35m-manylinux1_x86_64.whl", hash = "sha256:f627688813d0a4140153ff532537fbe4afea5a3dffce1f9deb7f91f848a832b5"}, + {file = "cffi-1.14.6-cp35-cp35m-win32.whl", hash = "sha256:f0010c6f9d1a4011e429109fda55a225921e3206e7f62a0c22a35344bfd13cca"}, + {file = "cffi-1.14.6-cp35-cp35m-win_amd64.whl", hash = "sha256:57e555a9feb4a8460415f1aac331a2dc833b1115284f7ded7278b54afc5bd218"}, + {file = "cffi-1.14.6-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:e8c6a99be100371dbb046880e7a282152aa5d6127ae01783e37662ef73850d8f"}, + {file = "cffi-1.14.6-cp36-cp36m-manylinux1_i686.whl", hash = "sha256:19ca0dbdeda3b2615421d54bef8985f72af6e0c47082a8d26122adac81a95872"}, + {file = "cffi-1.14.6-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:d950695ae4381ecd856bcaf2b1e866720e4ab9a1498cba61c602e56630ca7195"}, + {file = "cffi-1.14.6-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e9dc245e3ac69c92ee4c167fbdd7428ec1956d4e754223124991ef29eb57a09d"}, + {file = "cffi-1.14.6-cp36-cp36m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:a8661b2ce9694ca01c529bfa204dbb144b275a31685a075ce123f12331be790b"}, + {file = "cffi-1.14.6-cp36-cp36m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:b315d709717a99f4b27b59b021e6207c64620790ca3e0bde636a6c7f14618abb"}, + {file = "cffi-1.14.6-cp36-cp36m-win32.whl", hash = "sha256:80b06212075346b5546b0417b9f2bf467fea3bfe7352f781ffc05a8ab24ba14a"}, + {file = "cffi-1.14.6-cp36-cp36m-win_amd64.whl", hash = "sha256:a9da7010cec5a12193d1af9872a00888f396aba3dc79186604a09ea3ee7c029e"}, + {file = "cffi-1.14.6-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:4373612d59c404baeb7cbd788a18b2b2a8331abcc84c3ba40051fcd18b17a4d5"}, + {file = "cffi-1.14.6-cp37-cp37m-manylinux1_i686.whl", hash = "sha256:f10afb1004f102c7868ebfe91c28f4a712227fe4cb24974350ace1f90e1febbf"}, + {file = "cffi-1.14.6-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:fd4305f86f53dfd8cd3522269ed7fc34856a8ee3709a5e28b2836b2db9d4cd69"}, + {file = "cffi-1.14.6-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6d6169cb3c6c2ad50db5b868db6491a790300ade1ed5d1da29289d73bbe40b56"}, + {file = "cffi-1.14.6-cp37-cp37m-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:5d4b68e216fc65e9fe4f524c177b54964af043dde734807586cf5435af84045c"}, + {file = "cffi-1.14.6-cp37-cp37m-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:33791e8a2dc2953f28b8d8d300dde42dd929ac28f974c4b4c6272cb2955cb762"}, + {file = "cffi-1.14.6-cp37-cp37m-win32.whl", hash = "sha256:0c0591bee64e438883b0c92a7bed78f6290d40bf02e54c5bf0978eaf36061771"}, + {file = "cffi-1.14.6-cp37-cp37m-win_amd64.whl", hash = "sha256:8eb687582ed7cd8c4bdbff3df6c0da443eb89c3c72e6e5dcdd9c81729712791a"}, + {file = "cffi-1.14.6-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:ba6f2b3f452e150945d58f4badd92310449876c4c954836cfb1803bdd7b422f0"}, + {file = "cffi-1.14.6-cp38-cp38-manylinux1_i686.whl", hash = "sha256:64fda793737bc4037521d4899be780534b9aea552eb673b9833b01f945904c2e"}, + {file = "cffi-1.14.6-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:9f3e33c28cd39d1b655ed1ba7247133b6f7fc16fa16887b120c0c670e35ce346"}, + {file = "cffi-1.14.6-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:26bb2549b72708c833f5abe62b756176022a7b9a7f689b571e74c8478ead51dc"}, + {file = "cffi-1.14.6-cp38-cp38-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:eb687a11f0a7a1839719edd80f41e459cc5366857ecbed383ff376c4e3cc6afd"}, + {file = "cffi-1.14.6-cp38-cp38-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:d2ad4d668a5c0645d281dcd17aff2be3212bc109b33814bbb15c4939f44181cc"}, + {file = "cffi-1.14.6-cp38-cp38-win32.whl", hash = "sha256:487d63e1454627c8e47dd230025780e91869cfba4c753a74fda196a1f6ad6548"}, + {file = "cffi-1.14.6-cp38-cp38-win_amd64.whl", hash = "sha256:c33d18eb6e6bc36f09d793c0dc58b0211fccc6ae5149b808da4a62660678b156"}, + {file = "cffi-1.14.6-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:06c54a68935738d206570b20da5ef2b6b6d92b38ef3ec45c5422c0ebaf338d4d"}, + {file = "cffi-1.14.6-cp39-cp39-manylinux1_i686.whl", hash = "sha256:f174135f5609428cc6e1b9090f9268f5c8935fddb1b25ccb8255a2d50de6789e"}, + {file = "cffi-1.14.6-cp39-cp39-manylinux1_x86_64.whl", hash = "sha256:f3ebe6e73c319340830a9b2825d32eb6d8475c1dac020b4f0aa774ee3b898d1c"}, + {file = "cffi-1.14.6-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3c8d896becff2fa653dc4438b54a5a25a971d1f4110b32bd3068db3722c80202"}, + {file = "cffi-1.14.6-cp39-cp39-manylinux_2_17_ppc64le.manylinux2014_ppc64le.whl", hash = "sha256:4922cd707b25e623b902c86188aca466d3620892db76c0bdd7b99a3d5e61d35f"}, + {file = "cffi-1.14.6-cp39-cp39-manylinux_2_17_s390x.manylinux2014_s390x.whl", hash = "sha256:c9e005e9bd57bc987764c32a1bee4364c44fdc11a3cc20a40b93b444984f2b87"}, + {file = "cffi-1.14.6-cp39-cp39-win32.whl", hash = "sha256:eb9e2a346c5238a30a746893f23a9535e700f8192a68c07c0258e7ece6ff3728"}, + {file = "cffi-1.14.6-cp39-cp39-win_amd64.whl", hash = "sha256:818014c754cd3dba7229c0f5884396264d51ffb87ec86e927ef0be140bfdb0d2"}, + {file = "cffi-1.14.6.tar.gz", hash = "sha256:c9a875ce9d7fe32887784274dd533c57909b7b1dcadcc128a2ac21331a9765dd"}, +] +charset-normalizer = [ + {file = "charset-normalizer-2.0.4.tar.gz", hash = "sha256:f23667ebe1084be45f6ae0538e4a5a865206544097e4e8bbcacf42cd02a348f3"}, + {file = "charset_normalizer-2.0.4-py3-none-any.whl", hash = "sha256:0c8911edd15d19223366a194a513099a302055a962bca2cec0f54b8b63175d8b"}, +] click = [ {file = "click-8.0.1-py3-none-any.whl", hash = "sha256:fba402a4a47334742d782209a7c79bc448911afe1149d07bdabdf480b3e2f4b6"}, {file = "click-8.0.1.tar.gz", hash = "sha256:8c04c11192119b1ef78ea049e0a6f0463e4c48ef00a30160c704337586f3ad7a"}, @@ -497,6 +623,10 @@ eko = [ {file = "eko-0.6.0-py3-none-any.whl", hash = "sha256:bea01597305ea64012af5bbd2f8a93e9d1e9b9471d192a680023997e780f82a3"}, {file = "eko-0.6.0.tar.gz", hash = "sha256:3c6f921c152254fcd69ececc87ab94ab9daee9841b99bdd1d2837a9bb36460d8"}, ] +idna = [ + {file = "idna-3.2-py3-none-any.whl", hash = "sha256:14475042e284991034cb48e06f6851428fb14c4dc953acd9be9a5e95c7b6dd7a"}, + {file = "idna-3.2.tar.gz", hash = "sha256:467fbad99067910785144ce333826c71fb0e63a425657295239737f7ecd125f3"}, +] importlib-metadata = [ {file = "importlib_metadata-4.6.1-py3-none-any.whl", hash = "sha256:9f55f560e116f8643ecf2922d9cd3e1c7e8d52e683178fecd9d08f6aa357e11e"}, {file = "importlib_metadata-4.6.1.tar.gz", hash = "sha256:079ada16b7fc30dfbb5d13399a5113110dab1aa7c2bc62f66af75f0b717c8cac"}, @@ -646,6 +776,10 @@ patiencediff = [ {file = "patiencediff-0.2.2-cp39-cp39-manylinux2014_aarch64.whl", hash = "sha256:5fcc3f9dc12040ddfb8165317af3425c4d2be49b147def22a72a44d43fff5141"}, {file = "patiencediff-0.2.2.tar.gz", hash = "sha256:456d9fc47fe43f9aea863059ea2c6df5b997285590e4b7f9ee8fbb6c3419b5a7"}, ] +pkgconfig = [ + {file = "pkgconfig-1.5.5-py3-none-any.whl", hash = "sha256:d20023bbeb42ee6d428a0fac6e0904631f545985a10cdd71a20aa58bc47a4209"}, + {file = "pkgconfig-1.5.5.tar.gz", hash = "sha256:deb4163ef11f75b520d822d9505c1f462761b4309b1bb713d08689759ea8b899"}, +] pluggy = [ {file = "pluggy-0.13.1-py2.py3-none-any.whl", hash = "sha256:966c145cd83c96502c3c3868f50408687b38434af77734af1e9ca461a4081d2d"}, {file = "pluggy-0.13.1.tar.gz", hash = "sha256:15b2acde666561e1298d71b523007ed7364de07029219b604cf808bfa1c765b0"}, @@ -659,6 +793,33 @@ py = [ {file = "py-1.10.0-py2.py3-none-any.whl", hash = "sha256:3b80836aa6d1feeaa108e046da6423ab8f6ceda6468545ae8d02d9d58d18818a"}, {file = "py-1.10.0.tar.gz", hash = "sha256:21b81bda15b66ef5e1a777a21c4dcd9c20ad3efd0b3f817e7a809035269e1bd3"}, ] +pycparser = [ + {file = "pycparser-2.20-py2.py3-none-any.whl", hash = "sha256:7582ad22678f0fcd81102833f60ef8d0e57288b6b5fb00323d101be910e35705"}, + {file = "pycparser-2.20.tar.gz", hash = "sha256:2d475327684562c3a96cc71adf7dc8c4f0565175cf86b6d7a404ff4c771f15f0"}, +] +pygit2 = [ + {file = "pygit2-1.6.1-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:547429774c11f5bc9d20a49aa86e4bd13c90a55140504ef05f55cf424470ee34"}, + {file = "pygit2-1.6.1-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4e75865d7b6fc161d93b16f10365eaad353cd546e302a98f2de2097ddea1066b"}, + {file = "pygit2-1.6.1-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:be4a64b6090308ffd1c82e2dd4316cb79483715387b13818156d516134a5b17c"}, + {file = "pygit2-1.6.1-cp36-cp36m-win32.whl", hash = "sha256:2666a3970b2ea1222a9f0463b466f98c8d564f29ec84cf0a58d9b0d3865dbaaf"}, + {file = "pygit2-1.6.1-cp36-cp36m-win_amd64.whl", hash = "sha256:b2de12ca2d3b7eb86106223b40b2edc0c61103c71e7962e53092c6ddef71a194"}, + {file = "pygit2-1.6.1-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:9c1d96c66fb6e69ec710078a73c19edff420bc1db430caa9e03a825eede3f25c"}, + {file = "pygit2-1.6.1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:454d42550fa6a6cd0e6a6ad9ab3f3262135fd157f57bad245ce156c36ee93370"}, + {file = "pygit2-1.6.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ce0827b77dd2f8a3465bdc181c4e65f27dd12dbd92635c038e58030cc90c2de0"}, + {file = "pygit2-1.6.1-cp37-cp37m-win32.whl", hash = "sha256:b0161a141888d450eb821472fdcdadd14a072ddeda841fee9984956d34d3e19d"}, + {file = "pygit2-1.6.1-cp37-cp37m-win_amd64.whl", hash = "sha256:af2fa259b6f7899227611ab978c600695724e85965836cb607d8b1e70cfea9b3"}, + {file = "pygit2-1.6.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:0e1e02c28983ddc004c0f54063f3e46fca388225d468e32e16689cfb750e0bd6"}, + {file = "pygit2-1.6.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e5dadc4844feb76cde5cc9a37656326a361dd8b5c8e8f8674dcd4a5ecf395db3"}, + {file = "pygit2-1.6.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ef07458e4172a31318663295083b43f957d611145738ff56aa76db593542a6e8"}, + {file = "pygit2-1.6.1-cp38-cp38-win32.whl", hash = "sha256:7a0c0a1f11fd41f57e8c6c64d903cc7fa4ec95d15592270be3217ed7f78eb023"}, + {file = "pygit2-1.6.1-cp38-cp38-win_amd64.whl", hash = "sha256:2fd5c1b2d84dc6084f1bda836607afe37e95186a53a5a827a69083415e57fe4f"}, + {file = "pygit2-1.6.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:b9b88b7e9a5286a71be0b6c307f0523c9606aeedff6b61eb9c440e18817fa641"}, + {file = "pygit2-1.6.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:ac12d32b714c3383ebccffee5eb6aff0b69a2542a40a664fd5ad370afcb28ee7"}, + {file = "pygit2-1.6.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fe682ed6afd2ab31127f6a502cf3e002dc1cc8d26c36a5d49dfd180250351eb6"}, + {file = "pygit2-1.6.1-cp39-cp39-win32.whl", hash = "sha256:dbbf66a23860aa899949068ac9b503b4bc21e6063e8f53870440adbdc909405e"}, + {file = "pygit2-1.6.1-cp39-cp39-win_amd64.whl", hash = "sha256:f90775afb11f69376e2af21ab56fcfbb52f6bc84117059ddf0355f81e5e36352"}, + {file = "pygit2-1.6.1.tar.gz", hash = "sha256:c3303776f774d3e0115c1c4f6e1fc35470d15f113a7ae9401a0b90acfa1661ac"}, +] pygments = [ {file = "Pygments-2.9.0-py3-none-any.whl", hash = "sha256:d66e804411278594d764fc69ec36ec13d9ae9147193a1740cd34d272ca383b8e"}, {file = "Pygments-2.9.0.tar.gz", hash = "sha256:a18f47b506a429f6f4b9df81bb02beab9ca21d0a5fee38ed15aef65f0545519f"}, @@ -756,6 +917,10 @@ regex = [ {file = "regex-2021.7.6-cp39-cp39-win_amd64.whl", hash = "sha256:4c9c3155fe74269f61e27617529b7f09552fbb12e44b1189cebbdb24294e6e1c"}, {file = "regex-2021.7.6.tar.gz", hash = "sha256:8394e266005f2d8c6f0bc6780001f7afa3ef81a7a2111fa35058ded6fce79e4d"}, ] +requests = [ + {file = "requests-2.26.0-py2.py3-none-any.whl", hash = "sha256:6c1246513ecd5ecd4528a0906f910e8f0f9c6b8ec72030dc9fd154dc1a6efd24"}, + {file = "requests-2.26.0.tar.gz", hash = "sha256:b8aa58f8cf793ffd8782d3d8cb19e66ef36f7aba4353eec859e74678b01b07a7"}, +] rich = [ {file = "rich-10.6.0-py3-none-any.whl", hash = "sha256:d3f72827cd5df13b2ef7f1a97f81ec65548d4fdeb92cef653234f227580bbb2a"}, {file = "rich-10.6.0.tar.gz", hash = "sha256:128261b3e2419a4ef9c97066ccc2abbfb49fa7c5e89c3fe4056d00aa5e9c1e65"}, diff --git a/pyproject.toml b/pyproject.toml index 163959d3..94b71ed1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -15,6 +15,9 @@ pandas = "^1.3.0" lz4 = "^3.1.3" breezy = "^3.2.1" six = "^1.16.0" +pkgconfig = "^1.5.5" +pygit2 = "^1.6.1" +requests = "^2.26.0" [tool.poetry.dev-dependencies] pytest = "^5.2" diff --git a/run/install.py b/run/install.py index 3998ca7d..1def6eff 100644 --- a/run/install.py +++ b/run/install.py @@ -1,25 +1,138 @@ +import sys import os import subprocess -import io +import shutil -from . import paths +import pkgconfig +import pygit2 +import requests +import PyInquirer +from . import paths, tools -paths.prefix.mkdir(exist_ok=True) +paths.prefix.mkdir(exist_ok=True) -def install_mg5amc(): - mg5_repo = "lp:~maddevelopers/mg5amcnlo/3.2.0" - mg5_convert = """ +mg5_repo = "lp:~maddevelopers/mg5amcnlo/3.2.0" +mg5_convert = """ set auto_convert_model True import model loop_qcd_qed_sm_Gmu quit """ - mg5_exe = paths.mg5amc / "bin" / "mg5_aMC" +mg5_exe = paths.mg5amc / "bin" / "mg5_aMC" + +pineappl_repo = "https://github.com/N3PDF/pineappl.git" + + +def confirm(name): + print(f"{name} not found") + questions = [ + { + "type": "confirm", + "name": "install", + "message": "Do you want to install it?", + } + ] + answers = PyInquirer.prompt(questions) + + return answers["install"] + + +def mg5amc(): + # define availability condition + condition = lambda: mg5_exe.exists() and os.access(mg5_exe, os.X_OK) + + if condition(): + print("Found mg5amc") + return True + if not confirm("mg5amc"): + return False + + print("Installing...") # download madgraph in prefix (if not present) - if not (mg5_exe.exists() and os.access(mg5_exe, os.X_OK)): - subprocess.run(f"brz branch {mg5_repo} {paths.mg5amc}".split()) + subprocess.run(f"brz branch {mg5_repo} {paths.mg5amc}".split()) # in case we're using python3, we need to convert the model file subprocess.run(f"{mg5_exe}", input=mg5_convert, encoding="ascii") + + # retest availability + return condition() + + +def cargo(): + # look for existing cargo + cargo_exe = shutil.which("cargo") + + # found, exit + if cargo_exe is not None: + return cargo_exe + + # if there is not a user cargo update environment + os.environ["CARGO_HOME"] = str(paths.cargo) + if paths.cargo.is_dir(): + return str(paths.cargo / "bin" / "cargo") + + # if cargo not available let's install + with requests.get("https://sh.rustup.rs") as r: + with open(paths.rust_init, "wb") as f: + f.write(r.content) + # install location is controlled by CARGO_HOME variable + subprocess.run( + f"bash {paths.rust_init} --profile minimal --no-modify-path -y".split() + ) + + return str(paths.cargo / "bin" / "cargo") + + +def pineappl(): + # define availability condition + condition = lambda: shutil.which("pineappl") is not None and pkgconfig.exists( + "pineappl_capi" + ) + + if condition(): + print("Found pineappl") + return True + if not confirm("pineappl"): + return False + + print("Installing...") + + try: + repo = pygit2.Repository(paths.pineappl) + tools.git_pull(repo) + except pygit2.GitError: + repo = pygit2.clone_repository(pineappl_repo, paths.pineappl) + + cargo_exe = cargo() + subprocess.run(f"{cargo_exe} install --force cargo-c".split()) + + subprocess.run( + f'{cargo_exe} cinstall --release --prefix "{paths.prefix}" --manifest-path=pineappl_capi/Cargo.toml'.split(), + cwd=paths.pineappl, + ) + subprocess.run( + f'{cargo_exe} install --path pineappl_cli --root "{paths.prefix}"', + cwd=paths.pineappl, + ) + + # retest availability + return condition() + + +def update_environ(): + def prepend(name, value): + os.environ[name] = str(value) + os.pathsep + os.environ[name] + + pyver = ".".join(sys.version.split(".")[:2]) + prepend("PYTHONPATH", paths.prefix / "lib" / f"python{pyver}" / "site-packages") + prepend("PATH", paths.prefix / "bin") + prepend("LD_LIBRARY_PATH", paths.prefix / "lib") + prepend("PKG_CONFIG_PATH", paths.prefix / "lib" / "pkgconfig") + + +def all(): + update_environ() + mg5amc() + pineappl() diff --git a/run/paths.py b/run/paths.py index 235258ba..331dd0fb 100644 --- a/run/paths.py +++ b/run/paths.py @@ -2,6 +2,14 @@ pkg = pathlib.Path(__file__).absolute().parent root = pkg.parent + runcards = root / "nnpdf31_proc" + +# prefix and locally installed prefix = root / ".prefix" mg5amc = prefix / "mg5amc" +pineappl = prefix / "pineappl" +cargo = prefix / "cargo" + +# tmp +rust_init = pathlib.Path("/tmp/rustup-init") diff --git a/run/tools.py b/run/tools.py index 2b5511db..3753c542 100644 --- a/run/tools.py +++ b/run/tools.py @@ -4,6 +4,7 @@ import rich import lz4.frame +import pygit2 from . import paths @@ -92,3 +93,24 @@ def decompress(path): three_points = [0.5, 1.0, 2.0] nine_points = itertools.product(three_points, three_points) + + +def git_pull(repo, remote_name="origin", branch="master"): + for remote in repo.remotes: + if remote.name == remote_name: + remote.fetch() + remote_master_id = repo.lookup_reference( + f"refs/remotes/{remote_name}/{branch}" + ).target + merge_result, _ = repo.merge_analysis(remote_master_id) + # Up to date, do nothing + if merge_result & pygit2.GIT_MERGE_ANALYSIS_UP_TO_DATE: + return + # We can just fastforward + elif merge_result & pygit2.GIT_MERGE_ANALYSIS_FASTFORWARD: + repo.checkout_tree(repo.get(remote_master_id)) + master_ref = repo.lookup_reference(f"refs/heads/{branch}") + master_ref.set_target(remote_master_id) + repo.head.set_target(remote_master_id) + else: + raise AssertionError(f"Impossible to pull git repo '{repo.path}'") From c7b2540c79f4c7992b4776f0cea6a08fa4b2ebf1 Mon Sep 17 00:00:00 2001 From: Alessandro Candido Date: Fri, 20 Aug 2021 12:46:27 +0200 Subject: [PATCH 13/63] Fix pineappl installation --- .gitignore | 3 +++ run/install.py | 12 +++++++++--- run/paths.py | 2 ++ 3 files changed, 14 insertions(+), 3 deletions(-) diff --git a/.gitignore b/.gitignore index 99a9bcf6..47cf8ba4 100644 --- a/.gitignore +++ b/.gitignore @@ -147,3 +147,6 @@ Thumbs.db #thumbnail cache on Windows # profiling data .prof + +# editor +.vim diff --git a/run/install.py b/run/install.py index 1def6eff..1ec2ba8d 100644 --- a/run/install.py +++ b/run/install.py @@ -12,6 +12,8 @@ paths.prefix.mkdir(exist_ok=True) +paths.bin.mkdir(exist_ok=True) +paths.lib.mkdir(exist_ok=True) mg5_repo = "lp:~maddevelopers/mg5amcnlo/3.2.0" mg5_convert = """ @@ -106,14 +108,18 @@ def pineappl(): repo = pygit2.clone_repository(pineappl_repo, paths.pineappl) cargo_exe = cargo() - subprocess.run(f"{cargo_exe} install --force cargo-c".split()) + subprocess.run([cargo_exe] + "install --force cargo-c".split()) subprocess.run( - f'{cargo_exe} cinstall --release --prefix "{paths.prefix}" --manifest-path=pineappl_capi/Cargo.toml'.split(), + [cargo_exe] + + "cinstall --release --prefix".split() + + [str(paths.prefix), "--manifest-path=pineappl_capi/Cargo.toml"], cwd=paths.pineappl, ) subprocess.run( - f'{cargo_exe} install --path pineappl_cli --root "{paths.prefix}"', + [cargo_exe] + + "install --path pineappl_cli --root".split() + + [str(paths.prefix)], cwd=paths.pineappl, ) diff --git a/run/paths.py b/run/paths.py index 331dd0fb..b14e98cd 100644 --- a/run/paths.py +++ b/run/paths.py @@ -7,6 +7,8 @@ # prefix and locally installed prefix = root / ".prefix" +bin = prefix / "bin" +lib = prefix / "lib" mg5amc = prefix / "mg5amc" pineappl = prefix / "pineappl" cargo = prefix / "cargo" From c6d180d1216137c6c2022451c18385e6fb454f70 Mon Sep 17 00:00:00 2001 From: Alessandro Candido Date: Fri, 20 Aug 2021 14:12:19 +0200 Subject: [PATCH 14/63] Add check on recompute dataset --- run/dis_.py | 62 ++++++++++--------------------------------------- run/external.py | 46 ++++++++++++++++++++++++++++++++++++ run/hadronic.py | 25 +++++++++++++++----- run/install.py | 10 ++------ run/tools.py | 19 +++++++++++++++ 5 files changed, 98 insertions(+), 64 deletions(-) create mode 100644 run/external.py diff --git a/run/dis_.py b/run/dis_.py index dc2ec080..0f11f0ac 100644 --- a/run/dis_.py +++ b/run/dis_.py @@ -2,12 +2,8 @@ import rich import yaml import yadism -import lhapdf -from functools import reduce -import pandas as pd - -from . import tools, paths, table +from . import install, tools, paths, table, external @click.command() @@ -16,10 +12,14 @@ def dis(datasets, pdf): rich.print("Computing [red]dis[/]...") if len(datasets) == 0: - datasets = select_datasets() + datasets = tools.select_datasets([p.stem for p in load_datasets()]) rich.print(datasets) + + install_reqs() for name in datasets: + if tools.avoid_recompute(name): + continue run_dataset(name, pdf) @@ -30,49 +30,9 @@ def load_datasets(): return dis_sets -def select_datasets(): - datasets = [p.stem for p in load_datasets()] - return tools.select_datasets(datasets) - - -def yadism_results(out, pdf_name): - pdf = lhapdf.mkPDF(pdf_name) - pdf_out = out.apply_pdf_alphas_alphaqed_xir_xif( - pdf, - lambda muR: lhapdf.mkAlphaS(pdf_name).alphasQ(muR), - lambda _muR: 0, - 1.0, - 1.0, - ) - pdf_out = next(iter(pdf_out.tables.values())) - - sv_pdf_out = [] - for xiR, xiF in tools.nine_points: - sv_point = out.apply_pdf_alphas_alphaqed_xir_xif( - pdf, - lambda muR: lhapdf.mkAlphaS(pdf_name).alphasQ(muR), - lambda _muR: 0.0, - xiR, - xiF, - ) - df = ( - next(iter(sv_point.tables.values())) - .rename({"result": (xiR, xiF)}, axis=1) - .drop("error", axis=1) - ) - sv_pdf_out.append(df) - - sv_pdf_merged = reduce( - lambda left, right: pd.merge(left, right, on=["x", "Q2"], how="outer"), - sv_pdf_out, - ) - svdf = sv_pdf_merged[ - list(filter(lambda name: isinstance(name, tuple), sv_pdf_merged.columns)) - ] - pdf_out["sv_max"] = svdf.max(axis=1) - pdf_out["sv_min"] = svdf.min(axis=1) - - return pdf_out +def install_reqs(): + install.update_environ() + install.pineappl() def run_dataset(name, pdf): @@ -95,4 +55,6 @@ def run_dataset(name, pdf): grid_path.unlink() grid_path = cpath - table.print_table(table.compute_data(grid_path, pdf), yadism_results(out, pdf)) + table.print_table( + table.compute_data(grid_path, pdf), external.yadism_results(out, pdf) + ) diff --git a/run/external.py b/run/external.py new file mode 100644 index 00000000..81dbca59 --- /dev/null +++ b/run/external.py @@ -0,0 +1,46 @@ +from functools import reduce + +import lhapdf +import pandas as pd + +from . import tools + + +def yadism_results(out, pdf_name): + pdf = lhapdf.mkPDF(pdf_name) + pdf_out = out.apply_pdf_alphas_alphaqed_xir_xif( + pdf, + lambda muR: lhapdf.mkAlphaS(pdf_name).alphasQ(muR), + lambda _muR: 0, + 1.0, + 1.0, + ) + pdf_out = next(iter(pdf_out.tables.values())) + + sv_pdf_out = [] + for xiR, xiF in tools.nine_points: + sv_point = out.apply_pdf_alphas_alphaqed_xir_xif( + pdf, + lambda muR: lhapdf.mkAlphaS(pdf_name).alphasQ(muR), + lambda _muR: 0.0, + xiR, + xiF, + ) + df = ( + next(iter(sv_point.tables.values())) + .rename({"result": (xiR, xiF)}, axis=1) + .drop("error", axis=1) + ) + sv_pdf_out.append(df) + + sv_pdf_merged = reduce( + lambda left, right: pd.merge(left, right, on=["x", "Q2"], how="outer"), + sv_pdf_out, + ) + svdf = sv_pdf_merged[ + list(filter(lambda name: isinstance(name, tuple), sv_pdf_merged.columns)) + ] + pdf_out["sv_max"] = svdf.max(axis=1) + pdf_out["sv_min"] = svdf.min(axis=1) + + return pdf_out diff --git a/run/hadronic.py b/run/hadronic.py index cab02e66..8d5d6d64 100644 --- a/run/hadronic.py +++ b/run/hadronic.py @@ -3,15 +3,23 @@ import click import rich -from . import tools +from . import install, tools root = pathlib.Path(__file__).absolute().parents[1] @click.command() -def hadronic(): +@click.option("--datasets", multiple=True) +@click.option("--pdf", default="NNPDF31_nlo_as_0118_luxqed") +def hadronic(datasets, pdf): rich.print("Computing [blue]hadronic[/]...") - rich.print(select_datasets()) + if len(datasets) == 0: + datasets = tools.select_datasets([p.stem for p in load_datasets()]) + + rich.print(datasets) + install_reqs() + for name in datasets: + run_dataset(name, pdf) def load_datasets(): @@ -20,6 +28,11 @@ def load_datasets(): return hadronic_sets -def select_datasets(): - datasets = [p.stem for p in load_datasets()] - return tools.select_datasets(datasets) +def install_reqs(): + install.update_environ() + install.mg5amc() + install.pineappl() + + +def run_dataset(name, pdf): + pass diff --git a/run/install.py b/run/install.py index 1ec2ba8d..bdd3ce6b 100644 --- a/run/install.py +++ b/run/install.py @@ -45,7 +45,7 @@ def mg5amc(): condition = lambda: mg5_exe.exists() and os.access(mg5_exe, os.X_OK) if condition(): - print("Found mg5amc") + print("✓ Found mg5amc") return True if not confirm("mg5amc"): return False @@ -94,7 +94,7 @@ def pineappl(): ) if condition(): - print("Found pineappl") + print("✓ Found pineappl") return True if not confirm("pineappl"): return False @@ -136,9 +136,3 @@ def prepend(name, value): prepend("PATH", paths.prefix / "bin") prepend("LD_LIBRARY_PATH", paths.prefix / "lib") prepend("PKG_CONFIG_PATH", paths.prefix / "lib" / "pkgconfig") - - -def all(): - update_environ() - mg5amc() - pineappl() diff --git a/run/tools.py b/run/tools.py index 3753c542..c531252a 100644 --- a/run/tools.py +++ b/run/tools.py @@ -5,6 +5,7 @@ import rich import lz4.frame import pygit2 +import PyInquirer from . import paths @@ -61,6 +62,24 @@ def select_datasets(datasets_list): return ans.split() +def avoid_recompute(name): + for p in paths.root.iterdir(): + if p.is_dir() and name in p.name: + rich.print( + f"[i grey50]dataset already in '[/][yellow]{p.name}[i grey50]'[/]" + ) + questions = [ + { + "type": "confirm", + "name": "recompute", + "message": f"Do you want to recompute '{name}'?\n", + } + ] + answers = PyInquirer.prompt(questions) + return not answers["recompute"] + return False + + def create_folder(name): target = paths.root / (name + datetime.datetime.now().strftime("-%Y%m%d%H%M%S")) target.mkdir(exist_ok=True) From 6f224fbbfefc827f5418bcd2727a3ce49c5b0269 Mon Sep 17 00:00:00 2001 From: Alessandro Candido Date: Fri, 20 Aug 2021 17:52:25 +0200 Subject: [PATCH 15/63] Implement output_and_launch --- poetry.lock | 13 +++++++- pyproject.toml | 1 + run/dis_.py | 14 ++++++++- run/hadronic.py | 75 ++++++++++++++++++++++++++++++++++++++++++++-- run/install.py | 5 ++-- run/paths.py | 1 + run/tools.py | 35 ++++++++++++++++++++-- run/variables.json | 11 +++++++ 8 files changed, 146 insertions(+), 9 deletions(-) create mode 100644 run/variables.json diff --git a/poetry.lock b/poetry.lock index 9cc307f8..8352d51a 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,3 +1,11 @@ +[[package]] +name = "asteval" +version = "0.9.25" +description = "Safe, minimalistic evaluator of python expression using ast module" +category = "main" +optional = false +python-versions = ">=3.6" + [[package]] name = "atomicwrites" version = "1.4.0" @@ -516,9 +524,12 @@ testing = ["pytest (>=4.6)", "pytest-checkdocs (>=2.4)", "pytest-flake8", "pytes [metadata] lock-version = "1.1" python-versions = ">=3.7.1,<3.10" -content-hash = "2be298ddde6407aad138d2ba9f2dc9626a51ccef507b487a2ebef66a0cea684b" +content-hash = "eb9d108771adfcfbb422464bfd00542edbee0534b6d325e432d266cc428e3181" [metadata.files] +asteval = [ + {file = "asteval-0.9.25.tar.gz", hash = "sha256:bea22b7d8fa16bcba95ebc72052ae5d8ca97114c9959bb47f8b8eebf30e4342f"}, +] atomicwrites = [ {file = "atomicwrites-1.4.0-py2.py3-none-any.whl", hash = "sha256:6d1784dea7c0c8d4a5172b6c620f40b6e4cbfdf96d783691f2e1302a7b88e197"}, {file = "atomicwrites-1.4.0.tar.gz", hash = "sha256:ae70396ad1a434f9c7046fd2dd196fc04b12f9e91ffb859164193be8b6168a7a"}, diff --git a/pyproject.toml b/pyproject.toml index 94b71ed1..10ca1737 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -18,6 +18,7 @@ six = "^1.16.0" pkgconfig = "^1.5.5" pygit2 = "^1.6.1" requests = "^2.26.0" +asteval = "^0.9.25" [tool.poetry.dev-dependencies] pytest = "^5.2" diff --git a/run/dis_.py b/run/dis_.py index 0f11f0ac..6a39a478 100644 --- a/run/dis_.py +++ b/run/dis_.py @@ -1,3 +1,5 @@ +import time + import click import rich import yaml @@ -17,6 +19,7 @@ def dis(datasets, pdf): rich.print(datasets) install_reqs() + for name in datasets: if tools.avoid_recompute(name): continue @@ -31,11 +34,17 @@ def load_datasets(): def install_reqs(): + t0 = time.perf_counter() + install.update_environ() install.pineappl() + tools.print_time(t0, "Installation") + def run_dataset(name, pdf): + t0 = time.perf_counter() + # load runcards with open(paths.pkg / "theory.yaml") as t: theory = yaml.safe_load(t) @@ -46,7 +55,8 @@ def run_dataset(name, pdf): out = yadism.run_yadism(theory, obs) # dump pineappl - grid_path = tools.create_folder(name) + dest = tools.create_folder(name) + grid_path = dest / f"{name}.pineappl" out.dump_pineappl_to_file(str(grid_path), next(iter(obs["observables"].keys()))) # compress @@ -58,3 +68,5 @@ def run_dataset(name, pdf): table.print_table( table.compute_data(grid_path, pdf), external.yadism_results(out, pdf) ) + + tools.print_time(t0, "Grid calculation") diff --git a/run/hadronic.py b/run/hadronic.py index 8d5d6d64..6ba3b00a 100644 --- a/run/hadronic.py +++ b/run/hadronic.py @@ -1,9 +1,14 @@ +import time import pathlib +import subprocess +import json +import re import click import rich +import asteval -from . import install, tools +from . import install, paths, tools root = pathlib.Path(__file__).absolute().parents[1] @@ -29,10 +34,76 @@ def load_datasets(): def install_reqs(): + t0 = time.perf_counter() + install.update_environ() install.mg5amc() install.pineappl() + tools.print_time(t0, "Installation") + def run_dataset(name, pdf): - pass + t0 = time.perf_counter() + + source = paths.runcards / name + dest = tools.create_folder(name) + mg5_dir = dest / name + + # copy the output file to the directory and replace the variables + output = (source / "output.txt").read_text().replace("@OUTPUT@", name) + output_file = dest / "output.txt" + output_file.write_text(output) + + # create output folder + output_log = tools.run_subprocess([str(paths.mg5_exe), str(output_file)], dest=dest) + (dest / "output.log").write_text(output_log) + + # copy patches if there are any; use xargs to properly signal failures + for p in source.iterdir(): + if p.suffix == ".patch": + subprocess.run( + "patch -p1".split(), input=p.read_text(), text=True, cwd=mg5_dir + ) + + # enforce proper analysis + # - copy analysis.f + analysis = (paths.runcards / name / "analysis.f").read_text() + (mg5_dir / "FixedOrderAnalysis" / f"{name}.f").write_text(analysis) + # - update analysis card + analysis_card = mg5_dir / "Cards" / "FO_analyse_card.dat" + analysis_card.write_text( + analysis_card.read_text().replace("analysis_HwU_template", name) + ) + + # copy the launch file to the directory and replace the variables + launch = (source / "launch.txt").read_text().replace("@OUTPUT@", name) + launch_file = dest / "launch.txt" + + # TODO: write a list with variables that should be replaced in the launch file; for the time + # being we create the file here, but in the future it should be read from the theory database + variables = json.loads((paths.pkg / "variables.json").read_text()) + + # replace the variables with their values + for name, value in variables.items(): + launch = launch.replace(f"@{name}@", value) + + # perform simple arithmetic on lines containing 'set' and '=' and arithmetic operators + interpreter = asteval.Interpreter() # use asteval for safety + lines = [] + pattern = re.compile(r"(set [\w_]* = )(.*)") + for line in launch.splitlines(): + m = re.fullmatch(pattern, line) + if m is not None: + line = m[1] + str(interpreter.eval(m[2])) + lines.append(line) + launch = "\n".join(lines) + + # finally write launch + launch_file.write_text(launch) + + # launch run + launch_log = tools.run_subprocess([str(paths.mg5_exe), str(launch_file)], dest=dest) + (dest / "launch.log").write_text(launch_log) + + tools.print_time(t0, "Grid calculation") diff --git a/run/install.py b/run/install.py index bdd3ce6b..e069ca68 100644 --- a/run/install.py +++ b/run/install.py @@ -21,7 +21,6 @@ import model loop_qcd_qed_sm_Gmu quit """ -mg5_exe = paths.mg5amc / "bin" / "mg5_aMC" pineappl_repo = "https://github.com/N3PDF/pineappl.git" @@ -42,7 +41,7 @@ def confirm(name): def mg5amc(): # define availability condition - condition = lambda: mg5_exe.exists() and os.access(mg5_exe, os.X_OK) + condition = lambda: paths.mg5_exe.exists() and os.access(paths.mg5_exe, os.X_OK) if condition(): print("✓ Found mg5amc") @@ -56,7 +55,7 @@ def mg5amc(): subprocess.run(f"brz branch {mg5_repo} {paths.mg5amc}".split()) # in case we're using python3, we need to convert the model file - subprocess.run(f"{mg5_exe}", input=mg5_convert, encoding="ascii") + subprocess.run(f"{paths.mg5_exe}", input=mg5_convert, encoding="ascii") # retest availability return condition() diff --git a/run/paths.py b/run/paths.py index b14e98cd..41c0e4ac 100644 --- a/run/paths.py +++ b/run/paths.py @@ -10,6 +10,7 @@ bin = prefix / "bin" lib = prefix / "lib" mg5amc = prefix / "mg5amc" +mg5_exe = mg5amc / "bin" / "mg5_aMC" pineappl = prefix / "pineappl" cargo = prefix / "cargo" diff --git a/run/tools.py b/run/tools.py index c531252a..84b67ed1 100644 --- a/run/tools.py +++ b/run/tools.py @@ -1,6 +1,7 @@ -import datetime +import time, datetime import itertools from difflib import SequenceMatcher +import subprocess import rich import lz4.frame @@ -83,7 +84,19 @@ def avoid_recompute(name): def create_folder(name): target = paths.root / (name + datetime.datetime.now().strftime("-%Y%m%d%H%M%S")) target.mkdir(exist_ok=True) - return target / f"{name}.pineappl" + return target + + +def print_time(t0, what=None): + dt = time.perf_counter() - t0 + + if what is None: + what = "" + + print() + rich.print(f"[b u]{what}[/] [i green]completed[/]") + rich.print(f"> took {dt:.2f} s") + print() def compress(path): @@ -133,3 +146,21 @@ def git_pull(repo, remote_name="origin", branch="master"): repo.head.set_target(remote_master_id) else: raise AssertionError(f"Impossible to pull git repo '{repo.path}'") + + +def run_subprocess(*args, dest): + p = subprocess.Popen( + *args, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, cwd=dest + ) + output = [] + + while True: + # returns None while subprocess is running + retcode = p.poll() + line = p.stdout.readline().decode()[:-1] + if retcode is not None: + break + print(line) + output.append(line) + + return "\n".join(output) diff --git a/run/variables.json b/run/variables.json new file mode 100644 index 00000000..20f2c34f --- /dev/null +++ b/run/variables.json @@ -0,0 +1,11 @@ +{ + "GF": "1.1663787e-5", + "MH": "125.0", + "MT": "172.5", + "MW": "80.352", + "MZ": "91.1535", + "WH": "4.07468e-3", + "WT": "1.37758", + "WW": "2.084", + "WZ": "2.4943" +} From d032d4b7d630d77e6cd3574c25a117b438bb93d0 Mon Sep 17 00:00:00 2001 From: Alessandro Candido Date: Tue, 24 Aug 2021 18:23:01 +0200 Subject: [PATCH 16/63] Add fortran cut templates --- poetry.lock | 13 +- pyproject.toml | 1 - run/cuts.yaml | 715 ++++++++++++++++++++++++++++++++++++++++++++++++ run/hadronic.py | 18 +- 4 files changed, 725 insertions(+), 22 deletions(-) create mode 100644 run/cuts.yaml diff --git a/poetry.lock b/poetry.lock index 8352d51a..9cc307f8 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,11 +1,3 @@ -[[package]] -name = "asteval" -version = "0.9.25" -description = "Safe, minimalistic evaluator of python expression using ast module" -category = "main" -optional = false -python-versions = ">=3.6" - [[package]] name = "atomicwrites" version = "1.4.0" @@ -524,12 +516,9 @@ testing = ["pytest (>=4.6)", "pytest-checkdocs (>=2.4)", "pytest-flake8", "pytes [metadata] lock-version = "1.1" python-versions = ">=3.7.1,<3.10" -content-hash = "eb9d108771adfcfbb422464bfd00542edbee0534b6d325e432d266cc428e3181" +content-hash = "2be298ddde6407aad138d2ba9f2dc9626a51ccef507b487a2ebef66a0cea684b" [metadata.files] -asteval = [ - {file = "asteval-0.9.25.tar.gz", hash = "sha256:bea22b7d8fa16bcba95ebc72052ae5d8ca97114c9959bb47f8b8eebf30e4342f"}, -] atomicwrites = [ {file = "atomicwrites-1.4.0-py2.py3-none-any.whl", hash = "sha256:6d1784dea7c0c8d4a5172b6c620f40b6e4cbfdf96d783691f2e1302a7b88e197"}, {file = "atomicwrites-1.4.0.tar.gz", hash = "sha256:ae70396ad1a434f9c7046fd2dd196fc04b12f9e91ffb859164193be8b6168a7a"}, diff --git a/pyproject.toml b/pyproject.toml index 10ca1737..94b71ed1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -18,7 +18,6 @@ six = "^1.16.0" pkgconfig = "^1.5.5" pygit2 = "^1.6.1" requests = "^2.26.0" -asteval = "^0.9.25" [tool.poetry.dev-dependencies] pytest = "^5.2" diff --git a/run/cuts.yaml b/run/cuts.yaml new file mode 100644 index 00000000..1916a49e --- /dev/null +++ b/run/cuts.yaml @@ -0,0 +1,715 @@ +"cuts_code": + "abscoscsmax": |+ + c cut on the maximum of the absolute value of the cosine of the Collins-Soper angle of SFOS pairs + do i=1,nexternal-1 + if (is_a_lm(i) .or. is_a_lp(i)) then + do j=i+1,nexternal + if (ipdg_reco(i) .eq. -ipdg_reco(j)) then + if (is_a_lm(i)) then + zlep=i + zalep=j + else + zlep=j + zalep=i + endif + zenl=p_reco(0,zlep) + zptxl=p_reco(1,zlep) + zptyl=p_reco(2,zlep) + zpzl=p_reco(3,zlep) + zenal=p_reco(0,zalep) + zptxal=p_reco(1,zalep) + zptyal=p_reco(2,zalep) + zpzal=p_reco(3,zalep) + c implementation of first formula on page 6 of https://arxiv.org/abs/1710.05167 + zp1p=zenl+zpzl + zp1m=zenl-zpzl + zp2p=zenal+zpzal + zp2m=zenal-zpzal + zpzll=zpzl+zpzal + zpt2ll=(zptxl+zptxal)*(zptxl+zptxal)+ + & (zptyl+zptyal)*(zptyl+zptyal) + zmll=sqrt((zenl+zenal)*(zenl+zenal)-(zpt2ll+zpzll*zpzll)) + zcoscs=sign((zp1p*zp2m-zp1m*zp2p)/ + & sqrt(zmll*zmll+zpt2ll)/zmll,zpzll) + + if (abs(zcoscs) .gt. {}) then + passcuts_user=.false. + return + endif + endif + enddo + endif + enddo + + "abscoscsmin": |+ + c cut on the minimum of the absolute value of the cosine of the Collins-Soper angle of SFOS pairs + do i=1,nexternal-1 + if (is_a_lm(i) .or. is_a_lp(i)) then + do j=i+1,nexternal + if (ipdg_reco(i) .eq. -ipdg_reco(j)) then + if (is_a_lm(i)) then + zlep=i + zalep=j + else + zlep=j + zalep=i + endif + zenl=p_reco(0,zlep) + zptxl=p_reco(1,zlep) + zptyl=p_reco(2,zlep) + zpzl=p_reco(3,zlep) + zenal=p_reco(0,zalep) + zptxal=p_reco(1,zalep) + zptyal=p_reco(2,zalep) + zpzal=p_reco(3,zalep) + c implementation of first formula on page 6 of https://arxiv.org/abs/1710.05167 + zp1p=zenl+zpzl + zp1m=zenl-zpzl + zp2p=zenal+zpzal + zp2m=zenal-zpzal + zpzll=zpzl+zpzal + zpt2ll=(zptxl+zptxal)*(zptxl+zptxal)+ + & (zptyl+zptyal)*(zptyl+zptyal) + zmll=sqrt((zenl+zenal)*(zenl+zenal)-(zpt2ll+zpzll*zpzll)) + zcoscs=sign((zp1p*zp2m-zp1m*zp2p)/ + & sqrt(zmll*zmll+zpt2ll)/zmll,zpzll) + + if (abs(zcoscs) .lt. {}) then + passcuts_user=.false. + return + endif + endif + enddo + endif + enddo + + "atlas_1jet_8tev_r06": |+ + c + if ({}) then + xjet=.false. + + do i=1,njet + xyj = dabs(atanh(pjet(3,i)/pjet(0,i))) + xptj = pt_04(pjet(0,i)) + + if (xyj.lt.0.5d0) then + if (xptj.le.2500d0) then + xjet=.true. + c exit + endif + else if (xyj.lt.1.0d0) then + if (xptj.le.2500d0) then + xjet=.true. + exit + endif + else if (xyj.lt.1.5d0) then + if (xptj.le.1992d0) then + xjet=.true. + exit + endif + else if (xyj.lt.2.0d0) then + if (xptj.le.1310d0) then + xjet=.true. + exit + endif + else if (xyj.lt.2.5d0) then + if (xptj.le.838d0) then + xjet=.true. + exit + endif + else if (xyj.lt.3.0d0) then + if (xptj.le.556d0) then + xjet=.true. + exit + endif + endif + enddo + + if (.not. xjet) then + passcuts_user=.false. + return + endif + endif + + "atlas_2jet_7tev_r06": |+ + c + if ({}) then + if (njet.lt.2) then + passcuts_user=.false. + return + endif + + xystar = 0.5d0 * dabs(atanh(pjet(3,1)/pjet(0,1))- + $ atanh(pjet(3,2)/pjet(0,2))) + xmjj = sqrt(invm2_04(pjet(0,1),pjet(0,2),1d0)) + + if (xystar.lt.0.5d0) then + if (xmjj.lt.260d0 .or. xmjj.gt.4270d0) then + passcuts_user=.false. + return + endif + else if (xystar.lt.1.0d0) then + if (xmjj.lt.310d0 .or. xmjj.gt.4270d0) then + passcuts_user=.false. + return + endif + else if (xystar.lt.1.5d0) then + if (xmjj.lt.510d0 .or. xmjj.gt.4640d0) then + passcuts_user=.false. + return + endif + else if (xystar.lt.2.0d0) then + if (xmjj.lt.760d0 .or. xmjj.gt.4640d0) then + passcuts_user=.false. + return + endif + else if (xystar.lt.2.5d0) then + if (xmjj.lt.1310d0 .or. xmjj.gt.5040d0) then + passcuts_user=.false. + return + endif + else if (xystar.lt.3.0d0) then + if (xmjj.lt.2120d0 .or. xmjj.gt.5040d0) then + passcuts_user=.false. + return + endif + else + passcuts_user=.false. + return + endif + endif + + "atlas_dy3d_8tev": | + c + if ({}) then + do j = nincoming+1, nexternal + if (iPDG_reco(j).eq.13) ppl(0:3)=p_reco(0:3,j) + if (iPDG_reco(j).eq.-13) pplb(0:3)=p_reco(0:3,j) + enddo + + p1p = ppl(0) + ppl(3) + p1m = ppl(0) - ppl(3) + p2p = pplb(0) + pplb(3) + p2m = pplb(0) - pplb(3) + pzll = ppl(3) + pplb(3) + pt2ll = (ppl(1) + pplb(1)) * (ppl(1) + pplb(1)) + + & (ppl(2) + pplb(2)) * (ppl(2) + pplb(2)) + + xmll=sqrt((ppl(0)+pplb(0))**2-(ppl(1)+pplb(1))**2- + & (ppl(2)+pplb(2))**2-(ppl(3)+pplb(3))**2) + xyll=abs(atanh((ppl(3)+pplb(3))/(ppl(0)+pplb(0)))) + xcos = sign((p1p*p2m-p1m*p2p)/sqrt(xmll*xmll+pt2ll)/xmll,pzll) + + if (xmll.lt.46d0) then + passcuts_user=.false. + return + elseif (xmll.lt.66d0) then + if (xcos.lt.-0.7d0) then + xlimit=2.0d0 + elseif (xcos.lt.-0.4d0) then + xlimit=2.2d0 + elseif (xcos.lt.0.0d0) then + xlimit=2.4d0 + elseif (xcos.lt.0.4d0) then + xlimit=2.4d0 + elseif (xcos.lt.0.7d0) then + xlimit=2.2d0 + else + xlimit=2.0d0 + endif + elseif (xmll.lt.80d0) then + if (xcos.lt.-0.7d0) then + xlimit=2.0d0 + elseif (xcos.lt.-0.4d0) then + xlimit=2.2d0 + elseif (xcos.lt.0.0d0) then + xlimit=2.4d0 + elseif (xcos.lt.0.4d0) then + xlimit=2.4d0 + elseif (xcos.lt.0.7d0) then + xlimit=2.2d0 + else + xlimit=2.0d0 + endif + elseif (xmll.lt.91d0) then + if (xcos.lt.-0.7d0) then + xlimit=2.2d0 + elseif (xcos.lt.-0.4d0) then + xlimit=2.2d0 + elseif (xcos.lt.0.0d0) then + xlimit=2.4d0 + elseif (xcos.lt.0.4d0) then + xlimit=2.4d0 + elseif (xcos.lt.0.7d0) then + xlimit=2.2d0 + else + xlimit=2.2d0 + endif + elseif (xmll.lt.102d0) then + if (xcos.lt.-0.7d0) then + xlimit=2.2d0 + elseif (xcos.lt.-0.4d0) then + xlimit=2.2d0 + elseif (xcos.lt.0.0d0) then + xlimit=2.4d0 + elseif (xcos.lt.0.4d0) then + xlimit=2.4d0 + elseif (xcos.lt.0.7d0) then + xlimit=2.2d0 + else + xlimit=2.2d0 + endif + elseif (xmll.lt.116d0) then + if (xcos.lt.-0.7d0) then + xlimit=2.0d0 + elseif (xcos.lt.-0.4d0) then + xlimit=2.2d0 + elseif (xcos.lt.0.0d0) then + xlimit=2.4d0 + elseif (xcos.lt.0.4d0) then + xlimit=2.4d0 + elseif (xcos.lt.0.7d0) then + xlimit=2.2d0 + else + xlimit=2.0d0 + endif + elseif (xmll.lt.150d0) then + if (xcos.lt.-0.7d0) then + xlimit=1.8d0 + elseif (xcos.lt.-0.4d0) then + xlimit=2.2d0 + elseif (xcos.lt.0.0d0) then + xlimit=2.4d0 + elseif (xcos.lt.0.4d0) then + xlimit=2.4d0 + elseif (xcos.lt.0.7d0) then + xlimit=2.2d0 + else + xlimit=1.8d0 + endif + elseif (xmll.lt.200d0) then + if (xcos.lt.-0.7d0) then + xlimit=1.6d0 + elseif (xcos.lt.-0.4d0) then + xlimit=2.0d0 + elseif (xcos.lt.0.0d0) then + xlimit=2.4d0 + elseif (xcos.lt.0.4d0) then + xlimit=2.4d0 + elseif (xcos.lt.0.7d0) then + xlimit=2.0d0 + else + xlimit=1.6d0 + endif + else + passcuts_user=.false. + return + endif + + if (xyll.gt.xlimit) then + passcuts_user=.false. + return + endif + endif + "atlas_wzrap11_cf": | + c + if ({}) then + do i = nincoming+1, nexternal + if (iPDG_reco(i).eq.13) then + ppl(0:4)=p_reco(0:4,i) + xeta1=abs(eta_04(p_reco(0,i))) + elseif (iPDG_reco(i).eq.-13) then + pplb(0:4)=p_reco(0:4,i) + xeta2=abs(eta_04(p_reco(0,i))) + endif + enddo + + xyll=abs(atanh((ppl(3)+pplb(3))/(ppl(0)+pplb(0)))) + + if (xyll.lt.1.2d0 .or. xyll.gt.3.6d0) then + passcuts_user=.false. + return + endif + + if (xeta1.lt.2.5d0) then + if (xeta2.lt.2.5d0 .or. xeta2.gt.4.9d0) then + passcuts_user=.false. + return + endif + elseif (xeta2.lt.2.5d0) then + if (xeta1.lt.2.5d0 .or. xeta1.gt.4.9d0) then + passcuts_user=.false. + return + endif + else + passcuts_user=.false. + return + endif + endif + "cms_2jet_3d_8tev": |+ + c + if ({}) then + if (njet.lt.2) then + passcuts_user=.false. + return + endif + + xystar = 0.5d0 * dabs(atanh(pjet(3,1)/pjet(0,1))- + $ atanh(pjet(3,2)/pjet(0,2))) + xyboost = 0.5d0 * dabs(atanh(pjet(3,1)/pjet(0,1))+ + $ atanh(pjet(3,2)/pjet(0,2))) + xptavg = 0.5d0 * (pt_04(pjet(0,1)) + pt_04(pjet(0,2))) + + if (xptavg.lt.133d0) then + passcuts_user=.false. + return + endif + + if (xyboost.lt.1d0) then + if (xystar.lt.1d0) then + if (xptavg.gt.1784d0) then + passcuts_user=.false. + return + endif + elseif (xystar.lt.2d0) then + if (xptavg.gt.1248d0) then + passcuts_user=.false. + return + endif + elseif (xystar.lt.3d0) then + if (xptavg.gt.548d0) then + passcuts_user=.false. + return + endif + else + passcuts_user=.false. + return + endif + else if (xyboost.lt.2d0) then + if (xystar.lt.1d0) then + if (xptavg.gt.1032d0) then + passcuts_user=.false. + return + endif + elseif (xystar.lt.2d0) then + if (xptavg.gt.686d0) then + passcuts_user=.false. + return + endif + else + passcuts_user=.false. + return + endif + else if (xyboost.lt.3d0) then + if (xystar.lt.1d0) then + if (xptavg.gt.430d0) then + passcuts_user=.false. + return + endif + else + passcuts_user=.false. + return + endif + else + passcuts_user=.false. + return + endif + endif + + "cms_2jets_7tev": |+ + c + if ({}) then + if (njet.lt.2) then + passcuts_user=.false. + return + endif + + xymax = max(dabs(atanh(pjet(3,1)/pjet(0,1))), + $ dabs(atanh(pjet(3,2)/pjet(0,2)))) + xmjj = sqrt(invm2_04(pjet(0,1),pjet(0,2),1d0)) + + if (xymax.lt.0.5d0) then + if (xmjj.lt.197d0 .or. xmjj.gt.4010d0) then + passcuts_user=.false. + return + endif + else if (xymax.lt.1.0d0) then + if (xmjj.lt.270d0 .or. xmjj.gt.4010d0) then + passcuts_user=.false. + return + endif + else if (xymax.lt.1.5d0) then + if (xmjj.lt.419d0 .or. xmjj.gt.4509d0) then + passcuts_user=.false. + return + endif + else if (xymax.lt.2.0d0) then + if (xmjj.lt.565d0 .or. xmjj.gt.5058d0) then + passcuts_user=.false. + return + endif + else if (xymax.lt.2.5d0) then + if (xmjj.lt.1000d0 .or. xmjj.gt.5058d0) then + passcuts_user=.false. + return + endif + else + passcuts_user=.false. + return + endif + endif + + "dyjj": |+ + c cut on the rapidity separation of the leading jets + tmpvar=atanh(pjet(3,1)/pjet(0,1)) + & -atanh(pjet(3,2)/pjet(0,2)) + if (abs(tmpvar) .lt. {}) then + passcuts_user=.false. + return + endif + + "minetal": |+ + c cut on the minimum pseudorapidity of leptons + do i=1,nexternal-1 + if (is_a_lm(i) .or. is_a_lp(i)) then + if (abs(atanh(p_reco(3,i)/sqrt(p_reco(1,i)**2+p_reco(2,i)**2+ + & p_reco(3,i)**2))) .lt. {}) then + passcuts_user=.false. + return + endif + endif + enddo + + "mjj": |+ + c cut on the invariant mass of the leading jets + if (invm2_04(pjet(0,1),pjet(0,2),1d0) .lt. ({})**2) then + passcuts_user=.false. + return + endif + + "mmllmax": |+ + c cut for mmllmax (SFOS lepton pairs) + do i=1,nexternal-1 + if (is_a_lm(i) .or. is_a_lp(i)) then + do j=i+1,nexternal + if (ipdg_reco(i) .eq. -ipdg_reco(j)) then + if (invm2_04(p_reco(0,i),p_reco(0,j),1d0) .gt. {}**2) then + passcuts_user=.false. + return + endif + endif + enddo + endif + enddo + + "mtw": |+ + c cut on the transverse mass of W bosons + do i=3,nexternal + do j=i+1,nexternal + if (is_a_lm(i) .or. is_a_lp(i) .or. + & is_a_lm(j) .or. is_a_lp(j)) then + if (abs(ipdg_reco(i)+ipdg_reco(j)).eq.1) then + xmtw=2d0*sqrt((p_reco(1,i)**2+p_reco(2,i)**2)* + & (p_reco(1,j)**2+p_reco(2,j)**2))- + & 2d0*(p_reco(1,i)*p_reco(1,j)+p_reco(2,i)*p_reco(2,j)) + if (xmtw.lt.(({})**2)) then + passcuts_user=.false. + return + endif + endif + endif + enddo + enddo + + "ptj1min": |+ + c cut for ptl1min (leading jet) + if (pt(pjet(0,1)) .lt. {}) then + passcuts_user=.false. + return + endif + + "ptl1min": |+ + c cut for ptl1min (leading lepton) + j = 0 + do i=1,nexternal + if (is_a_lm(i) .or. is_a_lp(i)) then + if (j.eq.0 .or. pt_04(p_reco(0,i)).ge.pt_04(p_reco(0,j))) then + j = i + endif + endif + enddo + if (pt_04(p_reco(0,j)) .lt. {}) then + passcuts_user=.false. + return + endif + + "ptmiss": |+ + c cut on the sum of all missing transverse momentum + xptmiss=0d0 + + do i=3,nexternal + if (abs(ipdg_reco(i)).eq.12 .or. + & abs(ipdg_reco(i)).eq.14 .or. + & abs(ipdg_reco(i)).eq.16) then + xptmiss(1)=xptmiss(1)+p_reco(1,i) + xptmiss(2)=xptmiss(2)+p_reco(2,i) + endif + enddo + + if (xptmiss(1)**2+xptmiss(2)**2.lt.(({})**2)) then + passcuts_user=.false. + return + endif + + "ptzmax": |+ + c cut on the pt of SFOS lepton pairs + do i=1,nexternal-1 + if (is_a_lm(i) .or. is_a_lp(i)) then + do j=i+1,nexternal + if (ipdg_reco(i) .eq. -ipdg_reco(j)) then + if (((p_reco(1,i)+p_reco(1,j))**2+ + & (p_reco(2,i)+p_reco(2,j))**2) .gt. {}**2) then + passcuts_user=.false. + return + endif + endif + enddo + endif + enddo + + "ptzmin": |+ + c cut on the pt of SFOS lepton pairs + do i=1,nexternal-1 + if (is_a_lm(i) .or. is_a_lp(i)) then + do j=i+1,nexternal + if (ipdg_reco(i) .eq. -ipdg_reco(j)) then + if (((p_reco(1,i)+p_reco(1,j))**2+ + & (p_reco(2,i)+p_reco(2,j))**2) .lt. {}**2) then + passcuts_user=.false. + return + endif + endif + enddo + endif + enddo + + "yh": |+ + c cut on Higgs particles + do i=1,nexternal + if (ipdg_reco(i) .eq. 25) then + if (abs(atanh(p_reco(3,i)/p_reco(0,i))) + & .gt. {}) then + passcuts_user=.false. + return + endif + endif + enddo + + "yll": |+ + c cut on the rapidity of the two leading leptons + j = 0 ! leading lepton index + mm = 0 ! subleading lepton index + do i=1,nexternal + if (is_a_lm(i) .or. is_a_lp(i)) then + tmpvar = pt_04(p_reco(0,i)) + if (j.eq.0) then + j = i + else if (mm.eq.0) then + if (tmpvar.ge.pt_04(p_reco(0,j))) then + mm = j + j = i + else if (tmpvar.ge.pt_04(p_reco(0,mm))) then + mm = i + endif + else if (tmpvar.ge.pt_04(p_reco(0,j))) then + mm = j + j = i + else if (tmpvar.ge.pt_04(p_reco(0,mm))) then + mm = i + endif + endif + enddo + if (abs(atanh((p_reco(3,j)+p_reco(3,mm)) + & /(p_reco(0,j)+p_reco(0,mm)))) .gt. {}) then + passcuts_user=.false. + return + endif + + "yt": |+ + c cut on top particles + do i=1,nexternal + if (ipdg_reco(i).eq.6 .or. ipdg_reco(i).eq.-6) then + if (abs(atanh(p_reco(3,i)/p_reco(0,i))) + & .gt. {}) then + passcuts_user=.false. + return + endif + endif + enddo + + "yz": |+ + c cut on the rapidity of SFOS lepton pairs + do i=1,nexternal-1 + if (is_a_lm(i) .or. is_a_lp(i)) then + do j=i+1,nexternal + if (ipdg_reco(i) .eq. -ipdg_reco(j)) then + if (abs(atanh((p_reco(3,i)+p_reco(3,j)) + & /(p_reco(0,i)+p_reco(0,j)))) .gt. {}) then + passcuts_user=.false. + return + endif + endif + enddo + endif + enddo + + "yzmin": |+ + c cut on the rapidity of SFOS lepton pairs + do i=1,nexternal-1 + if (is_a_lm(i) .or. is_a_lp(i)) then + do j=i+1,nexternal + if (ipdg_reco(i) .eq. -ipdg_reco(j)) then + if (abs(atanh((p_reco(3,i)+p_reco(3,j)) + & /(p_reco(0,i)+p_reco(0,j)))) .lt. {}) then + passcuts_user=.false. + return + endif + endif + enddo + endif + enddo + +"cuts_variables": + "abscoscs": | + c variables for abscoscs cuts + real*8 zcoscs,zenl,zptxl,zptyl,zpzl,zenal,zptxal,zptyal,zpzal + real*8 zpzll,zmll,zp1p,zp1m,zp2p,zp2m,zpt2ll + integer zlep,zalep + "atlas_1jet_8tev_r06": | + c variables for atlas_1jet_8tev_r06 cuts + real*8 xptj,xyj + logical xjet + "atlas_2jet_7tev_r06": | + c + real*8 xystar,xmjj + "atlas_dy3d_8tev": | + c variables for atlas_dy3d_8tev cut + real*8 ppl(0:3),pplb(0:3) + real*8 p1p,p1m,p2p,p2m,pzll,pt2ll + real*8 xmll,xyll,xcos,xlimit + "atlas_wzrap11_cf": | + c variables for atlas_wzrap11_cf cut + real*8 ppl(0:4),pplb(0:4) + real*8 xyll,xeta1,xeta2 + "cms_2jet_3d_8tev": | + c + real*8 xystar,xyboost,xptavg + "cms_2jets_7tev": | + c variables for cms_2jets_7tev cuts + real*8 xymax,xmjj + "mtw": | + c variables for ptmiss cut + real*8 xmtw + "ptmiss": | + c variables for ptmiss cut + real*8 xptmiss(1:2) diff --git a/run/hadronic.py b/run/hadronic.py index 6ba3b00a..d5e41724 100644 --- a/run/hadronic.py +++ b/run/hadronic.py @@ -89,15 +89,15 @@ def run_dataset(name, pdf): launch = launch.replace(f"@{name}@", value) # perform simple arithmetic on lines containing 'set' and '=' and arithmetic operators - interpreter = asteval.Interpreter() # use asteval for safety - lines = [] - pattern = re.compile(r"(set [\w_]* = )(.*)") - for line in launch.splitlines(): - m = re.fullmatch(pattern, line) - if m is not None: - line = m[1] + str(interpreter.eval(m[2])) - lines.append(line) - launch = "\n".join(lines) + # interpreter = asteval.Interpreter() # use asteval for safety + # lines = [] + # pattern = re.compile(r"(set [\w_]* = )(.*)") + # for line in launch.splitlines(): + # m = re.fullmatch(pattern, line) + # if m is not None: + # line = m[1] + str(interpreter.eval(m[2])) + # lines.append(line) + # launch = "\n".join(lines) # finally write launch launch_file.write_text(launch) From cc0807e262005635f4611c99e5102adc863d9e3e Mon Sep 17 00:00:00 2001 From: Alessandro Candido Date: Wed, 25 Aug 2021 11:55:08 +0200 Subject: [PATCH 17/63] Unpack code templates into individual files --- run/cuts.yaml | 715 ----------------------- run/cuts_code/abscoscsmax.f | 41 ++ run/cuts_code/abscoscsmin.f | 41 ++ run/cuts_code/atlas_1jet_8tev_r06.f | 47 ++ run/cuts_code/atlas_2jet_7tev_r06.f | 47 ++ run/cuts_code/atlas_dy3d_8tev.f | 131 +++++ run/cuts_code/atlas_wzrap11_cf.f | 34 ++ run/cuts_code/cms_2jet_3d_8tev.f | 69 +++ run/cuts_code/cms_2jets_7tev.f | 42 ++ run/cuts_code/dyjj.f | 8 + run/cuts_code/minetal.f | 11 + run/cuts_code/mjj.f | 6 + run/cuts_code/mmllmax.f | 14 + run/cuts_code/mtw.f | 18 + run/cuts_code/ptj1min.f | 6 + run/cuts_code/ptl1min.f | 14 + run/cuts_code/ptmiss.f | 17 + run/cuts_code/ptzmax.f | 15 + run/cuts_code/ptzmin.f | 15 + run/cuts_code/yh.f | 11 + run/cuts_code/yll.f | 29 + run/cuts_code/yt.f | 11 + run/cuts_code/yz.f | 15 + run/cuts_code/yzmin.f | 15 + run/cuts_variables/abscoscs.f | 4 + run/cuts_variables/atlas_1jet_8tev_r06.f | 3 + run/cuts_variables/atlas_2jet_7tev_r06.f | 2 + run/cuts_variables/atlas_dy3d_8tev.f | 4 + run/cuts_variables/atlas_wzrap11_cf.f | 3 + run/cuts_variables/cms_2jet_3d_8tev.f | 2 + run/cuts_variables/cms_2jets_7tev.f | 2 + run/cuts_variables/mtw.f | 2 + run/cuts_variables/ptmiss.f | 2 + 33 files changed, 681 insertions(+), 715 deletions(-) delete mode 100644 run/cuts.yaml create mode 100644 run/cuts_code/abscoscsmax.f create mode 100644 run/cuts_code/abscoscsmin.f create mode 100644 run/cuts_code/atlas_1jet_8tev_r06.f create mode 100644 run/cuts_code/atlas_2jet_7tev_r06.f create mode 100644 run/cuts_code/atlas_dy3d_8tev.f create mode 100644 run/cuts_code/atlas_wzrap11_cf.f create mode 100644 run/cuts_code/cms_2jet_3d_8tev.f create mode 100644 run/cuts_code/cms_2jets_7tev.f create mode 100644 run/cuts_code/dyjj.f create mode 100644 run/cuts_code/minetal.f create mode 100644 run/cuts_code/mjj.f create mode 100644 run/cuts_code/mmllmax.f create mode 100644 run/cuts_code/mtw.f create mode 100644 run/cuts_code/ptj1min.f create mode 100644 run/cuts_code/ptl1min.f create mode 100644 run/cuts_code/ptmiss.f create mode 100644 run/cuts_code/ptzmax.f create mode 100644 run/cuts_code/ptzmin.f create mode 100644 run/cuts_code/yh.f create mode 100644 run/cuts_code/yll.f create mode 100644 run/cuts_code/yt.f create mode 100644 run/cuts_code/yz.f create mode 100644 run/cuts_code/yzmin.f create mode 100644 run/cuts_variables/abscoscs.f create mode 100644 run/cuts_variables/atlas_1jet_8tev_r06.f create mode 100644 run/cuts_variables/atlas_2jet_7tev_r06.f create mode 100644 run/cuts_variables/atlas_dy3d_8tev.f create mode 100644 run/cuts_variables/atlas_wzrap11_cf.f create mode 100644 run/cuts_variables/cms_2jet_3d_8tev.f create mode 100644 run/cuts_variables/cms_2jets_7tev.f create mode 100644 run/cuts_variables/mtw.f create mode 100644 run/cuts_variables/ptmiss.f diff --git a/run/cuts.yaml b/run/cuts.yaml deleted file mode 100644 index 1916a49e..00000000 --- a/run/cuts.yaml +++ /dev/null @@ -1,715 +0,0 @@ -"cuts_code": - "abscoscsmax": |+ - c cut on the maximum of the absolute value of the cosine of the Collins-Soper angle of SFOS pairs - do i=1,nexternal-1 - if (is_a_lm(i) .or. is_a_lp(i)) then - do j=i+1,nexternal - if (ipdg_reco(i) .eq. -ipdg_reco(j)) then - if (is_a_lm(i)) then - zlep=i - zalep=j - else - zlep=j - zalep=i - endif - zenl=p_reco(0,zlep) - zptxl=p_reco(1,zlep) - zptyl=p_reco(2,zlep) - zpzl=p_reco(3,zlep) - zenal=p_reco(0,zalep) - zptxal=p_reco(1,zalep) - zptyal=p_reco(2,zalep) - zpzal=p_reco(3,zalep) - c implementation of first formula on page 6 of https://arxiv.org/abs/1710.05167 - zp1p=zenl+zpzl - zp1m=zenl-zpzl - zp2p=zenal+zpzal - zp2m=zenal-zpzal - zpzll=zpzl+zpzal - zpt2ll=(zptxl+zptxal)*(zptxl+zptxal)+ - & (zptyl+zptyal)*(zptyl+zptyal) - zmll=sqrt((zenl+zenal)*(zenl+zenal)-(zpt2ll+zpzll*zpzll)) - zcoscs=sign((zp1p*zp2m-zp1m*zp2p)/ - & sqrt(zmll*zmll+zpt2ll)/zmll,zpzll) - - if (abs(zcoscs) .gt. {}) then - passcuts_user=.false. - return - endif - endif - enddo - endif - enddo - - "abscoscsmin": |+ - c cut on the minimum of the absolute value of the cosine of the Collins-Soper angle of SFOS pairs - do i=1,nexternal-1 - if (is_a_lm(i) .or. is_a_lp(i)) then - do j=i+1,nexternal - if (ipdg_reco(i) .eq. -ipdg_reco(j)) then - if (is_a_lm(i)) then - zlep=i - zalep=j - else - zlep=j - zalep=i - endif - zenl=p_reco(0,zlep) - zptxl=p_reco(1,zlep) - zptyl=p_reco(2,zlep) - zpzl=p_reco(3,zlep) - zenal=p_reco(0,zalep) - zptxal=p_reco(1,zalep) - zptyal=p_reco(2,zalep) - zpzal=p_reco(3,zalep) - c implementation of first formula on page 6 of https://arxiv.org/abs/1710.05167 - zp1p=zenl+zpzl - zp1m=zenl-zpzl - zp2p=zenal+zpzal - zp2m=zenal-zpzal - zpzll=zpzl+zpzal - zpt2ll=(zptxl+zptxal)*(zptxl+zptxal)+ - & (zptyl+zptyal)*(zptyl+zptyal) - zmll=sqrt((zenl+zenal)*(zenl+zenal)-(zpt2ll+zpzll*zpzll)) - zcoscs=sign((zp1p*zp2m-zp1m*zp2p)/ - & sqrt(zmll*zmll+zpt2ll)/zmll,zpzll) - - if (abs(zcoscs) .lt. {}) then - passcuts_user=.false. - return - endif - endif - enddo - endif - enddo - - "atlas_1jet_8tev_r06": |+ - c - if ({}) then - xjet=.false. - - do i=1,njet - xyj = dabs(atanh(pjet(3,i)/pjet(0,i))) - xptj = pt_04(pjet(0,i)) - - if (xyj.lt.0.5d0) then - if (xptj.le.2500d0) then - xjet=.true. - c exit - endif - else if (xyj.lt.1.0d0) then - if (xptj.le.2500d0) then - xjet=.true. - exit - endif - else if (xyj.lt.1.5d0) then - if (xptj.le.1992d0) then - xjet=.true. - exit - endif - else if (xyj.lt.2.0d0) then - if (xptj.le.1310d0) then - xjet=.true. - exit - endif - else if (xyj.lt.2.5d0) then - if (xptj.le.838d0) then - xjet=.true. - exit - endif - else if (xyj.lt.3.0d0) then - if (xptj.le.556d0) then - xjet=.true. - exit - endif - endif - enddo - - if (.not. xjet) then - passcuts_user=.false. - return - endif - endif - - "atlas_2jet_7tev_r06": |+ - c - if ({}) then - if (njet.lt.2) then - passcuts_user=.false. - return - endif - - xystar = 0.5d0 * dabs(atanh(pjet(3,1)/pjet(0,1))- - $ atanh(pjet(3,2)/pjet(0,2))) - xmjj = sqrt(invm2_04(pjet(0,1),pjet(0,2),1d0)) - - if (xystar.lt.0.5d0) then - if (xmjj.lt.260d0 .or. xmjj.gt.4270d0) then - passcuts_user=.false. - return - endif - else if (xystar.lt.1.0d0) then - if (xmjj.lt.310d0 .or. xmjj.gt.4270d0) then - passcuts_user=.false. - return - endif - else if (xystar.lt.1.5d0) then - if (xmjj.lt.510d0 .or. xmjj.gt.4640d0) then - passcuts_user=.false. - return - endif - else if (xystar.lt.2.0d0) then - if (xmjj.lt.760d0 .or. xmjj.gt.4640d0) then - passcuts_user=.false. - return - endif - else if (xystar.lt.2.5d0) then - if (xmjj.lt.1310d0 .or. xmjj.gt.5040d0) then - passcuts_user=.false. - return - endif - else if (xystar.lt.3.0d0) then - if (xmjj.lt.2120d0 .or. xmjj.gt.5040d0) then - passcuts_user=.false. - return - endif - else - passcuts_user=.false. - return - endif - endif - - "atlas_dy3d_8tev": | - c - if ({}) then - do j = nincoming+1, nexternal - if (iPDG_reco(j).eq.13) ppl(0:3)=p_reco(0:3,j) - if (iPDG_reco(j).eq.-13) pplb(0:3)=p_reco(0:3,j) - enddo - - p1p = ppl(0) + ppl(3) - p1m = ppl(0) - ppl(3) - p2p = pplb(0) + pplb(3) - p2m = pplb(0) - pplb(3) - pzll = ppl(3) + pplb(3) - pt2ll = (ppl(1) + pplb(1)) * (ppl(1) + pplb(1)) + - & (ppl(2) + pplb(2)) * (ppl(2) + pplb(2)) - - xmll=sqrt((ppl(0)+pplb(0))**2-(ppl(1)+pplb(1))**2- - & (ppl(2)+pplb(2))**2-(ppl(3)+pplb(3))**2) - xyll=abs(atanh((ppl(3)+pplb(3))/(ppl(0)+pplb(0)))) - xcos = sign((p1p*p2m-p1m*p2p)/sqrt(xmll*xmll+pt2ll)/xmll,pzll) - - if (xmll.lt.46d0) then - passcuts_user=.false. - return - elseif (xmll.lt.66d0) then - if (xcos.lt.-0.7d0) then - xlimit=2.0d0 - elseif (xcos.lt.-0.4d0) then - xlimit=2.2d0 - elseif (xcos.lt.0.0d0) then - xlimit=2.4d0 - elseif (xcos.lt.0.4d0) then - xlimit=2.4d0 - elseif (xcos.lt.0.7d0) then - xlimit=2.2d0 - else - xlimit=2.0d0 - endif - elseif (xmll.lt.80d0) then - if (xcos.lt.-0.7d0) then - xlimit=2.0d0 - elseif (xcos.lt.-0.4d0) then - xlimit=2.2d0 - elseif (xcos.lt.0.0d0) then - xlimit=2.4d0 - elseif (xcos.lt.0.4d0) then - xlimit=2.4d0 - elseif (xcos.lt.0.7d0) then - xlimit=2.2d0 - else - xlimit=2.0d0 - endif - elseif (xmll.lt.91d0) then - if (xcos.lt.-0.7d0) then - xlimit=2.2d0 - elseif (xcos.lt.-0.4d0) then - xlimit=2.2d0 - elseif (xcos.lt.0.0d0) then - xlimit=2.4d0 - elseif (xcos.lt.0.4d0) then - xlimit=2.4d0 - elseif (xcos.lt.0.7d0) then - xlimit=2.2d0 - else - xlimit=2.2d0 - endif - elseif (xmll.lt.102d0) then - if (xcos.lt.-0.7d0) then - xlimit=2.2d0 - elseif (xcos.lt.-0.4d0) then - xlimit=2.2d0 - elseif (xcos.lt.0.0d0) then - xlimit=2.4d0 - elseif (xcos.lt.0.4d0) then - xlimit=2.4d0 - elseif (xcos.lt.0.7d0) then - xlimit=2.2d0 - else - xlimit=2.2d0 - endif - elseif (xmll.lt.116d0) then - if (xcos.lt.-0.7d0) then - xlimit=2.0d0 - elseif (xcos.lt.-0.4d0) then - xlimit=2.2d0 - elseif (xcos.lt.0.0d0) then - xlimit=2.4d0 - elseif (xcos.lt.0.4d0) then - xlimit=2.4d0 - elseif (xcos.lt.0.7d0) then - xlimit=2.2d0 - else - xlimit=2.0d0 - endif - elseif (xmll.lt.150d0) then - if (xcos.lt.-0.7d0) then - xlimit=1.8d0 - elseif (xcos.lt.-0.4d0) then - xlimit=2.2d0 - elseif (xcos.lt.0.0d0) then - xlimit=2.4d0 - elseif (xcos.lt.0.4d0) then - xlimit=2.4d0 - elseif (xcos.lt.0.7d0) then - xlimit=2.2d0 - else - xlimit=1.8d0 - endif - elseif (xmll.lt.200d0) then - if (xcos.lt.-0.7d0) then - xlimit=1.6d0 - elseif (xcos.lt.-0.4d0) then - xlimit=2.0d0 - elseif (xcos.lt.0.0d0) then - xlimit=2.4d0 - elseif (xcos.lt.0.4d0) then - xlimit=2.4d0 - elseif (xcos.lt.0.7d0) then - xlimit=2.0d0 - else - xlimit=1.6d0 - endif - else - passcuts_user=.false. - return - endif - - if (xyll.gt.xlimit) then - passcuts_user=.false. - return - endif - endif - "atlas_wzrap11_cf": | - c - if ({}) then - do i = nincoming+1, nexternal - if (iPDG_reco(i).eq.13) then - ppl(0:4)=p_reco(0:4,i) - xeta1=abs(eta_04(p_reco(0,i))) - elseif (iPDG_reco(i).eq.-13) then - pplb(0:4)=p_reco(0:4,i) - xeta2=abs(eta_04(p_reco(0,i))) - endif - enddo - - xyll=abs(atanh((ppl(3)+pplb(3))/(ppl(0)+pplb(0)))) - - if (xyll.lt.1.2d0 .or. xyll.gt.3.6d0) then - passcuts_user=.false. - return - endif - - if (xeta1.lt.2.5d0) then - if (xeta2.lt.2.5d0 .or. xeta2.gt.4.9d0) then - passcuts_user=.false. - return - endif - elseif (xeta2.lt.2.5d0) then - if (xeta1.lt.2.5d0 .or. xeta1.gt.4.9d0) then - passcuts_user=.false. - return - endif - else - passcuts_user=.false. - return - endif - endif - "cms_2jet_3d_8tev": |+ - c - if ({}) then - if (njet.lt.2) then - passcuts_user=.false. - return - endif - - xystar = 0.5d0 * dabs(atanh(pjet(3,1)/pjet(0,1))- - $ atanh(pjet(3,2)/pjet(0,2))) - xyboost = 0.5d0 * dabs(atanh(pjet(3,1)/pjet(0,1))+ - $ atanh(pjet(3,2)/pjet(0,2))) - xptavg = 0.5d0 * (pt_04(pjet(0,1)) + pt_04(pjet(0,2))) - - if (xptavg.lt.133d0) then - passcuts_user=.false. - return - endif - - if (xyboost.lt.1d0) then - if (xystar.lt.1d0) then - if (xptavg.gt.1784d0) then - passcuts_user=.false. - return - endif - elseif (xystar.lt.2d0) then - if (xptavg.gt.1248d0) then - passcuts_user=.false. - return - endif - elseif (xystar.lt.3d0) then - if (xptavg.gt.548d0) then - passcuts_user=.false. - return - endif - else - passcuts_user=.false. - return - endif - else if (xyboost.lt.2d0) then - if (xystar.lt.1d0) then - if (xptavg.gt.1032d0) then - passcuts_user=.false. - return - endif - elseif (xystar.lt.2d0) then - if (xptavg.gt.686d0) then - passcuts_user=.false. - return - endif - else - passcuts_user=.false. - return - endif - else if (xyboost.lt.3d0) then - if (xystar.lt.1d0) then - if (xptavg.gt.430d0) then - passcuts_user=.false. - return - endif - else - passcuts_user=.false. - return - endif - else - passcuts_user=.false. - return - endif - endif - - "cms_2jets_7tev": |+ - c - if ({}) then - if (njet.lt.2) then - passcuts_user=.false. - return - endif - - xymax = max(dabs(atanh(pjet(3,1)/pjet(0,1))), - $ dabs(atanh(pjet(3,2)/pjet(0,2)))) - xmjj = sqrt(invm2_04(pjet(0,1),pjet(0,2),1d0)) - - if (xymax.lt.0.5d0) then - if (xmjj.lt.197d0 .or. xmjj.gt.4010d0) then - passcuts_user=.false. - return - endif - else if (xymax.lt.1.0d0) then - if (xmjj.lt.270d0 .or. xmjj.gt.4010d0) then - passcuts_user=.false. - return - endif - else if (xymax.lt.1.5d0) then - if (xmjj.lt.419d0 .or. xmjj.gt.4509d0) then - passcuts_user=.false. - return - endif - else if (xymax.lt.2.0d0) then - if (xmjj.lt.565d0 .or. xmjj.gt.5058d0) then - passcuts_user=.false. - return - endif - else if (xymax.lt.2.5d0) then - if (xmjj.lt.1000d0 .or. xmjj.gt.5058d0) then - passcuts_user=.false. - return - endif - else - passcuts_user=.false. - return - endif - endif - - "dyjj": |+ - c cut on the rapidity separation of the leading jets - tmpvar=atanh(pjet(3,1)/pjet(0,1)) - & -atanh(pjet(3,2)/pjet(0,2)) - if (abs(tmpvar) .lt. {}) then - passcuts_user=.false. - return - endif - - "minetal": |+ - c cut on the minimum pseudorapidity of leptons - do i=1,nexternal-1 - if (is_a_lm(i) .or. is_a_lp(i)) then - if (abs(atanh(p_reco(3,i)/sqrt(p_reco(1,i)**2+p_reco(2,i)**2+ - & p_reco(3,i)**2))) .lt. {}) then - passcuts_user=.false. - return - endif - endif - enddo - - "mjj": |+ - c cut on the invariant mass of the leading jets - if (invm2_04(pjet(0,1),pjet(0,2),1d0) .lt. ({})**2) then - passcuts_user=.false. - return - endif - - "mmllmax": |+ - c cut for mmllmax (SFOS lepton pairs) - do i=1,nexternal-1 - if (is_a_lm(i) .or. is_a_lp(i)) then - do j=i+1,nexternal - if (ipdg_reco(i) .eq. -ipdg_reco(j)) then - if (invm2_04(p_reco(0,i),p_reco(0,j),1d0) .gt. {}**2) then - passcuts_user=.false. - return - endif - endif - enddo - endif - enddo - - "mtw": |+ - c cut on the transverse mass of W bosons - do i=3,nexternal - do j=i+1,nexternal - if (is_a_lm(i) .or. is_a_lp(i) .or. - & is_a_lm(j) .or. is_a_lp(j)) then - if (abs(ipdg_reco(i)+ipdg_reco(j)).eq.1) then - xmtw=2d0*sqrt((p_reco(1,i)**2+p_reco(2,i)**2)* - & (p_reco(1,j)**2+p_reco(2,j)**2))- - & 2d0*(p_reco(1,i)*p_reco(1,j)+p_reco(2,i)*p_reco(2,j)) - if (xmtw.lt.(({})**2)) then - passcuts_user=.false. - return - endif - endif - endif - enddo - enddo - - "ptj1min": |+ - c cut for ptl1min (leading jet) - if (pt(pjet(0,1)) .lt. {}) then - passcuts_user=.false. - return - endif - - "ptl1min": |+ - c cut for ptl1min (leading lepton) - j = 0 - do i=1,nexternal - if (is_a_lm(i) .or. is_a_lp(i)) then - if (j.eq.0 .or. pt_04(p_reco(0,i)).ge.pt_04(p_reco(0,j))) then - j = i - endif - endif - enddo - if (pt_04(p_reco(0,j)) .lt. {}) then - passcuts_user=.false. - return - endif - - "ptmiss": |+ - c cut on the sum of all missing transverse momentum - xptmiss=0d0 - - do i=3,nexternal - if (abs(ipdg_reco(i)).eq.12 .or. - & abs(ipdg_reco(i)).eq.14 .or. - & abs(ipdg_reco(i)).eq.16) then - xptmiss(1)=xptmiss(1)+p_reco(1,i) - xptmiss(2)=xptmiss(2)+p_reco(2,i) - endif - enddo - - if (xptmiss(1)**2+xptmiss(2)**2.lt.(({})**2)) then - passcuts_user=.false. - return - endif - - "ptzmax": |+ - c cut on the pt of SFOS lepton pairs - do i=1,nexternal-1 - if (is_a_lm(i) .or. is_a_lp(i)) then - do j=i+1,nexternal - if (ipdg_reco(i) .eq. -ipdg_reco(j)) then - if (((p_reco(1,i)+p_reco(1,j))**2+ - & (p_reco(2,i)+p_reco(2,j))**2) .gt. {}**2) then - passcuts_user=.false. - return - endif - endif - enddo - endif - enddo - - "ptzmin": |+ - c cut on the pt of SFOS lepton pairs - do i=1,nexternal-1 - if (is_a_lm(i) .or. is_a_lp(i)) then - do j=i+1,nexternal - if (ipdg_reco(i) .eq. -ipdg_reco(j)) then - if (((p_reco(1,i)+p_reco(1,j))**2+ - & (p_reco(2,i)+p_reco(2,j))**2) .lt. {}**2) then - passcuts_user=.false. - return - endif - endif - enddo - endif - enddo - - "yh": |+ - c cut on Higgs particles - do i=1,nexternal - if (ipdg_reco(i) .eq. 25) then - if (abs(atanh(p_reco(3,i)/p_reco(0,i))) - & .gt. {}) then - passcuts_user=.false. - return - endif - endif - enddo - - "yll": |+ - c cut on the rapidity of the two leading leptons - j = 0 ! leading lepton index - mm = 0 ! subleading lepton index - do i=1,nexternal - if (is_a_lm(i) .or. is_a_lp(i)) then - tmpvar = pt_04(p_reco(0,i)) - if (j.eq.0) then - j = i - else if (mm.eq.0) then - if (tmpvar.ge.pt_04(p_reco(0,j))) then - mm = j - j = i - else if (tmpvar.ge.pt_04(p_reco(0,mm))) then - mm = i - endif - else if (tmpvar.ge.pt_04(p_reco(0,j))) then - mm = j - j = i - else if (tmpvar.ge.pt_04(p_reco(0,mm))) then - mm = i - endif - endif - enddo - if (abs(atanh((p_reco(3,j)+p_reco(3,mm)) - & /(p_reco(0,j)+p_reco(0,mm)))) .gt. {}) then - passcuts_user=.false. - return - endif - - "yt": |+ - c cut on top particles - do i=1,nexternal - if (ipdg_reco(i).eq.6 .or. ipdg_reco(i).eq.-6) then - if (abs(atanh(p_reco(3,i)/p_reco(0,i))) - & .gt. {}) then - passcuts_user=.false. - return - endif - endif - enddo - - "yz": |+ - c cut on the rapidity of SFOS lepton pairs - do i=1,nexternal-1 - if (is_a_lm(i) .or. is_a_lp(i)) then - do j=i+1,nexternal - if (ipdg_reco(i) .eq. -ipdg_reco(j)) then - if (abs(atanh((p_reco(3,i)+p_reco(3,j)) - & /(p_reco(0,i)+p_reco(0,j)))) .gt. {}) then - passcuts_user=.false. - return - endif - endif - enddo - endif - enddo - - "yzmin": |+ - c cut on the rapidity of SFOS lepton pairs - do i=1,nexternal-1 - if (is_a_lm(i) .or. is_a_lp(i)) then - do j=i+1,nexternal - if (ipdg_reco(i) .eq. -ipdg_reco(j)) then - if (abs(atanh((p_reco(3,i)+p_reco(3,j)) - & /(p_reco(0,i)+p_reco(0,j)))) .lt. {}) then - passcuts_user=.false. - return - endif - endif - enddo - endif - enddo - -"cuts_variables": - "abscoscs": | - c variables for abscoscs cuts - real*8 zcoscs,zenl,zptxl,zptyl,zpzl,zenal,zptxal,zptyal,zpzal - real*8 zpzll,zmll,zp1p,zp1m,zp2p,zp2m,zpt2ll - integer zlep,zalep - "atlas_1jet_8tev_r06": | - c variables for atlas_1jet_8tev_r06 cuts - real*8 xptj,xyj - logical xjet - "atlas_2jet_7tev_r06": | - c - real*8 xystar,xmjj - "atlas_dy3d_8tev": | - c variables for atlas_dy3d_8tev cut - real*8 ppl(0:3),pplb(0:3) - real*8 p1p,p1m,p2p,p2m,pzll,pt2ll - real*8 xmll,xyll,xcos,xlimit - "atlas_wzrap11_cf": | - c variables for atlas_wzrap11_cf cut - real*8 ppl(0:4),pplb(0:4) - real*8 xyll,xeta1,xeta2 - "cms_2jet_3d_8tev": | - c - real*8 xystar,xyboost,xptavg - "cms_2jets_7tev": | - c variables for cms_2jets_7tev cuts - real*8 xymax,xmjj - "mtw": | - c variables for ptmiss cut - real*8 xmtw - "ptmiss": | - c variables for ptmiss cut - real*8 xptmiss(1:2) diff --git a/run/cuts_code/abscoscsmax.f b/run/cuts_code/abscoscsmax.f new file mode 100644 index 00000000..37ddbfe1 --- /dev/null +++ b/run/cuts_code/abscoscsmax.f @@ -0,0 +1,41 @@ +c cut on the maximum of the absolute value of the cosine of the Collins-Soper angle of SFOS pairs + do i=1,nexternal-1 + if (is_a_lm(i) .or. is_a_lp(i)) then + do j=i+1,nexternal + if (ipdg_reco(i) .eq. -ipdg_reco(j)) then + if (is_a_lm(i)) then + zlep=i + zalep=j + else + zlep=j + zalep=i + endif + zenl=p_reco(0,zlep) + zptxl=p_reco(1,zlep) + zptyl=p_reco(2,zlep) + zpzl=p_reco(3,zlep) + zenal=p_reco(0,zalep) + zptxal=p_reco(1,zalep) + zptyal=p_reco(2,zalep) + zpzal=p_reco(3,zalep) +c implementation of first formula on page 6 of https://arxiv.org/abs/1710.05167 + zp1p=zenl+zpzl + zp1m=zenl-zpzl + zp2p=zenal+zpzal + zp2m=zenal-zpzal + zpzll=zpzl+zpzal + zpt2ll=(zptxl+zptxal)*(zptxl+zptxal)+ + & (zptyl+zptyal)*(zptyl+zptyal) + zmll=sqrt((zenl+zenal)*(zenl+zenal)-(zpt2ll+zpzll*zpzll)) + zcoscs=sign((zp1p*zp2m-zp1m*zp2p)/ + & sqrt(zmll*zmll+zpt2ll)/zmll,zpzll) + + if (abs(zcoscs) .gt. {}) then + passcuts_user=.false. + return + endif + endif + enddo + endif + enddo + diff --git a/run/cuts_code/abscoscsmin.f b/run/cuts_code/abscoscsmin.f new file mode 100644 index 00000000..8df6f97a --- /dev/null +++ b/run/cuts_code/abscoscsmin.f @@ -0,0 +1,41 @@ +c cut on the minimum of the absolute value of the cosine of the Collins-Soper angle of SFOS pairs + do i=1,nexternal-1 + if (is_a_lm(i) .or. is_a_lp(i)) then + do j=i+1,nexternal + if (ipdg_reco(i) .eq. -ipdg_reco(j)) then + if (is_a_lm(i)) then + zlep=i + zalep=j + else + zlep=j + zalep=i + endif + zenl=p_reco(0,zlep) + zptxl=p_reco(1,zlep) + zptyl=p_reco(2,zlep) + zpzl=p_reco(3,zlep) + zenal=p_reco(0,zalep) + zptxal=p_reco(1,zalep) + zptyal=p_reco(2,zalep) + zpzal=p_reco(3,zalep) +c implementation of first formula on page 6 of https://arxiv.org/abs/1710.05167 + zp1p=zenl+zpzl + zp1m=zenl-zpzl + zp2p=zenal+zpzal + zp2m=zenal-zpzal + zpzll=zpzl+zpzal + zpt2ll=(zptxl+zptxal)*(zptxl+zptxal)+ + & (zptyl+zptyal)*(zptyl+zptyal) + zmll=sqrt((zenl+zenal)*(zenl+zenal)-(zpt2ll+zpzll*zpzll)) + zcoscs=sign((zp1p*zp2m-zp1m*zp2p)/ + & sqrt(zmll*zmll+zpt2ll)/zmll,zpzll) + + if (abs(zcoscs) .lt. {}) then + passcuts_user=.false. + return + endif + endif + enddo + endif + enddo + diff --git a/run/cuts_code/atlas_1jet_8tev_r06.f b/run/cuts_code/atlas_1jet_8tev_r06.f new file mode 100644 index 00000000..59ab986f --- /dev/null +++ b/run/cuts_code/atlas_1jet_8tev_r06.f @@ -0,0 +1,47 @@ +c + if ({}) then + xjet=.false. + + do i=1,njet + xyj = dabs(atanh(pjet(3,i)/pjet(0,i))) + xptj = pt_04(pjet(0,i)) + + if (xyj.lt.0.5d0) then + if (xptj.le.2500d0) then + xjet=.true. +c exit + endif + else if (xyj.lt.1.0d0) then + if (xptj.le.2500d0) then + xjet=.true. + exit + endif + else if (xyj.lt.1.5d0) then + if (xptj.le.1992d0) then + xjet=.true. + exit + endif + else if (xyj.lt.2.0d0) then + if (xptj.le.1310d0) then + xjet=.true. + exit + endif + else if (xyj.lt.2.5d0) then + if (xptj.le.838d0) then + xjet=.true. + exit + endif + else if (xyj.lt.3.0d0) then + if (xptj.le.556d0) then + xjet=.true. + exit + endif + endif + enddo + + if (.not. xjet) then + passcuts_user=.false. + return + endif + endif + diff --git a/run/cuts_code/atlas_2jet_7tev_r06.f b/run/cuts_code/atlas_2jet_7tev_r06.f new file mode 100644 index 00000000..398b3ec9 --- /dev/null +++ b/run/cuts_code/atlas_2jet_7tev_r06.f @@ -0,0 +1,47 @@ +c + if ({}) then + if (njet.lt.2) then + passcuts_user=.false. + return + endif + + xystar = 0.5d0 * dabs(atanh(pjet(3,1)/pjet(0,1))- + $ atanh(pjet(3,2)/pjet(0,2))) + xmjj = sqrt(invm2_04(pjet(0,1),pjet(0,2),1d0)) + + if (xystar.lt.0.5d0) then + if (xmjj.lt.260d0 .or. xmjj.gt.4270d0) then + passcuts_user=.false. + return + endif + else if (xystar.lt.1.0d0) then + if (xmjj.lt.310d0 .or. xmjj.gt.4270d0) then + passcuts_user=.false. + return + endif + else if (xystar.lt.1.5d0) then + if (xmjj.lt.510d0 .or. xmjj.gt.4640d0) then + passcuts_user=.false. + return + endif + else if (xystar.lt.2.0d0) then + if (xmjj.lt.760d0 .or. xmjj.gt.4640d0) then + passcuts_user=.false. + return + endif + else if (xystar.lt.2.5d0) then + if (xmjj.lt.1310d0 .or. xmjj.gt.5040d0) then + passcuts_user=.false. + return + endif + else if (xystar.lt.3.0d0) then + if (xmjj.lt.2120d0 .or. xmjj.gt.5040d0) then + passcuts_user=.false. + return + endif + else + passcuts_user=.false. + return + endif + endif + diff --git a/run/cuts_code/atlas_dy3d_8tev.f b/run/cuts_code/atlas_dy3d_8tev.f new file mode 100644 index 00000000..ff051a83 --- /dev/null +++ b/run/cuts_code/atlas_dy3d_8tev.f @@ -0,0 +1,131 @@ +c + if ({}) then + do j = nincoming+1, nexternal + if (iPDG_reco(j).eq.13) ppl(0:3)=p_reco(0:3,j) + if (iPDG_reco(j).eq.-13) pplb(0:3)=p_reco(0:3,j) + enddo + + p1p = ppl(0) + ppl(3) + p1m = ppl(0) - ppl(3) + p2p = pplb(0) + pplb(3) + p2m = pplb(0) - pplb(3) + pzll = ppl(3) + pplb(3) + pt2ll = (ppl(1) + pplb(1)) * (ppl(1) + pplb(1)) + + & (ppl(2) + pplb(2)) * (ppl(2) + pplb(2)) + + xmll=sqrt((ppl(0)+pplb(0))**2-(ppl(1)+pplb(1))**2- + & (ppl(2)+pplb(2))**2-(ppl(3)+pplb(3))**2) + xyll=abs(atanh((ppl(3)+pplb(3))/(ppl(0)+pplb(0)))) + xcos = sign((p1p*p2m-p1m*p2p)/sqrt(xmll*xmll+pt2ll)/xmll,pzll) + + if (xmll.lt.46d0) then + passcuts_user=.false. + return + elseif (xmll.lt.66d0) then + if (xcos.lt.-0.7d0) then + xlimit=2.0d0 + elseif (xcos.lt.-0.4d0) then + xlimit=2.2d0 + elseif (xcos.lt.0.0d0) then + xlimit=2.4d0 + elseif (xcos.lt.0.4d0) then + xlimit=2.4d0 + elseif (xcos.lt.0.7d0) then + xlimit=2.2d0 + else + xlimit=2.0d0 + endif + elseif (xmll.lt.80d0) then + if (xcos.lt.-0.7d0) then + xlimit=2.0d0 + elseif (xcos.lt.-0.4d0) then + xlimit=2.2d0 + elseif (xcos.lt.0.0d0) then + xlimit=2.4d0 + elseif (xcos.lt.0.4d0) then + xlimit=2.4d0 + elseif (xcos.lt.0.7d0) then + xlimit=2.2d0 + else + xlimit=2.0d0 + endif + elseif (xmll.lt.91d0) then + if (xcos.lt.-0.7d0) then + xlimit=2.2d0 + elseif (xcos.lt.-0.4d0) then + xlimit=2.2d0 + elseif (xcos.lt.0.0d0) then + xlimit=2.4d0 + elseif (xcos.lt.0.4d0) then + xlimit=2.4d0 + elseif (xcos.lt.0.7d0) then + xlimit=2.2d0 + else + xlimit=2.2d0 + endif + elseif (xmll.lt.102d0) then + if (xcos.lt.-0.7d0) then + xlimit=2.2d0 + elseif (xcos.lt.-0.4d0) then + xlimit=2.2d0 + elseif (xcos.lt.0.0d0) then + xlimit=2.4d0 + elseif (xcos.lt.0.4d0) then + xlimit=2.4d0 + elseif (xcos.lt.0.7d0) then + xlimit=2.2d0 + else + xlimit=2.2d0 + endif + elseif (xmll.lt.116d0) then + if (xcos.lt.-0.7d0) then + xlimit=2.0d0 + elseif (xcos.lt.-0.4d0) then + xlimit=2.2d0 + elseif (xcos.lt.0.0d0) then + xlimit=2.4d0 + elseif (xcos.lt.0.4d0) then + xlimit=2.4d0 + elseif (xcos.lt.0.7d0) then + xlimit=2.2d0 + else + xlimit=2.0d0 + endif + elseif (xmll.lt.150d0) then + if (xcos.lt.-0.7d0) then + xlimit=1.8d0 + elseif (xcos.lt.-0.4d0) then + xlimit=2.2d0 + elseif (xcos.lt.0.0d0) then + xlimit=2.4d0 + elseif (xcos.lt.0.4d0) then + xlimit=2.4d0 + elseif (xcos.lt.0.7d0) then + xlimit=2.2d0 + else + xlimit=1.8d0 + endif + elseif (xmll.lt.200d0) then + if (xcos.lt.-0.7d0) then + xlimit=1.6d0 + elseif (xcos.lt.-0.4d0) then + xlimit=2.0d0 + elseif (xcos.lt.0.0d0) then + xlimit=2.4d0 + elseif (xcos.lt.0.4d0) then + xlimit=2.4d0 + elseif (xcos.lt.0.7d0) then + xlimit=2.0d0 + else + xlimit=1.6d0 + endif + else + passcuts_user=.false. + return + endif + + if (xyll.gt.xlimit) then + passcuts_user=.false. + return + endif + endif diff --git a/run/cuts_code/atlas_wzrap11_cf.f b/run/cuts_code/atlas_wzrap11_cf.f new file mode 100644 index 00000000..69d9749e --- /dev/null +++ b/run/cuts_code/atlas_wzrap11_cf.f @@ -0,0 +1,34 @@ +c + if ({}) then + do i = nincoming+1, nexternal + if (iPDG_reco(i).eq.13) then + ppl(0:4)=p_reco(0:4,i) + xeta1=abs(eta_04(p_reco(0,i))) + elseif (iPDG_reco(i).eq.-13) then + pplb(0:4)=p_reco(0:4,i) + xeta2=abs(eta_04(p_reco(0,i))) + endif + enddo + + xyll=abs(atanh((ppl(3)+pplb(3))/(ppl(0)+pplb(0)))) + + if (xyll.lt.1.2d0 .or. xyll.gt.3.6d0) then + passcuts_user=.false. + return + endif + + if (xeta1.lt.2.5d0) then + if (xeta2.lt.2.5d0 .or. xeta2.gt.4.9d0) then + passcuts_user=.false. + return + endif + elseif (xeta2.lt.2.5d0) then + if (xeta1.lt.2.5d0 .or. xeta1.gt.4.9d0) then + passcuts_user=.false. + return + endif + else + passcuts_user=.false. + return + endif + endif diff --git a/run/cuts_code/cms_2jet_3d_8tev.f b/run/cuts_code/cms_2jet_3d_8tev.f new file mode 100644 index 00000000..26bd001a --- /dev/null +++ b/run/cuts_code/cms_2jet_3d_8tev.f @@ -0,0 +1,69 @@ +c + if ({}) then + if (njet.lt.2) then + passcuts_user=.false. + return + endif + + xystar = 0.5d0 * dabs(atanh(pjet(3,1)/pjet(0,1))- + $ atanh(pjet(3,2)/pjet(0,2))) + xyboost = 0.5d0 * dabs(atanh(pjet(3,1)/pjet(0,1))+ + $ atanh(pjet(3,2)/pjet(0,2))) + xptavg = 0.5d0 * (pt_04(pjet(0,1)) + pt_04(pjet(0,2))) + + if (xptavg.lt.133d0) then + passcuts_user=.false. + return + endif + + if (xyboost.lt.1d0) then + if (xystar.lt.1d0) then + if (xptavg.gt.1784d0) then + passcuts_user=.false. + return + endif + elseif (xystar.lt.2d0) then + if (xptavg.gt.1248d0) then + passcuts_user=.false. + return + endif + elseif (xystar.lt.3d0) then + if (xptavg.gt.548d0) then + passcuts_user=.false. + return + endif + else + passcuts_user=.false. + return + endif + else if (xyboost.lt.2d0) then + if (xystar.lt.1d0) then + if (xptavg.gt.1032d0) then + passcuts_user=.false. + return + endif + elseif (xystar.lt.2d0) then + if (xptavg.gt.686d0) then + passcuts_user=.false. + return + endif + else + passcuts_user=.false. + return + endif + else if (xyboost.lt.3d0) then + if (xystar.lt.1d0) then + if (xptavg.gt.430d0) then + passcuts_user=.false. + return + endif + else + passcuts_user=.false. + return + endif + else + passcuts_user=.false. + return + endif + endif + diff --git a/run/cuts_code/cms_2jets_7tev.f b/run/cuts_code/cms_2jets_7tev.f new file mode 100644 index 00000000..bec33959 --- /dev/null +++ b/run/cuts_code/cms_2jets_7tev.f @@ -0,0 +1,42 @@ +c + if ({}) then + if (njet.lt.2) then + passcuts_user=.false. + return + endif + + xymax = max(dabs(atanh(pjet(3,1)/pjet(0,1))), + $ dabs(atanh(pjet(3,2)/pjet(0,2)))) + xmjj = sqrt(invm2_04(pjet(0,1),pjet(0,2),1d0)) + + if (xymax.lt.0.5d0) then + if (xmjj.lt.197d0 .or. xmjj.gt.4010d0) then + passcuts_user=.false. + return + endif + else if (xymax.lt.1.0d0) then + if (xmjj.lt.270d0 .or. xmjj.gt.4010d0) then + passcuts_user=.false. + return + endif + else if (xymax.lt.1.5d0) then + if (xmjj.lt.419d0 .or. xmjj.gt.4509d0) then + passcuts_user=.false. + return + endif + else if (xymax.lt.2.0d0) then + if (xmjj.lt.565d0 .or. xmjj.gt.5058d0) then + passcuts_user=.false. + return + endif + else if (xymax.lt.2.5d0) then + if (xmjj.lt.1000d0 .or. xmjj.gt.5058d0) then + passcuts_user=.false. + return + endif + else + passcuts_user=.false. + return + endif + endif + diff --git a/run/cuts_code/dyjj.f b/run/cuts_code/dyjj.f new file mode 100644 index 00000000..5b01e59e --- /dev/null +++ b/run/cuts_code/dyjj.f @@ -0,0 +1,8 @@ +c cut on the rapidity separation of the leading jets + tmpvar=atanh(pjet(3,1)/pjet(0,1)) + & -atanh(pjet(3,2)/pjet(0,2)) + if (abs(tmpvar) .lt. {}) then + passcuts_user=.false. + return + endif + diff --git a/run/cuts_code/minetal.f b/run/cuts_code/minetal.f new file mode 100644 index 00000000..aafbceaf --- /dev/null +++ b/run/cuts_code/minetal.f @@ -0,0 +1,11 @@ +c cut on the minimum pseudorapidity of leptons + do i=1,nexternal-1 + if (is_a_lm(i) .or. is_a_lp(i)) then + if (abs(atanh(p_reco(3,i)/sqrt(p_reco(1,i)**2+p_reco(2,i)**2+ + & p_reco(3,i)**2))) .lt. {}) then + passcuts_user=.false. + return + endif + endif + enddo + diff --git a/run/cuts_code/mjj.f b/run/cuts_code/mjj.f new file mode 100644 index 00000000..037952f6 --- /dev/null +++ b/run/cuts_code/mjj.f @@ -0,0 +1,6 @@ +c cut on the invariant mass of the leading jets + if (invm2_04(pjet(0,1),pjet(0,2),1d0) .lt. ({})**2) then + passcuts_user=.false. + return + endif + diff --git a/run/cuts_code/mmllmax.f b/run/cuts_code/mmllmax.f new file mode 100644 index 00000000..347e10d1 --- /dev/null +++ b/run/cuts_code/mmllmax.f @@ -0,0 +1,14 @@ +c cut for mmllmax (SFOS lepton pairs) + do i=1,nexternal-1 + if (is_a_lm(i) .or. is_a_lp(i)) then + do j=i+1,nexternal + if (ipdg_reco(i) .eq. -ipdg_reco(j)) then + if (invm2_04(p_reco(0,i),p_reco(0,j),1d0) .gt. {}**2) then + passcuts_user=.false. + return + endif + endif + enddo + endif + enddo + diff --git a/run/cuts_code/mtw.f b/run/cuts_code/mtw.f new file mode 100644 index 00000000..73d535a1 --- /dev/null +++ b/run/cuts_code/mtw.f @@ -0,0 +1,18 @@ +c cut on the transverse mass of W bosons + do i=3,nexternal + do j=i+1,nexternal + if (is_a_lm(i) .or. is_a_lp(i) .or. + & is_a_lm(j) .or. is_a_lp(j)) then + if (abs(ipdg_reco(i)+ipdg_reco(j)).eq.1) then + xmtw=2d0*sqrt((p_reco(1,i)**2+p_reco(2,i)**2)* + & (p_reco(1,j)**2+p_reco(2,j)**2))- + & 2d0*(p_reco(1,i)*p_reco(1,j)+p_reco(2,i)*p_reco(2,j)) + if (xmtw.lt.(({})**2)) then + passcuts_user=.false. + return + endif + endif + endif + enddo + enddo + diff --git a/run/cuts_code/ptj1min.f b/run/cuts_code/ptj1min.f new file mode 100644 index 00000000..78e07ff6 --- /dev/null +++ b/run/cuts_code/ptj1min.f @@ -0,0 +1,6 @@ +c cut for ptl1min (leading jet) + if (pt(pjet(0,1)) .lt. {}) then + passcuts_user=.false. + return + endif + diff --git a/run/cuts_code/ptl1min.f b/run/cuts_code/ptl1min.f new file mode 100644 index 00000000..081baf16 --- /dev/null +++ b/run/cuts_code/ptl1min.f @@ -0,0 +1,14 @@ +c cut for ptl1min (leading lepton) + j = 0 + do i=1,nexternal + if (is_a_lm(i) .or. is_a_lp(i)) then + if (j.eq.0 .or. pt_04(p_reco(0,i)).ge.pt_04(p_reco(0,j))) then + j = i + endif + endif + enddo + if (pt_04(p_reco(0,j)) .lt. {}) then + passcuts_user=.false. + return + endif + diff --git a/run/cuts_code/ptmiss.f b/run/cuts_code/ptmiss.f new file mode 100644 index 00000000..26578514 --- /dev/null +++ b/run/cuts_code/ptmiss.f @@ -0,0 +1,17 @@ +c cut on the sum of all missing transverse momentum + xptmiss=0d0 + + do i=3,nexternal + if (abs(ipdg_reco(i)).eq.12 .or. + & abs(ipdg_reco(i)).eq.14 .or. + & abs(ipdg_reco(i)).eq.16) then + xptmiss(1)=xptmiss(1)+p_reco(1,i) + xptmiss(2)=xptmiss(2)+p_reco(2,i) + endif + enddo + + if (xptmiss(1)**2+xptmiss(2)**2.lt.(({})**2)) then + passcuts_user=.false. + return + endif + diff --git a/run/cuts_code/ptzmax.f b/run/cuts_code/ptzmax.f new file mode 100644 index 00000000..02be2c5c --- /dev/null +++ b/run/cuts_code/ptzmax.f @@ -0,0 +1,15 @@ +c cut on the pt of SFOS lepton pairs + do i=1,nexternal-1 + if (is_a_lm(i) .or. is_a_lp(i)) then + do j=i+1,nexternal + if (ipdg_reco(i) .eq. -ipdg_reco(j)) then + if (((p_reco(1,i)+p_reco(1,j))**2+ + & (p_reco(2,i)+p_reco(2,j))**2) .gt. {}**2) then + passcuts_user=.false. + return + endif + endif + enddo + endif + enddo + diff --git a/run/cuts_code/ptzmin.f b/run/cuts_code/ptzmin.f new file mode 100644 index 00000000..0bc3f3ce --- /dev/null +++ b/run/cuts_code/ptzmin.f @@ -0,0 +1,15 @@ +c cut on the pt of SFOS lepton pairs + do i=1,nexternal-1 + if (is_a_lm(i) .or. is_a_lp(i)) then + do j=i+1,nexternal + if (ipdg_reco(i) .eq. -ipdg_reco(j)) then + if (((p_reco(1,i)+p_reco(1,j))**2+ + & (p_reco(2,i)+p_reco(2,j))**2) .lt. {}**2) then + passcuts_user=.false. + return + endif + endif + enddo + endif + enddo + diff --git a/run/cuts_code/yh.f b/run/cuts_code/yh.f new file mode 100644 index 00000000..3de158a8 --- /dev/null +++ b/run/cuts_code/yh.f @@ -0,0 +1,11 @@ +c cut on Higgs particles + do i=1,nexternal + if (ipdg_reco(i) .eq. 25) then + if (abs(atanh(p_reco(3,i)/p_reco(0,i))) + & .gt. {}) then + passcuts_user=.false. + return + endif + endif + enddo + diff --git a/run/cuts_code/yll.f b/run/cuts_code/yll.f new file mode 100644 index 00000000..a81d59b9 --- /dev/null +++ b/run/cuts_code/yll.f @@ -0,0 +1,29 @@ +c cut on the rapidity of the two leading leptons + j = 0 ! leading lepton index + mm = 0 ! subleading lepton index + do i=1,nexternal + if (is_a_lm(i) .or. is_a_lp(i)) then + tmpvar = pt_04(p_reco(0,i)) + if (j.eq.0) then + j = i + else if (mm.eq.0) then + if (tmpvar.ge.pt_04(p_reco(0,j))) then + mm = j + j = i + else if (tmpvar.ge.pt_04(p_reco(0,mm))) then + mm = i + endif + else if (tmpvar.ge.pt_04(p_reco(0,j))) then + mm = j + j = i + else if (tmpvar.ge.pt_04(p_reco(0,mm))) then + mm = i + endif + endif + enddo + if (abs(atanh((p_reco(3,j)+p_reco(3,mm)) + & /(p_reco(0,j)+p_reco(0,mm)))) .gt. {}) then + passcuts_user=.false. + return + endif + diff --git a/run/cuts_code/yt.f b/run/cuts_code/yt.f new file mode 100644 index 00000000..02483ee8 --- /dev/null +++ b/run/cuts_code/yt.f @@ -0,0 +1,11 @@ +c cut on top particles + do i=1,nexternal + if (ipdg_reco(i).eq.6 .or. ipdg_reco(i).eq.-6) then + if (abs(atanh(p_reco(3,i)/p_reco(0,i))) + & .gt. {}) then + passcuts_user=.false. + return + endif + endif + enddo + diff --git a/run/cuts_code/yz.f b/run/cuts_code/yz.f new file mode 100644 index 00000000..3c4dfca1 --- /dev/null +++ b/run/cuts_code/yz.f @@ -0,0 +1,15 @@ +c cut on the rapidity of SFOS lepton pairs + do i=1,nexternal-1 + if (is_a_lm(i) .or. is_a_lp(i)) then + do j=i+1,nexternal + if (ipdg_reco(i) .eq. -ipdg_reco(j)) then + if (abs(atanh((p_reco(3,i)+p_reco(3,j)) + & /(p_reco(0,i)+p_reco(0,j)))) .gt. {}) then + passcuts_user=.false. + return + endif + endif + enddo + endif + enddo + diff --git a/run/cuts_code/yzmin.f b/run/cuts_code/yzmin.f new file mode 100644 index 00000000..a4fe66f0 --- /dev/null +++ b/run/cuts_code/yzmin.f @@ -0,0 +1,15 @@ +c cut on the rapidity of SFOS lepton pairs + do i=1,nexternal-1 + if (is_a_lm(i) .or. is_a_lp(i)) then + do j=i+1,nexternal + if (ipdg_reco(i) .eq. -ipdg_reco(j)) then + if (abs(atanh((p_reco(3,i)+p_reco(3,j)) + & /(p_reco(0,i)+p_reco(0,j)))) .lt. {}) then + passcuts_user=.false. + return + endif + endif + enddo + endif + enddo + diff --git a/run/cuts_variables/abscoscs.f b/run/cuts_variables/abscoscs.f new file mode 100644 index 00000000..fa503217 --- /dev/null +++ b/run/cuts_variables/abscoscs.f @@ -0,0 +1,4 @@ +c variables for abscoscs cuts + real*8 zcoscs,zenl,zptxl,zptyl,zpzl,zenal,zptxal,zptyal,zpzal + real*8 zpzll,zmll,zp1p,zp1m,zp2p,zp2m,zpt2ll + integer zlep,zalep diff --git a/run/cuts_variables/atlas_1jet_8tev_r06.f b/run/cuts_variables/atlas_1jet_8tev_r06.f new file mode 100644 index 00000000..328964e3 --- /dev/null +++ b/run/cuts_variables/atlas_1jet_8tev_r06.f @@ -0,0 +1,3 @@ +c variables for atlas_1jet_8tev_r06 cuts + real*8 xptj,xyj + logical xjet diff --git a/run/cuts_variables/atlas_2jet_7tev_r06.f b/run/cuts_variables/atlas_2jet_7tev_r06.f new file mode 100644 index 00000000..1a08f4de --- /dev/null +++ b/run/cuts_variables/atlas_2jet_7tev_r06.f @@ -0,0 +1,2 @@ +c + real*8 xystar,xmjj diff --git a/run/cuts_variables/atlas_dy3d_8tev.f b/run/cuts_variables/atlas_dy3d_8tev.f new file mode 100644 index 00000000..cdf8e7db --- /dev/null +++ b/run/cuts_variables/atlas_dy3d_8tev.f @@ -0,0 +1,4 @@ +c variables for atlas_dy3d_8tev cut + real*8 ppl(0:3),pplb(0:3) + real*8 p1p,p1m,p2p,p2m,pzll,pt2ll + real*8 xmll,xyll,xcos,xlimit diff --git a/run/cuts_variables/atlas_wzrap11_cf.f b/run/cuts_variables/atlas_wzrap11_cf.f new file mode 100644 index 00000000..704e64ec --- /dev/null +++ b/run/cuts_variables/atlas_wzrap11_cf.f @@ -0,0 +1,3 @@ +c variables for atlas_wzrap11_cf cut + real*8 ppl(0:4),pplb(0:4) + real*8 xyll,xeta1,xeta2 diff --git a/run/cuts_variables/cms_2jet_3d_8tev.f b/run/cuts_variables/cms_2jet_3d_8tev.f new file mode 100644 index 00000000..f940c209 --- /dev/null +++ b/run/cuts_variables/cms_2jet_3d_8tev.f @@ -0,0 +1,2 @@ +c + real*8 xystar,xyboost,xptavg diff --git a/run/cuts_variables/cms_2jets_7tev.f b/run/cuts_variables/cms_2jets_7tev.f new file mode 100644 index 00000000..f69c5731 --- /dev/null +++ b/run/cuts_variables/cms_2jets_7tev.f @@ -0,0 +1,2 @@ +c variables for cms_2jets_7tev cuts + real*8 xymax,xmjj diff --git a/run/cuts_variables/mtw.f b/run/cuts_variables/mtw.f new file mode 100644 index 00000000..78598c84 --- /dev/null +++ b/run/cuts_variables/mtw.f @@ -0,0 +1,2 @@ +c variables for ptmiss cut + real*8 xmtw diff --git a/run/cuts_variables/ptmiss.f b/run/cuts_variables/ptmiss.f new file mode 100644 index 00000000..c0d732f9 --- /dev/null +++ b/run/cuts_variables/ptmiss.f @@ -0,0 +1,2 @@ +c variables for ptmiss cut + real*8 xptmiss(1:2) From b3f23d9181fbd27aa867b2294e0113419cfd35c9 Mon Sep 17 00:00:00 2001 From: Alessandro Candido Date: Wed, 25 Aug 2021 16:34:33 +0200 Subject: [PATCH 18/63] Init merge reimplementation --- run/dis_.py | 7 +- run/external/__init__.py | 0 run/external/interface.py | 15 +++ run/external/mg5.py | 190 +++++++++++++++++++++++++++ run/{external.py => external/yad.py} | 2 +- run/hadronic.py | 74 +---------- run/paths.py | 5 + 7 files changed, 220 insertions(+), 73 deletions(-) create mode 100644 run/external/__init__.py create mode 100644 run/external/interface.py create mode 100644 run/external/mg5.py rename run/{external.py => external/yad.py} (98%) diff --git a/run/dis_.py b/run/dis_.py index 6a39a478..a308d879 100644 --- a/run/dis_.py +++ b/run/dis_.py @@ -5,7 +5,8 @@ import yaml import yadism -from . import install, tools, paths, table, external +from . import install, tools, paths, table +from .external import yad @click.command() @@ -65,8 +66,6 @@ def run_dataset(name, pdf): grid_path.unlink() grid_path = cpath - table.print_table( - table.compute_data(grid_path, pdf), external.yadism_results(out, pdf) - ) + table.print_table(table.compute_data(grid_path, pdf), yad.yadism_results(out, pdf)) tools.print_time(t0, "Grid calculation") diff --git a/run/external/__init__.py b/run/external/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/run/external/interface.py b/run/external/interface.py new file mode 100644 index 00000000..57884a18 --- /dev/null +++ b/run/external/interface.py @@ -0,0 +1,15 @@ +import abc + + +class External(abc.ABC): + @abc.abstractmethod + def run(self): + pass + + @abc.abstractmethod + def postprocess(self): + pass + + @abc.abstractproperty + def results(self): + pass diff --git a/run/external/mg5.py b/run/external/mg5.py new file mode 100644 index 00000000..708a0ccc --- /dev/null +++ b/run/external/mg5.py @@ -0,0 +1,190 @@ +import subprocess +import json +import re +import shutil + +from .. import paths, tools +from . import interface + + +class Mg5(interface.External): + pass + + +def run_mc(name): + source = paths.runcards / name + dest = tools.create_folder(name) + mg5_dir = dest / name + + # copy the output file to the directory and replace the variables + output = (source / "output.txt").read_text().replace("@OUTPUT@", name) + output_file = dest / "output.txt" + output_file.write_text(output) + + # create output folder + output_log = tools.run_subprocess([str(paths.mg5_exe), str(output_file)], dest=dest) + (dest / "output.log").write_text(output_log) + + # copy patches if there are any; use xargs to properly signal failures + for p in source.iterdir(): + if p.suffix == ".patch": + subprocess.run( + "patch -p1".split(), input=p.read_text(), text=True, cwd=mg5_dir + ) + + # enforce proper analysis + # - copy analysis.f + analysis = (paths.runcards / name / "analysis.f").read_text() + (mg5_dir / "FixedOrderAnalysis" / f"{name}.f").write_text(analysis) + # - update analysis card + analysis_card = mg5_dir / "Cards" / "FO_analyse_card.dat" + analysis_card.write_text( + analysis_card.read_text().replace("analysis_HwU_template", name) + ) + + # copy the launch file to the directory and replace the variables + launch = (source / "launch.txt").read_text().replace("@OUTPUT@", name) + + # TODO: write a list with variables that should be replaced in the launch file; for the time + # being we create the file here, but in the future it should be read from the theory database + variables = json.loads((paths.pkg / "variables.json").read_text()) + + # replace the variables with their values + for name, value in variables.items(): + launch = launch.replace(f"@{name}@", value) + + # perform simple arithmetic on lines containing 'set' and '=' and arithmetic operators + # interpreter = asteval.Interpreter() # use asteval for safety + # lines = [] + # pattern = re.compile(r"(set [\w_]* = )(.*)") + # for line in launch.splitlines(): + # m = re.fullmatch(pattern, line) + # if m is not None: + # line = m[1] + str(interpreter.eval(m[2])) + # lines.append(line) + # launch = "\n".join(lines) + + # finally write launch + launch_file = dest / "launch.txt" + launch_file.write_text(launch) + + user_cuts_pattern = re.compile( + r"^#user_defined_cut set (\w+)\s+=\s+([+-]?\d+(?:\.\d+)?|True|False)$" + ) + user_cuts = [] + for line in launch.splitlines(): + m = re.fullmatch(user_cuts_pattern, line) + if m is not None: + user_cuts.append((m[1], m[2])) + + apply_user_cuts(mg5_dir / "SubProcesses" / "cuts.f", user_cuts) + + # launch run + launch_log = tools.run_subprocess([str(paths.mg5_exe), str(launch_file)], dest=dest) + (dest / "launch.log").write_text(launch_log) + + return dest + + +def find_marker_position(insertion_marker, contents): + marker_pos = -1 + + for lineno, value in enumerate(contents): + if insertion_marker in value: + marker_pos = lineno + break + + if marker_pos == -1: + raise ValueError( + "Error: could not find insertion marker `{insertion_marker}` in cut file `{file_path}`" + ) + + return marker_pos + + +def apply_user_cuts(file_path, user_cuts): + with open(file_path, "r") as fd: + contents = fd.readlines() + + # insert variable declaration + marker_pos = find_marker_position("logical function passcuts_user", contents) + marker_pos = marker_pos + 8 + + for fname in paths.cuts_variables.iterdir(): + name = fname.stem + if any(i[0].startswith(name) for i in user_cuts): + contents.insert(marker_pos, fname.read_text()) + + marker_pos = find_marker_position("USER-DEFINED CUTS", contents) + # skip some lines with comments + marker_pos = marker_pos + 4 + # insert and empty line + contents.insert(marker_pos - 1, "\n") + + for name, value in reversed(user_cuts): + # map to fortran syntax + if value == "True": + value = ".true." + elif value == "False": + value = ".false." + else: + try: + float(value) + except ValueError: + raise ValueError(f"Error: format of value `{value}` not understood") + + value = value + "d0" + + code = (paths.cuts_code / f"{name}.f").read_text().format(value) + contents.insert(marker_pos, code) + + with open(file_path, "w") as fd: + fd.writelines(contents) + + +def merge(name, dest): + source = paths.runcards / name + mg5_dir = dest / name + grid = dest / f"{name}.pineappl" + gridtmp = dest / f"{name}.pineappl.tmp" + + # merge the final bins + mg5_grids = " ".join( + str(p) for p in dest.glob("Events/run_01*/amcblast_obs_*.pineappl") + ) + subprocess.run(f"pineappl merge {grid} {mg5_grids}".split()) + + # optimize the grids + subprocess.run(f"pineappl optimize {grid} {gridtmp}".split()) + shutil.move(gridtmp, grid) + + # add metadata + metadata = source / "metadata.txt" + runcard = next(iter(mg5_dir.glob("Events/run_01*/run_01*_tag_1_banner.txt"))) + entries = "" + if metadata.exists(): + for line in metadata.read_text().splitlines(): + k, v = line.split("=") + entries += f"--entry {k} '{v}' " + subprocess.run( + f"pineappl set {grid} {gridtmp}".split() + + entries.split() + + f"--entry_from_file runcard {runcard}".split() + ) + shutil.move(gridtmp, grid) + + # find out which PDF set was used to generate the predictions + pdf = re.search(r"set lhaid (\d+)", (dest / "launch.txt").read_text())[1] + + # (re-)produce predictions + with open(dest / "pineappl.convolute", "w") as fd: + subprocess.run( + f"pineappl convolute {grid} {pdf} --scales 9 --absolute --integrated".split(), + stdout=fd, + ) + with open(dest / "pineappl.orders", "w") as fd: + subprocess.run(f"pineappl orders {grid} {pdf} --absolute".split(), stdout=fd) + with open(dest / "pineappl.pdf_uncertainty", "w") as fd: + subprocess.run( + f"pineappl pdf_uncertainty --threads=1 {grid} {pdf}".split(), stdout=fd + ) diff --git a/run/external.py b/run/external/yad.py similarity index 98% rename from run/external.py rename to run/external/yad.py index 81dbca59..a2fc51fc 100644 --- a/run/external.py +++ b/run/external/yad.py @@ -3,7 +3,7 @@ import lhapdf import pandas as pd -from . import tools +from .. import tools def yadism_results(out, pdf_name): diff --git a/run/hadronic.py b/run/hadronic.py index d5e41724..43905b85 100644 --- a/run/hadronic.py +++ b/run/hadronic.py @@ -1,16 +1,10 @@ import time -import pathlib -import subprocess -import json -import re import click import rich -import asteval from . import install, paths, tools - -root = pathlib.Path(__file__).absolute().parents[1] +from .external import mg5 @click.command() @@ -28,8 +22,9 @@ def hadronic(datasets, pdf): def load_datasets(): - proc = root / "nnpdf31_proc" - hadronic_sets = [p for p in proc.iterdir() if not (p / "observable.yaml").is_file()] + hadronic_sets = [ + p for p in paths.runcards.iterdir() if not (p / "observable.yaml").is_file() + ] return hadronic_sets @@ -46,64 +41,7 @@ def install_reqs(): def run_dataset(name, pdf): t0 = time.perf_counter() - source = paths.runcards / name - dest = tools.create_folder(name) - mg5_dir = dest / name - - # copy the output file to the directory and replace the variables - output = (source / "output.txt").read_text().replace("@OUTPUT@", name) - output_file = dest / "output.txt" - output_file.write_text(output) - - # create output folder - output_log = tools.run_subprocess([str(paths.mg5_exe), str(output_file)], dest=dest) - (dest / "output.log").write_text(output_log) - - # copy patches if there are any; use xargs to properly signal failures - for p in source.iterdir(): - if p.suffix == ".patch": - subprocess.run( - "patch -p1".split(), input=p.read_text(), text=True, cwd=mg5_dir - ) - - # enforce proper analysis - # - copy analysis.f - analysis = (paths.runcards / name / "analysis.f").read_text() - (mg5_dir / "FixedOrderAnalysis" / f"{name}.f").write_text(analysis) - # - update analysis card - analysis_card = mg5_dir / "Cards" / "FO_analyse_card.dat" - analysis_card.write_text( - analysis_card.read_text().replace("analysis_HwU_template", name) - ) - - # copy the launch file to the directory and replace the variables - launch = (source / "launch.txt").read_text().replace("@OUTPUT@", name) - launch_file = dest / "launch.txt" - - # TODO: write a list with variables that should be replaced in the launch file; for the time - # being we create the file here, but in the future it should be read from the theory database - variables = json.loads((paths.pkg / "variables.json").read_text()) - - # replace the variables with their values - for name, value in variables.items(): - launch = launch.replace(f"@{name}@", value) - - # perform simple arithmetic on lines containing 'set' and '=' and arithmetic operators - # interpreter = asteval.Interpreter() # use asteval for safety - # lines = [] - # pattern = re.compile(r"(set [\w_]* = )(.*)") - # for line in launch.splitlines(): - # m = re.fullmatch(pattern, line) - # if m is not None: - # line = m[1] + str(interpreter.eval(m[2])) - # lines.append(line) - # launch = "\n".join(lines) - - # finally write launch - launch_file.write_text(launch) - - # launch run - launch_log = tools.run_subprocess([str(paths.mg5_exe), str(launch_file)], dest=dest) - (dest / "launch.log").write_text(launch_log) + dest = mg5.run_mc(name) + mg5.merge(name, dest) tools.print_time(t0, "Grid calculation") diff --git a/run/paths.py b/run/paths.py index 41c0e4ac..3107eb3e 100644 --- a/run/paths.py +++ b/run/paths.py @@ -3,6 +3,11 @@ pkg = pathlib.Path(__file__).absolute().parent root = pkg.parent +# internal +cuts_code = pkg / "cuts_code" +cuts_variables = pkg / "cuts_variables" + +# external runcards = root / "nnpdf31_proc" # prefix and locally installed From e41def5122f29ff145e5f427046e297746001764 Mon Sep 17 00:00:00 2001 From: Alessandro Candido Date: Thu, 26 Aug 2021 16:31:38 +0200 Subject: [PATCH 19/63] Fix pineapplgrid generation from mg5 output grids --- run/external/mg5.py | 23 +++++++++++++---------- run/external/yad.py | 3 ++- run/paths.py | 2 ++ 3 files changed, 17 insertions(+), 11 deletions(-) diff --git a/run/external/mg5.py b/run/external/mg5.py index 708a0ccc..547bd4bd 100644 --- a/run/external/mg5.py +++ b/run/external/mg5.py @@ -147,44 +147,47 @@ def merge(name, dest): mg5_dir = dest / name grid = dest / f"{name}.pineappl" gridtmp = dest / f"{name}.pineappl.tmp" + pineappl = paths.pineappl_exe() # merge the final bins mg5_grids = " ".join( - str(p) for p in dest.glob("Events/run_01*/amcblast_obs_*.pineappl") + sorted(str(p) for p in mg5_dir.glob("Events/run_01*/amcblast_obs_*.pineappl")) ) - subprocess.run(f"pineappl merge {grid} {mg5_grids}".split()) + subprocess.run(f"{pineappl} merge {grid} {mg5_grids}".split()) # optimize the grids - subprocess.run(f"pineappl optimize {grid} {gridtmp}".split()) + subprocess.run(f"{pineappl} optimize {grid} {gridtmp}".split()) shutil.move(gridtmp, grid) # add metadata metadata = source / "metadata.txt" runcard = next(iter(mg5_dir.glob("Events/run_01*/run_01*_tag_1_banner.txt"))) - entries = "" + entries = [] if metadata.exists(): for line in metadata.read_text().splitlines(): k, v = line.split("=") - entries += f"--entry {k} '{v}' " + entries += ["--entry", k, f"'{v}'"] subprocess.run( - f"pineappl set {grid} {gridtmp}".split() - + entries.split() + f"{pineappl} set {grid} {gridtmp}".split() + + entries + f"--entry_from_file runcard {runcard}".split() ) shutil.move(gridtmp, grid) + __import__("pdb").set_trace() + # find out which PDF set was used to generate the predictions pdf = re.search(r"set lhaid (\d+)", (dest / "launch.txt").read_text())[1] # (re-)produce predictions with open(dest / "pineappl.convolute", "w") as fd: subprocess.run( - f"pineappl convolute {grid} {pdf} --scales 9 --absolute --integrated".split(), + f"{pineappl} convolute {grid} {pdf} --scales 9 --absolute --integrated".split(), stdout=fd, ) with open(dest / "pineappl.orders", "w") as fd: - subprocess.run(f"pineappl orders {grid} {pdf} --absolute".split(), stdout=fd) + subprocess.run(f"{pineappl} orders {grid} {pdf} --absolute".split(), stdout=fd) with open(dest / "pineappl.pdf_uncertainty", "w") as fd: subprocess.run( - f"pineappl pdf_uncertainty --threads=1 {grid} {pdf}".split(), stdout=fd + f"{pineappl} pdf_uncertainty --threads=1 {grid} {pdf}".split(), stdout=fd ) diff --git a/run/external/yad.py b/run/external/yad.py index a2fc51fc..ccaab9c3 100644 --- a/run/external/yad.py +++ b/run/external/yad.py @@ -1,12 +1,13 @@ from functools import reduce -import lhapdf import pandas as pd from .. import tools def yadism_results(out, pdf_name): + import lhapdf + pdf = lhapdf.mkPDF(pdf_name) pdf_out = out.apply_pdf_alphas_alphaqed_xir_xif( pdf, diff --git a/run/paths.py b/run/paths.py index 3107eb3e..934f0cbe 100644 --- a/run/paths.py +++ b/run/paths.py @@ -1,4 +1,5 @@ import pathlib +import shutil pkg = pathlib.Path(__file__).absolute().parent root = pkg.parent @@ -18,6 +19,7 @@ mg5_exe = mg5amc / "bin" / "mg5_aMC" pineappl = prefix / "pineappl" cargo = prefix / "cargo" +pineappl_exe = lambda: pathlib.Path(shutil.which("pineappl")) # tmp rust_init = pathlib.Path("/tmp/rustup-init") From eb53e35d0bf584a655df8173564ac6190023b5ad Mon Sep 17 00:00:00 2001 From: Alessandro Candido Date: Thu, 26 Aug 2021 18:40:08 +0200 Subject: [PATCH 20/63] Annotate grid with sw versions --- run/external/mg5.py | 73 +++++++++++++++++++++++++++++++++++++++++++-- run/hadronic.py | 9 ++++-- 2 files changed, 78 insertions(+), 4 deletions(-) diff --git a/run/external/mg5.py b/run/external/mg5.py index 547bd4bd..e28f49ed 100644 --- a/run/external/mg5.py +++ b/run/external/mg5.py @@ -2,6 +2,11 @@ import json import re import shutil +import io +import os + +import pandas as pd +import pygit2 from .. import paths, tools from . import interface @@ -174,8 +179,6 @@ def merge(name, dest): ) shutil.move(gridtmp, grid) - __import__("pdb").set_trace() - # find out which PDF set was used to generate the predictions pdf = re.search(r"set lhaid (\d+)", (dest / "launch.txt").read_text())[1] @@ -191,3 +194,69 @@ def merge(name, dest): subprocess.run( f"{pineappl} pdf_uncertainty --threads=1 {grid} {pdf}".split(), stdout=fd ) + + return grid, pdf + + +def results(dest, mg5_dir): + madatnlo = next(iter(mg5_dir.glob("Events/run_01*/MADatNLO.HwU"))).read_text() + table = list( + filter( + lambda line: re.match("^ [+-]", line) is not None, madatnlo.splitlines() + ) + ) + res = io.StringIO("\n".join(table)) + __import__("pdb").set_trace() + df = pd.read_csv(res, header=list(range(len(table[0].split())))) + + +def annotate_versions(name, dest): + grid = dest / f"{name}.pineappl" + gridtmp = dest / f"{name}.pineappl.tmp" + results_log = dest / "results.log" + pineappl = paths.pineappl_exe() + + runcard_gitversion = pygit2.Repository(paths.root).describe( + always_use_long_format=True, + describe_strategy=pygit2.GIT_DESCRIBE_TAGS, + dirty_suffix="-dirty", + show_commit_oid_as_fallback=True, + ) + mg5amc_revno = ( + subprocess.run("brz revno".split(), cwd=paths.mg5amc, stdout=subprocess.PIPE) + .stdout.decode() + .strip() + ) + mg5amc_repo = ( + subprocess.run("brz info".split(), cwd=paths.mg5amc, stdout=subprocess.PIPE) + .stdout.decode() + .strip() + ) + mg5amc_repo = re.search(r"\s*parent branch:\s*(.*)", mg5amc_repo)[1] + + entries = [] + entries += ["--entries", "runcard_gitversion", runcard_gitversion] + entries += ["--entries", "mg5amc_revno", mg5amc_revno] + entries += ["--entries", "mg5amc_repo", mg5amc_repo] + entries += ["--entries", "lumi_id_types", "pdg_mc_ids"] + subprocess.run( + f"{pineappl} set {grid} {gridtmp}".split() + + f"--entry_from_file results {results_log}".split() + + entries + ) + shutil.move(gridtmp, grid) + + +def postrun(name, dest): + source = paths.runcards / name + mg5_dir = dest / name + grid = dest / f"{name}.pineappl" + + if os.access((source / "postrun.sh"), os.X_OK): + shutil.copy2(source / "postrun.sh", dest) + os.environ["GRID"] = str(grid) + subprocess.run("postrun.sh", cwd=dest) + + if shutil.which("lz4") is not None: + subprocess.run("lz4 -9 {grid}") + grid.unlink() diff --git a/run/hadronic.py b/run/hadronic.py index 43905b85..835a514b 100644 --- a/run/hadronic.py +++ b/run/hadronic.py @@ -3,7 +3,7 @@ import click import rich -from . import install, paths, tools +from . import install, paths, tools, table from .external import mg5 @@ -42,6 +42,11 @@ def run_dataset(name, pdf): t0 = time.perf_counter() dest = mg5.run_mc(name) - mg5.merge(name, dest) + grid, pdf = mg5.merge(name, dest) tools.print_time(t0, "Grid calculation") + + table.print_table(table.compute_data(grid, pdf), mg5.results(dest, dest / name)) + + mg5.annotate_versions(name, dest) + mg5.postrun(name, dest) From ceb508d9659ecd3bf7678c1b299fbbf1e5fe06a5 Mon Sep 17 00:00:00 2001 From: Alessandro Candido Date: Fri, 27 Aug 2021 19:21:38 +0200 Subject: [PATCH 21/63] Complete run.sh replacement --- poetry.lock | 354 ++++++++++++++++---------- pyproject.toml | 1 + run.sh | 605 ++++++++++++++++++++++---------------------- run/dis_.py | 6 +- run/external/mg5.py | 31 ++- run/hadronic.py | 7 +- run/table.py | 14 +- 7 files changed, 557 insertions(+), 461 deletions(-) diff --git a/poetry.lock b/poetry.lock index 9cc307f8..870ce872 100644 --- a/poetry.lock +++ b/poetry.lock @@ -115,7 +115,7 @@ six = "*" [[package]] name = "dulwich" -version = "0.20.24" +version = "0.20.25" description = "Python Git Library" category = "main" optional = false @@ -145,6 +145,18 @@ numpy = "*" pyyaml = "*" scipy = "*" +[[package]] +name = "fancycompleter" +version = "0.9.1" +description = "colorful TAB completion for Python prompt" +category = "dev" +optional = false +python-versions = "*" + +[package.dependencies] +pyreadline = {version = "*", markers = "platform_system == \"Windows\""} +pyrepl = ">=0.8.2" + [[package]] name = "idna" version = "3.2" @@ -155,7 +167,7 @@ python-versions = ">=3.5" [[package]] name = "importlib-metadata" -version = "4.6.1" +version = "4.7.1" description = "Read metadata from Python packages" category = "main" optional = false @@ -213,11 +225,11 @@ numpy = ">=1.15" [[package]] name = "numpy" -version = "1.21.1" +version = "1.21.2" description = "NumPy is the fundamental package for array computing with Python." category = "main" optional = false -python-versions = ">=3.7" +python-versions = ">=3.7,<3.11" [[package]] name = "packaging" @@ -232,7 +244,7 @@ pyparsing = ">=2.0.2" [[package]] name = "pandas" -version = "1.3.0" +version = "1.3.2" description = "Powerful data structures for data analysis, time series, and statistics" category = "main" optional = false @@ -254,6 +266,23 @@ category = "main" optional = false python-versions = "*" +[[package]] +name = "pdbpp" +version = "0.10.3" +description = "pdb++, a drop-in replacement for pdb" +category = "dev" +optional = false +python-versions = "*" + +[package.dependencies] +fancycompleter = ">=0.8" +pygments = "*" +wmctrl = "*" + +[package.extras] +funcsigs = ["funcsigs"] +testing = ["funcsigs", "pytest"] + [[package]] name = "pkgconfig" version = "1.5.5" @@ -317,7 +346,7 @@ cffi = ">=1.4.0" [[package]] name = "pygments" -version = "2.9.0" +version = "2.10.0" description = "Pygments is a syntax highlighting package written in Python." category = "main" optional = false @@ -344,6 +373,22 @@ category = "dev" optional = false python-versions = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*" +[[package]] +name = "pyreadline" +version = "2.1" +description = "A python implmementation of GNU readline." +category = "dev" +optional = false +python-versions = "*" + +[[package]] +name = "pyrepl" +version = "0.9.0" +description = "A library for building flexible command line interfaces" +category = "dev" +optional = false +python-versions = "*" + [[package]] name = "pytest" version = "5.4.3" @@ -396,7 +441,7 @@ python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*" [[package]] name = "regex" -version = "2021.7.6" +version = "2021.8.27" description = "Alternative regular expression module, to replace re." category = "main" optional = false @@ -422,7 +467,7 @@ use_chardet_on_py3 = ["chardet (>=3.0.2,<5)"] [[package]] name = "rich" -version = "10.6.0" +version = "10.7.0" description = "Render rich text, tables, progress bars, syntax highlighting, markdown and more to the terminal" category = "main" optional = false @@ -439,7 +484,7 @@ jupyter = ["ipywidgets (>=7.5.1,<8.0.0)"] [[package]] name = "scipy" -version = "1.7.0" +version = "1.7.1" description = "SciPy: Scientific Library for Python" category = "main" optional = false @@ -485,6 +530,14 @@ category = "main" optional = false python-versions = "*" +[[package]] +name = "wmctrl" +version = "0.4" +description = "A tool to programmatically control windows inside X" +category = "dev" +optional = false +python-versions = "*" + [[package]] name = "yadism" version = "0.7.0" @@ -516,7 +569,7 @@ testing = ["pytest (>=4.6)", "pytest-checkdocs (>=2.4)", "pytest-flake8", "pytes [metadata] lock-version = "1.1" python-versions = ">=3.7.1,<3.10" -content-hash = "2be298ddde6407aad138d2ba9f2dc9626a51ccef507b487a2ebef66a0cea684b" +content-hash = "83d9b170b9f434a913c1f3bf7377c2058f98af021e4912833f883336c78a175d" [metadata.files] atomicwrites = [ @@ -601,35 +654,39 @@ configobj = [ {file = "configobj-5.0.6.tar.gz", hash = "sha256:a2f5650770e1c87fb335af19a9b7eb73fc05ccf22144eb68db7d00cd2bcb0902"}, ] dulwich = [ - {file = "dulwich-0.20.24-cp36-cp36m-macosx_10_14_x86_64.whl", hash = "sha256:555c88a1076cd1cab12c5dac93239e63e2dc4347ae475c5ca0ea5494098eab0f"}, - {file = "dulwich-0.20.24-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:5ff59d02a4d61ee273708b85a8b370d46ea4bedd097904ab92682a2d44553284"}, - {file = "dulwich-0.20.24-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:bab10f9580372267c3385e3ab9b3939e212a713f398c410d6f1392f96d6f0ffa"}, - {file = "dulwich-0.20.24-cp36-cp36m-win_amd64.whl", hash = "sha256:3d4249dd7bd608932ff3e8362b18f9b8ad899436063f8dd395355fd345da92c3"}, - {file = "dulwich-0.20.24-cp37-cp37m-macosx_10_14_x86_64.whl", hash = "sha256:fe649f2c95c209452639075d0ccd8cad6bda960044cf9b2e6268e1ac6ed30bac"}, - {file = "dulwich-0.20.24-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:df138aa678e3c6d9c1b21fa8e591311c0871b72fca635cc3c35361a540cc3ad1"}, - {file = "dulwich-0.20.24-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:b9266eba455b399cbda79eac0a138dd80fd8af180e5dcf759d242749936eaeb3"}, - {file = "dulwich-0.20.24-cp37-cp37m-win_amd64.whl", hash = "sha256:bcd9c85ea319f7c7076de2717da0532dc99b1e4fd0bea374522af7436179f72f"}, - {file = "dulwich-0.20.24-cp38-cp38-macosx_10_14_x86_64.whl", hash = "sha256:aba891770d741613a13fc2d76972d99fff9b26a15383ad0f0bfbd3890e2b7a00"}, - {file = "dulwich-0.20.24-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8025f7249f9ed719af5cf041ac9a8de8fae0bf08875e9dcaedbccc98f4ea67a7"}, - {file = "dulwich-0.20.24-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:68cbdeae2e0c247690243c77c8b5cc671d6a091d6fbfcd43ff5eae13210e384f"}, - {file = "dulwich-0.20.24-cp38-cp38-win_amd64.whl", hash = "sha256:08a09353620981c8e9cc7ace76f71c8859bf035ae91c1b2bddb54494fe3b7638"}, - {file = "dulwich-0.20.24-cp39-cp39-macosx_10_14_x86_64.whl", hash = "sha256:3ab53d08bc8405cc99a1018e837b2866e0e1d0797999ab94bdfdc3b5369ec325"}, - {file = "dulwich-0.20.24-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:fc97a857b274f5ed41f73c4593e665924a38f613835cfd72c55393a710a64a49"}, - {file = "dulwich-0.20.24-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:7bee1516e0516ff441a93206d0bc0816781ee7f6df37c9f01a9578e2bff7cc7c"}, - {file = "dulwich-0.20.24-cp39-cp39-win_amd64.whl", hash = "sha256:8853b0306406f6fb82812d2fc2af43d4cda50ea0223551c3b27df5eb008b655f"}, - {file = "dulwich-0.20.24.tar.gz", hash = "sha256:6b61ac0a2a8b1b1e18914310f3f7a422396334208b426b9de570f1de31644cf1"}, + {file = "dulwich-0.20.25-cp36-cp36m-macosx_10_14_x86_64.whl", hash = "sha256:da7655385e090b805c262df42f8b75a115345343951ca2497476df0a6287c20e"}, + {file = "dulwich-0.20.25-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6fad76fca381ceb914d156eb25c0cc77132cff1156d035271203c521134472b6"}, + {file = "dulwich-0.20.25-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:d4dbdabf71db1028f64e868081746869c17d8dbb6a16abb89b707e7a5590b121"}, + {file = "dulwich-0.20.25-cp36-cp36m-win_amd64.whl", hash = "sha256:12edad6ef398815fff9e51223be5838cd66bcdb164a442f652494ae9bb54720c"}, + {file = "dulwich-0.20.25-cp37-cp37m-macosx_10_14_x86_64.whl", hash = "sha256:0d09bc588bfdeca14b3e41d5d75aa4f9ea6b0b298b283bc29c3aa1b2c7788653"}, + {file = "dulwich-0.20.25-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f676d89db4777e854b28ea87b9bb1b0b156f6a743564c0daeb88502adaec7313"}, + {file = "dulwich-0.20.25-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:eb2cbc0bd62e21011161bde7f4bad7a606d7fbafe4b2e06f09d0cb8fac2e2fd2"}, + {file = "dulwich-0.20.25-cp37-cp37m-win_amd64.whl", hash = "sha256:3be5fc65f84787bd9039aabf2b8b7ad1a02311a16cd0e851504784b62ba91d61"}, + {file = "dulwich-0.20.25-cp38-cp38-macosx_10_14_x86_64.whl", hash = "sha256:6dcd552e8b6899da4cb87e3a0d71673fde03d2d8cf80d2d8946e4ccca15b307c"}, + {file = "dulwich-0.20.25-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:75816b242340c413814d22a8011d0596279ea8f4758bf2f91efd45388915f5d8"}, + {file = "dulwich-0.20.25-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:6d060f996fba4f7aa94e1fedc53e76e8e9ef5b8f7ec026d804a68d63b8df2867"}, + {file = "dulwich-0.20.25-cp38-cp38-win_amd64.whl", hash = "sha256:9b432869199972f0159e7d8cee02fde088c576ff294a01f5253a4ae7cb8f57c4"}, + {file = "dulwich-0.20.25-cp39-cp39-macosx_10_14_x86_64.whl", hash = "sha256:fabad0116db6f14568fef36962382c2ed698b8d305d2baaec9501a76eb836edd"}, + {file = "dulwich-0.20.25-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7e9649b962b753205e0a9a0cf2537871cb89eb3751f6c24e4d5f0d349c96b394"}, + {file = "dulwich-0.20.25-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:962bb4ce269f8959c818bf58b92fac601ef6c3f63a07ac46a526c83ec5bfb635"}, + {file = "dulwich-0.20.25-cp39-cp39-win_amd64.whl", hash = "sha256:b10d8cf0e71395871c90ca29ef794ecf04665ba41550029842b53c03af1c6ac5"}, + {file = "dulwich-0.20.25.tar.gz", hash = "sha256:79baea81583eb61eb7bd4a819ab6096686b362c626a4640d84d4fc5539139353"}, ] eko = [ {file = "eko-0.6.0-py3-none-any.whl", hash = "sha256:bea01597305ea64012af5bbd2f8a93e9d1e9b9471d192a680023997e780f82a3"}, {file = "eko-0.6.0.tar.gz", hash = "sha256:3c6f921c152254fcd69ececc87ab94ab9daee9841b99bdd1d2837a9bb36460d8"}, ] +fancycompleter = [ + {file = "fancycompleter-0.9.1-py3-none-any.whl", hash = "sha256:dd076bca7d9d524cc7f25ec8f35ef95388ffef9ef46def4d3d25e9b044ad7080"}, + {file = "fancycompleter-0.9.1.tar.gz", hash = "sha256:09e0feb8ae242abdfd7ef2ba55069a46f011814a80fe5476be48f51b00247272"}, +] idna = [ {file = "idna-3.2-py3-none-any.whl", hash = "sha256:14475042e284991034cb48e06f6851428fb14c4dc953acd9be9a5e95c7b6dd7a"}, {file = "idna-3.2.tar.gz", hash = "sha256:467fbad99067910785144ce333826c71fb0e63a425657295239737f7ecd125f3"}, ] importlib-metadata = [ - {file = "importlib_metadata-4.6.1-py3-none-any.whl", hash = "sha256:9f55f560e116f8643ecf2922d9cd3e1c7e8d52e683178fecd9d08f6aa357e11e"}, - {file = "importlib_metadata-4.6.1.tar.gz", hash = "sha256:079ada16b7fc30dfbb5d13399a5113110dab1aa7c2bc62f66af75f0b717c8cac"}, + {file = "importlib_metadata-4.7.1-py3-none-any.whl", hash = "sha256:9e04bf59076a15a9b6dd9c27806e8fcdf15280ba529c6a8cc3f4d5b4875bdd61"}, + {file = "importlib_metadata-4.7.1.tar.gz", hash = "sha256:c4eb3dec5f697682e383a39701a7de11cd5c02daf8dd93534b69e3e6473f6b1b"}, ] llvmlite = [ {file = "llvmlite-0.36.0-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:cc0f9b9644b4ab0e4a5edb17f1531d791630c88858220d3cc688d6edf10da100"}, @@ -715,59 +772,61 @@ numba = [ {file = "numba-0.53.1.tar.gz", hash = "sha256:9cd4e5216acdc66c4e9dab2dfd22ddb5bef151185c070d4a3cd8e78638aff5b0"}, ] numpy = [ - {file = "numpy-1.21.1-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:38e8648f9449a549a7dfe8d8755a5979b45b3538520d1e735637ef28e8c2dc50"}, - {file = "numpy-1.21.1-cp37-cp37m-manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:fd7d7409fa643a91d0a05c7554dd68aa9c9bb16e186f6ccfe40d6e003156e33a"}, - {file = "numpy-1.21.1-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:a75b4498b1e93d8b700282dc8e655b8bd559c0904b3910b144646dbbbc03e062"}, - {file = "numpy-1.21.1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:1412aa0aec3e00bc23fbb8664d76552b4efde98fb71f60737c83efbac24112f1"}, - {file = "numpy-1.21.1-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:e46ceaff65609b5399163de5893d8f2a82d3c77d5e56d976c8b5fb01faa6b671"}, - {file = "numpy-1.21.1-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:c6a2324085dd52f96498419ba95b5777e40b6bcbc20088fddb9e8cbb58885e8e"}, - {file = "numpy-1.21.1-cp37-cp37m-win32.whl", hash = "sha256:73101b2a1fef16602696d133db402a7e7586654682244344b8329cdcbbb82172"}, - {file = "numpy-1.21.1-cp37-cp37m-win_amd64.whl", hash = "sha256:7a708a79c9a9d26904d1cca8d383bf869edf6f8e7650d85dbc77b041e8c5a0f8"}, - {file = "numpy-1.21.1-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:95b995d0c413f5d0428b3f880e8fe1660ff9396dcd1f9eedbc311f37b5652e16"}, - {file = "numpy-1.21.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:635e6bd31c9fb3d475c8f44a089569070d10a9ef18ed13738b03049280281267"}, - {file = "numpy-1.21.1-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:4a3d5fb89bfe21be2ef47c0614b9c9c707b7362386c9a3ff1feae63e0267ccb6"}, - {file = "numpy-1.21.1-cp38-cp38-manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:8a326af80e86d0e9ce92bcc1e65c8ff88297de4fa14ee936cb2293d414c9ec63"}, - {file = "numpy-1.21.1-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:791492091744b0fe390a6ce85cc1bf5149968ac7d5f0477288f78c89b385d9af"}, - {file = "numpy-1.21.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:0318c465786c1f63ac05d7c4dbcecd4d2d7e13f0959b01b534ea1e92202235c5"}, - {file = "numpy-1.21.1-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:9a513bd9c1551894ee3d31369f9b07460ef223694098cf27d399513415855b68"}, - {file = "numpy-1.21.1-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:91c6f5fc58df1e0a3cc0c3a717bb3308ff850abdaa6d2d802573ee2b11f674a8"}, - {file = "numpy-1.21.1-cp38-cp38-win32.whl", hash = "sha256:978010b68e17150db8765355d1ccdd450f9fc916824e8c4e35ee620590e234cd"}, - {file = "numpy-1.21.1-cp38-cp38-win_amd64.whl", hash = "sha256:9749a40a5b22333467f02fe11edc98f022133ee1bfa8ab99bda5e5437b831214"}, - {file = "numpy-1.21.1-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:d7a4aeac3b94af92a9373d6e77b37691b86411f9745190d2c351f410ab3a791f"}, - {file = "numpy-1.21.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:d9e7912a56108aba9b31df688a4c4f5cb0d9d3787386b87d504762b6754fbb1b"}, - {file = "numpy-1.21.1-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:25b40b98ebdd272bc3020935427a4530b7d60dfbe1ab9381a39147834e985eac"}, - {file = "numpy-1.21.1-cp39-cp39-manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:8a92c5aea763d14ba9d6475803fc7904bda7decc2a0a68153f587ad82941fec1"}, - {file = "numpy-1.21.1-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:05a0f648eb28bae4bcb204e6fd14603de2908de982e761a2fc78efe0f19e96e1"}, - {file = "numpy-1.21.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:f01f28075a92eede918b965e86e8f0ba7b7797a95aa8d35e1cc8821f5fc3ad6a"}, - {file = "numpy-1.21.1-cp39-cp39-win32.whl", hash = "sha256:88c0b89ad1cc24a5efbb99ff9ab5db0f9a86e9cc50240177a571fbe9c2860ac2"}, - {file = "numpy-1.21.1-cp39-cp39-win_amd64.whl", hash = "sha256:01721eefe70544d548425a07c80be8377096a54118070b8a62476866d5208e33"}, - {file = "numpy-1.21.1-pp37-pypy37_pp73-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:2d4d1de6e6fb3d28781c73fbde702ac97f03d79e4ffd6598b880b2d95d62ead4"}, - {file = "numpy-1.21.1.zip", hash = "sha256:dff4af63638afcc57a3dfb9e4b26d434a7a602d225b42d746ea7fe2edf1342fd"}, + {file = "numpy-1.21.2-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:52a664323273c08f3b473548bf87c8145b7513afd63e4ebba8496ecd3853df13"}, + {file = "numpy-1.21.2-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:51a7b9db0a2941434cd930dacaafe0fc9da8f3d6157f9d12f761bbde93f46218"}, + {file = "numpy-1.21.2-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:9f2dc79c093f6c5113718d3d90c283f11463d77daa4e83aeeac088ec6a0bda52"}, + {file = "numpy-1.21.2-cp37-cp37m-manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:a55e4d81c4260386f71d22294795c87609164e22b28ba0d435850fbdf82fc0c5"}, + {file = "numpy-1.21.2-cp37-cp37m-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:426a00b68b0d21f2deb2ace3c6d677e611ad5a612d2c76494e24a562a930c254"}, + {file = "numpy-1.21.2-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:298156f4d3d46815eaf0fcf0a03f9625fc7631692bd1ad851517ab93c3168fc6"}, + {file = "numpy-1.21.2-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:09858463db6dd9f78b2a1a05c93f3b33d4f65975771e90d2cf7aadb7c2f66edf"}, + {file = "numpy-1.21.2-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:805459ad8baaf815883d0d6f86e45b3b0b67d823a8f3fa39b1ed9c45eaf5edf1"}, + {file = "numpy-1.21.2-cp37-cp37m-win32.whl", hash = "sha256:f545c082eeb09ae678dd451a1b1dbf17babd8a0d7adea02897a76e639afca310"}, + {file = "numpy-1.21.2-cp37-cp37m-win_amd64.whl", hash = "sha256:b160b9a99ecc6559d9e6d461b95c8eec21461b332f80267ad2c10394b9503496"}, + {file = "numpy-1.21.2-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:a5109345f5ce7ddb3840f5970de71c34a0ff7fceb133c9441283bb8250f532a3"}, + {file = "numpy-1.21.2-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:209666ce9d4a817e8a4597cd475b71b4878a85fa4b8db41d79fdb4fdee01dde2"}, + {file = "numpy-1.21.2-cp38-cp38-macosx_11_0_arm64.whl", hash = "sha256:c01b59b33c7c3ba90744f2c695be571a3bd40ab2ba7f3d169ffa6db3cfba614f"}, + {file = "numpy-1.21.2-cp38-cp38-manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:e42029e184008a5fd3d819323345e25e2337b0ac7f5c135b7623308530209d57"}, + {file = "numpy-1.21.2-cp38-cp38-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:7fdc7689daf3b845934d67cb221ba8d250fdca20ac0334fea32f7091b93f00d3"}, + {file = "numpy-1.21.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:550564024dc5ceee9421a86fc0fb378aa9d222d4d0f858f6669eff7410c89bef"}, + {file = "numpy-1.21.2-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:bf75d5825ef47aa51d669b03ce635ecb84d69311e05eccea083f31c7570c9931"}, + {file = "numpy-1.21.2-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:a9da45b748caad72ea4a4ed57e9cd382089f33c5ec330a804eb420a496fa760f"}, + {file = "numpy-1.21.2-cp38-cp38-win32.whl", hash = "sha256:e167b9805de54367dcb2043519382be541117503ce99e3291cc9b41ca0a83557"}, + {file = "numpy-1.21.2-cp38-cp38-win_amd64.whl", hash = "sha256:466e682264b14982012887e90346d33435c984b7fead7b85e634903795c8fdb0"}, + {file = "numpy-1.21.2-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:dd0e3651d210068d13e18503d75aaa45656eef51ef0b261f891788589db2cc38"}, + {file = "numpy-1.21.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:92a0ab128b07799dd5b9077a9af075a63467d03ebac6f8a93e6440abfea4120d"}, + {file = "numpy-1.21.2-cp39-cp39-macosx_11_0_arm64.whl", hash = "sha256:fde50062d67d805bc96f1a9ecc0d37bfc2a8f02b937d2c50824d186aa91f2419"}, + {file = "numpy-1.21.2-cp39-cp39-manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:640c1ccfd56724f2955c237b6ccce2e5b8607c3bc1cc51d3933b8c48d1da3723"}, + {file = "numpy-1.21.2-cp39-cp39-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:5de64950137f3a50b76ce93556db392e8f1f954c2d8207f78a92d1f79aa9f737"}, + {file = "numpy-1.21.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:b342064e647d099ca765f19672696ad50c953cac95b566af1492fd142283580f"}, + {file = "numpy-1.21.2-cp39-cp39-win32.whl", hash = "sha256:30fc68307c0155d2a75ad19844224be0f2c6f06572d958db4e2053f816b859ad"}, + {file = "numpy-1.21.2-cp39-cp39-win_amd64.whl", hash = "sha256:b5e8590b9245803c849e09bae070a8e1ff444f45e3f0bed558dd722119eea724"}, + {file = "numpy-1.21.2-pp37-pypy37_pp73-manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:d96a6a7d74af56feb11e9a443150216578ea07b7450f7c05df40eec90af7f4a7"}, + {file = "numpy-1.21.2.zip", hash = "sha256:423216d8afc5923b15df86037c6053bf030d15cc9e3224206ef868c2d63dd6dc"}, ] packaging = [ {file = "packaging-21.0-py3-none-any.whl", hash = "sha256:c86254f9220d55e31cc94d69bade760f0847da8000def4dfe1c6b872fd14ff14"}, {file = "packaging-21.0.tar.gz", hash = "sha256:7dc96269f53a4ccec5c0670940a4281106dd0bb343f47b7471f779df49c2fbe7"}, ] pandas = [ - {file = "pandas-1.3.0-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:c81b8d91e9ae861eb4406b4e0f8d4dabbc105b9c479b3d1e921fba1d35b5b62a"}, - {file = "pandas-1.3.0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:08eeff3da6a188e24db7f292b39a8ca9e073bf841fbbeadb946b3ad5c19d843e"}, - {file = "pandas-1.3.0-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:88864c1e28353b958b1f30e4193818519624ad9a1776921622a6a2a016d5d807"}, - {file = "pandas-1.3.0-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:872aa91e0f9ca913046ab639d4181a899f5e592030d954d28c2529b88756a736"}, - {file = "pandas-1.3.0-cp37-cp37m-win32.whl", hash = "sha256:92835113a67cbd34747c198d41f09f4b63f6fe11ca5643baebc7ab1e30e89e95"}, - {file = "pandas-1.3.0-cp37-cp37m-win_amd64.whl", hash = "sha256:7d3cd2c99faa94d717ca00ea489264a291ad7209453dffbf059bfb7971fd3a61"}, - {file = "pandas-1.3.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:823737830364d0e2af8c3912a28ba971296181a07950873492ed94e12d28c405"}, - {file = "pandas-1.3.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c746876cdd8380be0c3e70966d4566855901ac9aaa5e4b9ccaa5ca5311457d11"}, - {file = "pandas-1.3.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:fe7a549d10ca534797095586883a5c17d140d606747591258869c56e14d1b457"}, - {file = "pandas-1.3.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:f058c786e7b0a9e7fa5e0b9f4422e0ccdd3bf3aa3053c18d77ed2a459bd9a45a"}, - {file = "pandas-1.3.0-cp38-cp38-win32.whl", hash = "sha256:98efc2d4983d5bb47662fe2d97b2c81b91566cb08b266490918b9c7d74a5ef64"}, - {file = "pandas-1.3.0-cp38-cp38-win_amd64.whl", hash = "sha256:e6b75091fa54a53db3927b4d1bc997c23c5ba6f87acdfe1ee5a92c38c6b2ed6a"}, - {file = "pandas-1.3.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:1ff13eed501e07e7fb26a4ea18a846b6e5d7de549b497025601fd9ccb7c1d123"}, - {file = "pandas-1.3.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:798675317d0e4863a92a9a6bc5bd2490b5f6fef8c17b95f29e2e33f28bef9eca"}, - {file = "pandas-1.3.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:ed4fc66f23fe17c93a5d439230ca2d6b5f8eac7154198d327dbe8a16d98f3f10"}, - {file = "pandas-1.3.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:522bfea92f3ef6207cadc7428bda1e7605dae0383b8065030e7b5d0266717b48"}, - {file = "pandas-1.3.0-cp39-cp39-win32.whl", hash = "sha256:7897326cae660eee69d501cbfa950281a193fcf407393965e1bc07448e1cc35a"}, - {file = "pandas-1.3.0-cp39-cp39-win_amd64.whl", hash = "sha256:b10d7910ae9d7920a5ff7816d794d99acbc361f7b16a0f017d4fa83ced8cb55e"}, - {file = "pandas-1.3.0.tar.gz", hash = "sha256:c554e6c9cf2d5ea1aba5979cc837b3649539ced0e18ece186f055450c86622e2"}, + {file = "pandas-1.3.2-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:ba7ceb8abc6dbdb1e34612d1173d61e4941f1a1eb7e6f703b2633134ae6a6c89"}, + {file = "pandas-1.3.2-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:fcb71b1935249de80e3a808227189eee381d4d74a31760ced2df21eedc92a8e3"}, + {file = "pandas-1.3.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fa54dc1d3e5d004a09ab0b1751473698011ddf03e14f1f59b84ad9a6ac630975"}, + {file = "pandas-1.3.2-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:34ced9ce5d5b17b556486da7256961b55b471d64a8990b56e67a84ebeb259416"}, + {file = "pandas-1.3.2-cp37-cp37m-win32.whl", hash = "sha256:a56246de744baf646d1f3e050c4653d632bc9cd2e0605f41051fea59980e880a"}, + {file = "pandas-1.3.2-cp37-cp37m-win_amd64.whl", hash = "sha256:53b17e4debba26b7446b1e4795c19f94f0c715e288e08145e44bdd2865e819b3"}, + {file = "pandas-1.3.2-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:f07a9745ca075ae73a5ce116f5e58f691c0dc9de0bff163527858459df5c176f"}, + {file = "pandas-1.3.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c9e8e0ce5284ebebe110efd652c164ed6eab77f5de4c3533abc756302ee77765"}, + {file = "pandas-1.3.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:59a78d7066d1c921a77e3306aa0ebf6e55396c097d5dfcc4df8defe3dcecb735"}, + {file = "pandas-1.3.2-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:132def05e73d292c949b02e7ef873debb77acc44a8b119d215921046f0c3a91d"}, + {file = "pandas-1.3.2-cp38-cp38-win32.whl", hash = "sha256:69e1b2f5811f46827722fd641fdaeedb26002bd1e504eacc7a8ec36bdc25393e"}, + {file = "pandas-1.3.2-cp38-cp38-win_amd64.whl", hash = "sha256:7996d311413379136baf0f3cf2a10e331697657c87ced3f17ac7c77f77fe34a3"}, + {file = "pandas-1.3.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:1738154049062156429a5cf2fd79a69c9f3fa4f231346a7ec6fd156cd1a9a621"}, + {file = "pandas-1.3.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9cce01f6d655b4add966fcd36c32c5d1fe84628e200626b3f5e2f40db2d16a0f"}, + {file = "pandas-1.3.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1099e2a0cd3a01ec62cca183fc1555833a2d43764950ef8cb5948c8abfc51014"}, + {file = "pandas-1.3.2-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:0cd5776be891331a3e6b425b5abeab9596abea18435c5982191356f9b24ae731"}, + {file = "pandas-1.3.2-cp39-cp39-win32.whl", hash = "sha256:66a95361b81b4ba04b699ecd2416b0591f40cd1e24c60a8bfe0d19009cfa575a"}, + {file = "pandas-1.3.2-cp39-cp39-win_amd64.whl", hash = "sha256:89f40e5d21814192802421df809f948247d39ffe171e45fe2ab4abf7bd4279d8"}, + {file = "pandas-1.3.2.tar.gz", hash = "sha256:cbcb84d63867af3411fa063af3de64902665bb5b3d40b25b2059e40603594e87"}, ] patiencediff = [ {file = "patiencediff-0.2.2-cp36-cp36m-manylinux2014_aarch64.whl", hash = "sha256:e15b894d1941ed773b6c5f7479985fc17ec81bab33f82e3b736ab1920c1804d6"}, @@ -776,6 +835,10 @@ patiencediff = [ {file = "patiencediff-0.2.2-cp39-cp39-manylinux2014_aarch64.whl", hash = "sha256:5fcc3f9dc12040ddfb8165317af3425c4d2be49b147def22a72a44d43fff5141"}, {file = "patiencediff-0.2.2.tar.gz", hash = "sha256:456d9fc47fe43f9aea863059ea2c6df5b997285590e4b7f9ee8fbb6c3419b5a7"}, ] +pdbpp = [ + {file = "pdbpp-0.10.3-py2.py3-none-any.whl", hash = "sha256:79580568e33eb3d6f6b462b1187f53e10cd8e4538f7d31495c9181e2cf9665d1"}, + {file = "pdbpp-0.10.3.tar.gz", hash = "sha256:d9e43f4fda388eeb365f2887f4e7b66ac09dce9b6236b76f63616530e2f669f5"}, +] pkgconfig = [ {file = "pkgconfig-1.5.5-py3-none-any.whl", hash = "sha256:d20023bbeb42ee6d428a0fac6e0904631f545985a10cdd71a20aa58bc47a4209"}, {file = "pkgconfig-1.5.5.tar.gz", hash = "sha256:deb4163ef11f75b520d822d9505c1f462761b4309b1bb713d08689759ea8b899"}, @@ -821,8 +884,8 @@ pygit2 = [ {file = "pygit2-1.6.1.tar.gz", hash = "sha256:c3303776f774d3e0115c1c4f6e1fc35470d15f113a7ae9401a0b90acfa1661ac"}, ] pygments = [ - {file = "Pygments-2.9.0-py3-none-any.whl", hash = "sha256:d66e804411278594d764fc69ec36ec13d9ae9147193a1740cd34d272ca383b8e"}, - {file = "Pygments-2.9.0.tar.gz", hash = "sha256:a18f47b506a429f6f4b9df81bb02beab9ca21d0a5fee38ed15aef65f0545519f"}, + {file = "Pygments-2.10.0-py3-none-any.whl", hash = "sha256:b8e67fe6af78f492b3c4b3e2970c0624cbf08beb1e493b2c99b9fa1b67a20380"}, + {file = "Pygments-2.10.0.tar.gz", hash = "sha256:f398865f7eb6874156579fdf36bc840a03cab64d1cde9e93d68f46a425ec52c6"}, ] pyinquirer = [ {file = "PyInquirer-1.0.3.tar.gz", hash = "sha256:c9a92d68d7727fbd886a7908c08fd9e9773e5dc211bf5cbf836ba90d366dee51"}, @@ -831,6 +894,14 @@ pyparsing = [ {file = "pyparsing-2.4.7-py2.py3-none-any.whl", hash = "sha256:ef9d7589ef3c200abe66653d3f1ab1033c3c419ae9b9bdb1240a85b024efc88b"}, {file = "pyparsing-2.4.7.tar.gz", hash = "sha256:c203ec8783bf771a155b207279b9bccb8dea02d8f0c9e5f8ead507bc3246ecc1"}, ] +pyreadline = [ + {file = "pyreadline-2.1.win-amd64.exe", hash = "sha256:9ce5fa65b8992dfa373bddc5b6e0864ead8f291c94fbfec05fbd5c836162e67b"}, + {file = "pyreadline-2.1.win32.exe", hash = "sha256:65540c21bfe14405a3a77e4c085ecfce88724743a4ead47c66b84defcf82c32e"}, + {file = "pyreadline-2.1.zip", hash = "sha256:4530592fc2e85b25b1a9f79664433da09237c1a270e4d78ea5aa3a2c7229e2d1"}, +] +pyrepl = [ + {file = "pyrepl-0.9.0.tar.gz", hash = "sha256:292570f34b5502e871bbb966d639474f2b57fbfcd3373c2d6a2f3d56e681a775"}, +] pytest = [ {file = "pytest-5.4.3-py3-none-any.whl", hash = "sha256:5c0db86b698e8f170ba4582a492248919255fcd4c79b1ee64ace34301fb589a1"}, {file = "pytest-5.4.3.tar.gz", hash = "sha256:7979331bfcba207414f5e1263b5a0f8f521d0f457318836a7355531ed1a4c7d8"}, @@ -875,76 +946,76 @@ pyyaml = [ {file = "PyYAML-5.4.1.tar.gz", hash = "sha256:607774cbba28732bfa802b54baa7484215f530991055bb562efbed5b2f20a45e"}, ] regex = [ - {file = "regex-2021.7.6-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:e6a1e5ca97d411a461041d057348e578dc344ecd2add3555aedba3b408c9f874"}, - {file = "regex-2021.7.6-cp36-cp36m-manylinux1_i686.whl", hash = "sha256:6afe6a627888c9a6cfbb603d1d017ce204cebd589d66e0703309b8048c3b0854"}, - {file = "regex-2021.7.6-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:ccb3d2190476d00414aab36cca453e4596e8f70a206e2aa8db3d495a109153d2"}, - {file = "regex-2021.7.6-cp36-cp36m-manylinux2010_i686.whl", hash = "sha256:ed693137a9187052fc46eedfafdcb74e09917166362af4cc4fddc3b31560e93d"}, - {file = "regex-2021.7.6-cp36-cp36m-manylinux2010_x86_64.whl", hash = "sha256:99d8ab206a5270c1002bfcf25c51bf329ca951e5a169f3b43214fdda1f0b5f0d"}, - {file = "regex-2021.7.6-cp36-cp36m-manylinux2014_i686.whl", hash = "sha256:b85ac458354165405c8a84725de7bbd07b00d9f72c31a60ffbf96bb38d3e25fa"}, - {file = "regex-2021.7.6-cp36-cp36m-manylinux2014_x86_64.whl", hash = "sha256:3f5716923d3d0bfb27048242a6e0f14eecdb2e2a7fac47eda1d055288595f222"}, - {file = "regex-2021.7.6-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e5983c19d0beb6af88cb4d47afb92d96751fb3fa1784d8785b1cdf14c6519407"}, - {file = "regex-2021.7.6-cp36-cp36m-win32.whl", hash = "sha256:c92831dac113a6e0ab28bc98f33781383fe294df1a2c3dfd1e850114da35fd5b"}, - {file = "regex-2021.7.6-cp36-cp36m-win_amd64.whl", hash = "sha256:791aa1b300e5b6e5d597c37c346fb4d66422178566bbb426dd87eaae475053fb"}, - {file = "regex-2021.7.6-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:59506c6e8bd9306cd8a41511e32d16d5d1194110b8cfe5a11d102d8b63cf945d"}, - {file = "regex-2021.7.6-cp37-cp37m-manylinux1_i686.whl", hash = "sha256:564a4c8a29435d1f2256ba247a0315325ea63335508ad8ed938a4f14c4116a5d"}, - {file = "regex-2021.7.6-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:59c00bb8dd8775473cbfb967925ad2c3ecc8886b3b2d0c90a8e2707e06c743f0"}, - {file = "regex-2021.7.6-cp37-cp37m-manylinux2010_i686.whl", hash = "sha256:9a854b916806c7e3b40e6616ac9e85d3cdb7649d9e6590653deb5b341a736cec"}, - {file = "regex-2021.7.6-cp37-cp37m-manylinux2010_x86_64.whl", hash = "sha256:db2b7df831c3187a37f3bb80ec095f249fa276dbe09abd3d35297fc250385694"}, - {file = "regex-2021.7.6-cp37-cp37m-manylinux2014_i686.whl", hash = "sha256:173bc44ff95bc1e96398c38f3629d86fa72e539c79900283afa895694229fe6a"}, - {file = "regex-2021.7.6-cp37-cp37m-manylinux2014_x86_64.whl", hash = "sha256:15dddb19823f5147e7517bb12635b3c82e6f2a3a6b696cc3e321522e8b9308ad"}, - {file = "regex-2021.7.6-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2ddeabc7652024803666ea09f32dd1ed40a0579b6fbb2a213eba590683025895"}, - {file = "regex-2021.7.6-cp37-cp37m-win32.whl", hash = "sha256:f080248b3e029d052bf74a897b9d74cfb7643537fbde97fe8225a6467fb559b5"}, - {file = "regex-2021.7.6-cp37-cp37m-win_amd64.whl", hash = "sha256:d8bbce0c96462dbceaa7ac4a7dfbbee92745b801b24bce10a98d2f2b1ea9432f"}, - {file = "regex-2021.7.6-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:edd1a68f79b89b0c57339bce297ad5d5ffcc6ae7e1afdb10f1947706ed066c9c"}, - {file = "regex-2021.7.6-cp38-cp38-manylinux1_i686.whl", hash = "sha256:422dec1e7cbb2efbbe50e3f1de36b82906def93ed48da12d1714cabcd993d7f0"}, - {file = "regex-2021.7.6-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:cbe23b323988a04c3e5b0c387fe3f8f363bf06c0680daf775875d979e376bd26"}, - {file = "regex-2021.7.6-cp38-cp38-manylinux2010_i686.whl", hash = "sha256:0eb2c6e0fcec5e0f1d3bcc1133556563222a2ffd2211945d7b1480c1b1a42a6f"}, - {file = "regex-2021.7.6-cp38-cp38-manylinux2010_x86_64.whl", hash = "sha256:1c78780bf46d620ff4fff40728f98b8afd8b8e35c3efd638c7df67be2d5cddbf"}, - {file = "regex-2021.7.6-cp38-cp38-manylinux2014_i686.whl", hash = "sha256:bc84fb254a875a9f66616ed4538542fb7965db6356f3df571d783f7c8d256edd"}, - {file = "regex-2021.7.6-cp38-cp38-manylinux2014_x86_64.whl", hash = "sha256:598c0a79b4b851b922f504f9f39a863d83ebdfff787261a5ed061c21e67dd761"}, - {file = "regex-2021.7.6-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:875c355360d0f8d3d827e462b29ea7682bf52327d500a4f837e934e9e4656068"}, - {file = "regex-2021.7.6-cp38-cp38-win32.whl", hash = "sha256:e586f448df2bbc37dfadccdb7ccd125c62b4348cb90c10840d695592aa1b29e0"}, - {file = "regex-2021.7.6-cp38-cp38-win_amd64.whl", hash = "sha256:2fe5e71e11a54e3355fa272137d521a40aace5d937d08b494bed4529964c19c4"}, - {file = "regex-2021.7.6-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:6110bab7eab6566492618540c70edd4d2a18f40ca1d51d704f1d81c52d245026"}, - {file = "regex-2021.7.6-cp39-cp39-manylinux1_i686.whl", hash = "sha256:4f64fc59fd5b10557f6cd0937e1597af022ad9b27d454e182485f1db3008f417"}, - {file = "regex-2021.7.6-cp39-cp39-manylinux1_x86_64.whl", hash = "sha256:89e5528803566af4df368df2d6f503c84fbfb8249e6631c7b025fe23e6bd0cde"}, - {file = "regex-2021.7.6-cp39-cp39-manylinux2010_i686.whl", hash = "sha256:2366fe0479ca0e9afa534174faa2beae87847d208d457d200183f28c74eaea59"}, - {file = "regex-2021.7.6-cp39-cp39-manylinux2010_x86_64.whl", hash = "sha256:f9392a4555f3e4cb45310a65b403d86b589adc773898c25a39184b1ba4db8985"}, - {file = "regex-2021.7.6-cp39-cp39-manylinux2014_i686.whl", hash = "sha256:2bceeb491b38225b1fee4517107b8491ba54fba77cf22a12e996d96a3c55613d"}, - {file = "regex-2021.7.6-cp39-cp39-manylinux2014_x86_64.whl", hash = "sha256:f98dc35ab9a749276f1a4a38ab3e0e2ba1662ce710f6530f5b0a6656f1c32b58"}, - {file = "regex-2021.7.6-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:319eb2a8d0888fa6f1d9177705f341bc9455a2c8aca130016e52c7fe8d6c37a3"}, - {file = "regex-2021.7.6-cp39-cp39-win32.whl", hash = "sha256:eaf58b9e30e0e546cdc3ac06cf9165a1ca5b3de8221e9df679416ca667972035"}, - {file = "regex-2021.7.6-cp39-cp39-win_amd64.whl", hash = "sha256:4c9c3155fe74269f61e27617529b7f09552fbb12e44b1189cebbdb24294e6e1c"}, - {file = "regex-2021.7.6.tar.gz", hash = "sha256:8394e266005f2d8c6f0bc6780001f7afa3ef81a7a2111fa35058ded6fce79e4d"}, + {file = "regex-2021.8.27-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:507861cf3d97a86fbe26ea6cc04660ae028b9e4080b8290e28b99547b4e15d89"}, + {file = "regex-2021.8.27-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:105122fa63da98d8456d5026bc6ac5a1399fd82fa6bad22c6ea641b1572c9142"}, + {file = "regex-2021.8.27-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:83946ca9278b304728b637bc8d8200ab1663a79de85e47724594917aeed0e892"}, + {file = "regex-2021.8.27-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:ee318974a1fdacba1701bc9e552e9015788d6345416364af6fa987424ff8df53"}, + {file = "regex-2021.8.27-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:dde0ac721c7c5bfa5f9fc285e811274dec3c392f2c1225f7d07ca98a8187ca84"}, + {file = "regex-2021.8.27-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:862b6164e9a38b5c495be2c2854e75fd8af12c5be4c61dc9b42d255980d7e907"}, + {file = "regex-2021.8.27-cp310-cp310-win32.whl", hash = "sha256:7684016b73938ca12d160d2907d141f06b7597bd17d854e32bb7588be01afa1d"}, + {file = "regex-2021.8.27-cp310-cp310-win_amd64.whl", hash = "sha256:a5f3bc727fea58f21d99c22e6d4fca652dc11dbc2a1e7cfc4838cd53b2e3691f"}, + {file = "regex-2021.8.27-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:db888d4fb33a2fd54b57ac55d5015e51fa849f0d8592bd799b4e47f83bd04e00"}, + {file = "regex-2021.8.27-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:92eb03f47427fea452ff6956d11f5d5a3f22a048c90a0f34fa223e6badab6c85"}, + {file = "regex-2021.8.27-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7406dd2e44c7cfb4680c0a45a03264381802c67890cf506c147288f04c67177d"}, + {file = "regex-2021.8.27-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:7db58ad61f3f6ea393aaf124d774ee0c58806320bc85c06dc9480f5c7219c250"}, + {file = "regex-2021.8.27-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:cd45b4542134de63e7b9dd653e0a2d7d47ffed9615e3637c27ca5f6b78ea68bb"}, + {file = "regex-2021.8.27-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:e02dad60e3e8442eefd28095e99b2ac98f2b8667167493ac6a2f3aadb5d84a17"}, + {file = "regex-2021.8.27-cp36-cp36m-win32.whl", hash = "sha256:de0d06ccbc06af5bf93bddec10f4f80275c5d74ea6d28b456931f3955f58bc8c"}, + {file = "regex-2021.8.27-cp36-cp36m-win_amd64.whl", hash = "sha256:2a0a5e323cf86760784ce2b91d8ab5ea09d0865d6ef4da0151e03d15d097b24e"}, + {file = "regex-2021.8.27-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:6530b7b9505123cdea40a2301225183ca65f389bc6129f0c225b9b41680268d8"}, + {file = "regex-2021.8.27-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4f3e36086d6631ceaf468503f96a3be0d247caef0660c9452fb1b0c055783851"}, + {file = "regex-2021.8.27-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8ddb4f9ce6bb388ecc97b4b3eb37e786f05d7d5815e8822e0d87a3dbd7100649"}, + {file = "regex-2021.8.27-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:2de1429e4eeab799c168a4f6e6eecdf30fcaa389bba4039cc8a065d6b7aad647"}, + {file = "regex-2021.8.27-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:4f03fc0a25122cdcbf39136510d4ea7627f732206892db522adf510bc03b8c67"}, + {file = "regex-2021.8.27-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:503c1ba0920a46a1844363725215ef44d59fcac2bd2c03ae3c59aa9d08d29bd6"}, + {file = "regex-2021.8.27-cp37-cp37m-win32.whl", hash = "sha256:24d68499a27b2d93831fde4a9b84ea5b19e0ab141425fbc9ab1e5b4dad179df7"}, + {file = "regex-2021.8.27-cp37-cp37m-win_amd64.whl", hash = "sha256:6729914dd73483cd1c8aaace3ac082436fc98b0072743ac136eaea0b3811d42f"}, + {file = "regex-2021.8.27-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:2d9cbe0c755ab8b6f583169c0783f7278fc6b195e423b09c5a8da6f858025e96"}, + {file = "regex-2021.8.27-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d2404336fd16788ea757d4218a2580de60adb052d9888031e765320be8884309"}, + {file = "regex-2021.8.27-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:208851a2f8dd31e468f0b5aa6c94433975bd67a107a4e7da3bdda947c9f85e25"}, + {file = "regex-2021.8.27-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:3ee8ad16a35c45a5bab098e39020ecb6fec3b0e700a9d88983d35cbabcee79c8"}, + {file = "regex-2021.8.27-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:56ae6e3cf0506ec0c40b466e31f41ee7a7149a2b505ae0ee50edd9043b423d27"}, + {file = "regex-2021.8.27-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:2778c6cb379d804e429cc8e627392909e60db5152b42c695c37ae5757aae50ae"}, + {file = "regex-2021.8.27-cp38-cp38-win32.whl", hash = "sha256:e960fe211496333b2f7e36badf4c22a919d740386681f79139ee346b403d1ca1"}, + {file = "regex-2021.8.27-cp38-cp38-win_amd64.whl", hash = "sha256:116c277774f84266044e889501fe79cfd293a8b4336b7a5e89b9f20f1e5a9f21"}, + {file = "regex-2021.8.27-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:32753eda8d413ce4f208cfe01dd61171a78068a6f5d5f38ccd751e00585cdf1d"}, + {file = "regex-2021.8.27-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:84057cfae5676f456b03970eb78b7e182fddc80c2daafd83465a3d6ca9ff8dbf"}, + {file = "regex-2021.8.27-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a6180dbf5945b27e9420e1b58c3cacfc79ad5278bdad3ea35109f5680fbe16d1"}, + {file = "regex-2021.8.27-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:b158f673ae6a6523f13704f70aa7e4ce875f91e379bece4362c89db18db189d5"}, + {file = "regex-2021.8.27-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:19acdb8831a4e3b03b23369db43178d8fee1f17b99c83af6cd907886f76bd9d4"}, + {file = "regex-2021.8.27-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:12eaf0bbe568bd62e6cade7937e0bf01a2a4cef49a82f4fd204401e78409e158"}, + {file = "regex-2021.8.27-cp39-cp39-win32.whl", hash = "sha256:1401cfa4320691cbd91191ec678735c727dee674d0997b0902a5a38ad482faf5"}, + {file = "regex-2021.8.27-cp39-cp39-win_amd64.whl", hash = "sha256:0696eb934dee723e3292056a2c046ddb1e4dd3887685783a9f4af638e85dee76"}, + {file = "regex-2021.8.27.tar.gz", hash = "sha256:e9700c52749cb3e90c98efd72b730c97b7e4962992fca5fbcaf1363be8e3b849"}, ] requests = [ {file = "requests-2.26.0-py2.py3-none-any.whl", hash = "sha256:6c1246513ecd5ecd4528a0906f910e8f0f9c6b8ec72030dc9fd154dc1a6efd24"}, {file = "requests-2.26.0.tar.gz", hash = "sha256:b8aa58f8cf793ffd8782d3d8cb19e66ef36f7aba4353eec859e74678b01b07a7"}, ] rich = [ - {file = "rich-10.6.0-py3-none-any.whl", hash = "sha256:d3f72827cd5df13b2ef7f1a97f81ec65548d4fdeb92cef653234f227580bbb2a"}, - {file = "rich-10.6.0.tar.gz", hash = "sha256:128261b3e2419a4ef9c97066ccc2abbfb49fa7c5e89c3fe4056d00aa5e9c1e65"}, + {file = "rich-10.7.0-py3-none-any.whl", hash = "sha256:517b4e0efd064dd1fe821ca93dd3095d73380ceac1f0a07173d507d9b18f1396"}, + {file = "rich-10.7.0.tar.gz", hash = "sha256:13ac80676e12cf528dc4228dc682c8402f82577c2aa67191e294350fa2c3c4e9"}, ] scipy = [ - {file = "scipy-1.7.0-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:821e75f5c16cd7b0ab0ffe7eb9917e5af7b48c25306b4777287de8d792a5f7f3"}, - {file = "scipy-1.7.0-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3e7df79b42c3015058a5554bfeab6fd4c9906c46560c9ddebb5c652840f3e182"}, - {file = "scipy-1.7.0-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:0572256c10ddd058e3d315c555538671ddb2737f27eb56189bfbc3483391403f"}, - {file = "scipy-1.7.0-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:b77ee5e3a9507622e7f98b16122242a3903397f98d1fe3bc269d904a9025e2bc"}, - {file = "scipy-1.7.0-cp37-cp37m-win32.whl", hash = "sha256:53116abd5060a5b4a58489cf689bee259b779e6b7ecd4ce366e7147aa7c9626e"}, - {file = "scipy-1.7.0-cp37-cp37m-win_amd64.whl", hash = "sha256:e7b733d4d98e604109715e11f2ab9340eb45d53f803634ed730039070fc3bc11"}, - {file = "scipy-1.7.0-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:4ef3d4df8af40cb6f4d4eaf7b02780109ebabeec334cda26a7899ec9d8de9176"}, - {file = "scipy-1.7.0-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:bd4399d4388ca0239a4825e312b3e61b60f743dd6daf49e5870837716502a92a"}, - {file = "scipy-1.7.0-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:80df8af7039bce92fb4cd1ceb056258631b11b3c627384e2d29bb48d44c0cae7"}, - {file = "scipy-1.7.0-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:6130e22bf6ee506f7cddde7e0515296d97eb6c6c94f7ef5103c2b77aec5833a7"}, - {file = "scipy-1.7.0-cp38-cp38-win32.whl", hash = "sha256:97ca4552ace1c313707058e774609af59644321e278c3a539322fab2fb09b943"}, - {file = "scipy-1.7.0-cp38-cp38-win_amd64.whl", hash = "sha256:c5d012cb82cc1dcfa72609abaabb4a4ed8113e3e8ac43464508a418c146be57d"}, - {file = "scipy-1.7.0-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:5eb8f054eebb351af7490bbb57465ba9662c4e16e1786655c6c7ed530eb9a74e"}, - {file = "scipy-1.7.0-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:7f4b89c223bd09460b52b669e2e642cab73c28855b540e6ed029692546a86f8d"}, - {file = "scipy-1.7.0-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:2e685fdbfa5b989af4338b29c408b9157ea6addec15d661104c437980c292be5"}, - {file = "scipy-1.7.0-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:3595c8b64970c9e5a3f137fa1a9eb64da417e78fb7991d0b098b18a00b776d88"}, - {file = "scipy-1.7.0-cp39-cp39-win32.whl", hash = "sha256:5a983d3cebc27294897951a494cebd78af2eae37facf75d9e4ad4f1f62229860"}, - {file = "scipy-1.7.0-cp39-cp39-win_amd64.whl", hash = "sha256:aef6e922aea6f2e6bbb539b413c85210a9ee32757535b84204ebd22723e69704"}, - {file = "scipy-1.7.0.tar.gz", hash = "sha256:998c5e6ea649489302de2c0bc026ed34284f531df89d2bdc8df3a0d44d165739"}, + {file = "scipy-1.7.1-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:2a0eeaab01258e0870c4022a6cd329aef3b7c6c2b606bd7cf7bb2ba9820ae561"}, + {file = "scipy-1.7.1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3f52470e0548cdb74fb8ddf06773ffdcca7c97550f903b1c51312ec19243a7f7"}, + {file = "scipy-1.7.1-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:787749110a23502031fb1643c55a2236c99c6b989cca703ea2114d65e21728ef"}, + {file = "scipy-1.7.1-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:3304bd5bc32e00954ac4b3f4cc382ca8824719bf348aacbec6347337d6b125fe"}, + {file = "scipy-1.7.1-cp37-cp37m-win32.whl", hash = "sha256:d1388fbac9dd591ea630da75c455f4cc637a7ca5ecb31a6b6cef430914749cde"}, + {file = "scipy-1.7.1-cp37-cp37m-win_amd64.whl", hash = "sha256:d648aa85dd5074b1ed83008ae987c3fbb53d68af619fce1dee231f4d8bd40e2f"}, + {file = "scipy-1.7.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:bc61e3e5ff92d2f32bb263621d54a9cff5e3f7c420af3d1fa122ce2529de2bd9"}, + {file = "scipy-1.7.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a496b42dbcd04ea9924f5e92be63af3d8e0f43a274b769bfaca0a297327d54ee"}, + {file = "scipy-1.7.1-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:d13f31457f2216e5705304d9f28e2826edf75487410a57aa99263fa4ffd792c2"}, + {file = "scipy-1.7.1-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:90c07ba5f34f33299a428b0d4fa24c30d2ceba44d63f8385b2b05be460819fcb"}, + {file = "scipy-1.7.1-cp38-cp38-win32.whl", hash = "sha256:efdd3825d54c58df2cc394366ca4b9166cf940a0ebddeb87b6c10053deb625ea"}, + {file = "scipy-1.7.1-cp38-cp38-win_amd64.whl", hash = "sha256:71cfc96297617eab911e22216e8a8597703202e95636d9406df9af5c2ac99a2b"}, + {file = "scipy-1.7.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:4ee952f39a4a4c7ba775a32b664b1f4b74818548b65f765987adc14bb78f5802"}, + {file = "scipy-1.7.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:611f9cb459d0707dd8e4de0c96f86e93f61aac7475fcb225e9ec71fecdc5cebf"}, + {file = "scipy-1.7.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.whl", hash = "sha256:e101bceeb9e65a90dadbc5ca31283403a2d4667b9c178db29109750568e8d112"}, + {file = "scipy-1.7.1-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.whl", hash = "sha256:4729b41a4cdaf4cd011aeac816b532f990bdf97710cef59149d3e293115cf467"}, + {file = "scipy-1.7.1-cp39-cp39-win32.whl", hash = "sha256:c9951e3746b68974125e5e3445008a4163dd6d20ae0bbdae22b38cb8951dc11b"}, + {file = "scipy-1.7.1-cp39-cp39-win_amd64.whl", hash = "sha256:da9c6b336e540def0b7fd65603da8abeb306c5fc9a5f4238665cbbb5ff95cf58"}, + {file = "scipy-1.7.1.tar.gz", hash = "sha256:6b47d5fa7ea651054362561a28b1ccc8da9368a39514c1bbf6c0977a1c376764"}, ] six = [ {file = "six-1.16.0-py2.py3-none-any.whl", hash = "sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254"}, @@ -963,6 +1034,9 @@ wcwidth = [ {file = "wcwidth-0.2.5-py2.py3-none-any.whl", hash = "sha256:beb4802a9cebb9144e99086eff703a642a13d6a0052920003a230f3294bbe784"}, {file = "wcwidth-0.2.5.tar.gz", hash = "sha256:c4d647b99872929fdb7bdcaa4fbe7f01413ed3d98077df798530e5b04f116c83"}, ] +wmctrl = [ + {file = "wmctrl-0.4.tar.gz", hash = "sha256:66cbff72b0ca06a22ec3883ac3a4d7c41078bdae4fb7310f52951769b10e14e0"}, +] yadism = [ {file = "yadism-0.7.0-py3-none-any.whl", hash = "sha256:5da4afecfd52796318b572e399807537a7784c8398df298e947fa330e71f62fc"}, ] diff --git a/pyproject.toml b/pyproject.toml index 94b71ed1..d9c1f3e7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -21,6 +21,7 @@ requests = "^2.26.0" [tool.poetry.dev-dependencies] pytest = "^5.2" +pdbpp = "^0.10.3" [tool.poetry.scripts] dis = "run:dis" diff --git a/run.sh b/run.sh index 8b630708..90616df5 100755 --- a/run.sh +++ b/run.sh @@ -5,221 +5,224 @@ prefix=$(pwd)/.prefix export LC_ALL=C yesno() { - echo -n "$@" "[Y/n]" - read -r reply - - if [[ -z $reply ]]; then - reply=Y - fi - - case "${reply}" in - Yes|yes|Y|y) return 0;; - No|no|N|n) return 1;; - *) echo "I didn't understand your reply '${reply}'"; yesno "$@";; - esac + echo -n "$@" "[Y/n]" + read -r reply + + if [[ -z $reply ]]; then + reply=Y + fi + + case "${reply}" in + Yes | yes | Y | y) return 0 ;; + No | no | N | n) return 1 ;; + *) + echo "I didn't understand your reply '${reply}'" + yesno "$@" + ;; + esac } -install_mg5amc() {( - mkdir -p "${prefix}" - - brz=$(which brz 2> /dev/null || true) - bzr=$(which bzr 2> /dev/null || true) - pip=$(which pip 2> /dev/null || true) - - repo=lp:~maddevelopers/mg5amcnlo/3.2.0 - - if [[ -x ${pip} ]] && [[ ! -x ${brz} ]] && [[ ! -x ${bzr} ]]; then - pyver=$(python --version | cut -d' ' -f 2 | cut -d. -f1,2) - export PATH="${prefix}"/bin:${PATH} - export PYTHONPATH="${prefix}"/lib/python${pyver}/site-packages - "${pip}" install --prefix "${prefix}" breezy - brz="${prefix}"/bin/brz - fi - - if [[ -x ${brz} ]]; then - "${brz}" branch "${repo}" "${prefix}"/mg5amc - elif [[ -x ${bzr} ]]; then - "${bzr}" branch "${repo}" "${prefix}"/mg5amc - else - echo "Couldn't install Madgraph5_aMC@NLO" >&2 - exit 1 - fi - - if "${pip}" show six 2>&1 | grep 'Package(s) not found' > /dev/null; then - "${pip}" install --prefix "${prefix}" six - fi - - # in case we're using python3, we need to convert the model file - "${prefix}"/mg5amc/bin/mg5_aMC </dev/null || true) + bzr=$(which bzr 2>/dev/null || true) + pip=$(which pip 2>/dev/null || true) + + repo=lp:~maddevelopers/mg5amcnlo/3.2.0 + + if [[ -x ${pip} ]] && [[ ! -x ${brz} ]] && [[ ! -x ${bzr} ]]; then + pyver=$(python --version | cut -d' ' -f 2 | cut -d. -f1,2) + export PATH="${prefix}"/bin:${PATH} + export PYTHONPATH="${prefix}"/lib/python${pyver}/site-packages + "${pip}" install --prefix "${prefix}" breezy + brz="${prefix}"/bin/brz + fi + + if [[ -x ${brz} ]]; then + "${brz}" branch "${repo}" "${prefix}"/mg5amc + elif [[ -x ${bzr} ]]; then + "${bzr}" branch "${repo}" "${prefix}"/mg5amc + else + echo "Couldn't install Madgraph5_aMC@NLO" >&2 + exit 1 + fi + + if "${pip}" show six 2>&1 | grep 'Package(s) not found' >/dev/null; then + "${pip}" install --prefix "${prefix}" six + fi + + # in case we're using python3, we need to convert the model file + "${prefix}"/mg5amc/bin/mg5_aMC < /dev/null || true) - git=$(which git 2> /dev/null) + cargo=$(which cargo 2>/dev/null || true) + git=$(which git 2>/dev/null) - repo=https://github.com/N3PDF/pineappl.git + repo=https://github.com/N3PDF/pineappl.git - if [[ ! -x ${cargo} ]]; then - export CARGO_HOME=${prefix}/cargo - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs > /tmp/rustup-init - bash /tmp/rustup-init --profile minimal --no-modify-path -y - export PATH=${prefix}/cargo/bin:${PATH} - cargo="${prefix}"/cargo/bin/cargo - elif [[ -d ${prefix}/cargo ]]; then - export CARGO_HOME=${prefix}/cargo - fi + if [[ ! -x ${cargo} ]]; then + export CARGO_HOME=${prefix}/cargo + curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs >/tmp/rustup-init + bash /tmp/rustup-init --profile minimal --no-modify-path -y + export PATH=${prefix}/cargo/bin:${PATH} + cargo="${prefix}"/cargo/bin/cargo + elif [[ -d ${prefix}/cargo ]]; then + export CARGO_HOME=${prefix}/cargo + fi - if [[ -d ${prefix}/pineappl ]]; then - "${git}" pull - else - "${git}" clone ${repo} "${prefix}"/pineappl - fi + if [[ -d ${prefix}/pineappl ]]; then + "${git}" pull + else + "${git}" clone ${repo} "${prefix}"/pineappl + fi - "${cargo}" install --force cargo-c + "${cargo}" install --force cargo-c - pushd . > /dev/null - cd "${prefix}"/pineappl - "${cargo}" cinstall --release --prefix "${prefix}" --manifest-path=pineappl_capi/Cargo.toml - "${cargo}" install --path pineappl_cli --root "${prefix}" - popd > /dev/null -)} + pushd . >/dev/null + cd "${prefix}"/pineappl + "${cargo}" cinstall --release --prefix "${prefix}" --manifest-path=pineappl_capi/Cargo.toml + "${cargo}" install --path pineappl_cli --root "${prefix}" + popd >/dev/null +); } check_args_and_cd_output() { - # exit script at the first sign of an error - set -o errexit - - # the following exits if undeclared variables are used - set -o nounset - - # exit if some program in a pipeline fails - set -o pipefail - - # check arguments of the script - if (( $# != 1 )); then - echo "Usage: ./run.sh [dataset]" >&2 - echo " The following datasets are available:" >&2 - - for i in nnpdf31_proc/*; do - echo " - ${i##*/}" >&2 - done - - exit 1 - fi - - # name of the dataset - dataset="$1" - - pkg_config=$(which pkg-config 2> /dev/null || true) - - if [[ ! -x ${pkg_config} ]]; then - echo "The binary \`pkg-config\` wasn't found. Please install it" >&2 - exit 1 - fi - - # if we've installed dependencies set the correct paths - if [[ -d ${prefix} ]]; then - pyver=$(python --version | cut -d' ' -f 2 | cut -d. -f1,2) - export PYTHONPATH="${prefix}"/lib/python${pyver}/site-packages:${PYTHONPATH:-} - export PATH=${prefix}/mg5amc/bin:${prefix}/bin:${PATH:-} - export LD_LIBRARY_PATH=${prefix}/lib:${LD_LIBRARY_PATH:-} - export PKG_CONFIG_PATH=${prefix}/lib/pkgconfig:${PKG_CONFIG_PATH:-} - fi - - install_mg5amc= - install_pineappl= - - if ! which mg5_aMC > /dev/null 2>&1; then - install_mg5amc=yes - echo "Madgraph5_aMC@NLO wasn't found" - fi - - if ! "${pkg_config}" pineappl_capi; then - install_pineappl=yes - echo "PineAPPL wasn't found" - elif ! which pineappl > /dev/null 2>&1; then - install_pineappl=yes - echo "PineAPPL wasn't found" - fi - - if [[ -n ${install_mg5amc}${install_pineappl} ]]; then - if yesno "Do you want to install the missing dependencies (into \`.prefix\`)?"; then - if [[ -n ${install_mg5amc} ]]; then - install_mg5amc - fi - if [[ -n ${install_pineappl} ]]; then - install_pineappl - fi - - pyver=$(python --version | cut -d' ' -f 2 | cut -d. -f1,2) - export PYTHONPATH="${prefix}"/lib/python${pyver}/site-packages:${PYTHONPATH:-} - export PATH=${prefix}/mg5amc/bin:${prefix}/bin:${PATH:-} - export LD_LIBRARY_PATH=${prefix}/lib:${LD_LIBRARY_PATH:-} - export PKG_CONFIG_PATH=${prefix}/lib/pkgconfig:${PKG_CONFIG_PATH:-} - else - exit 1 - fi + # exit script at the first sign of an error + set -o errexit + + # the following exits if undeclared variables are used + set -o nounset + + # exit if some program in a pipeline fails + set -o pipefail + + # check arguments of the script + if (($# != 1)); then + echo "Usage: ./run.sh [dataset]" >&2 + echo " The following datasets are available:" >&2 + + for i in nnpdf31_proc/*; do + echo " - ${i##*/}" >&2 + done + + exit 1 + fi + + # name of the dataset + dataset="$1" + + pkg_config=$(which pkg-config 2>/dev/null || true) + + if [[ ! -x ${pkg_config} ]]; then + echo "The binary \`pkg-config\` wasn't found. Please install it" >&2 + exit 1 + fi + + # if we've installed dependencies set the correct paths + if [[ -d ${prefix} ]]; then + pyver=$(python --version | cut -d' ' -f 2 | cut -d. -f1,2) + export PYTHONPATH="${prefix}"/lib/python${pyver}/site-packages:${PYTHONPATH:-} + export PATH=${prefix}/mg5amc/bin:${prefix}/bin:${PATH:-} + export LD_LIBRARY_PATH=${prefix}/lib:${LD_LIBRARY_PATH:-} + export PKG_CONFIG_PATH=${prefix}/lib/pkgconfig:${PKG_CONFIG_PATH:-} + fi + + install_mg5amc= + install_pineappl= + + if ! which mg5_aMC >/dev/null 2>&1; then + install_mg5amc=yes + echo "Madgraph5_aMC@NLO wasn't found" + fi + + if ! "${pkg_config}" pineappl_capi; then + install_pineappl=yes + echo "PineAPPL wasn't found" + elif ! which pineappl >/dev/null 2>&1; then + install_pineappl=yes + echo "PineAPPL wasn't found" + fi + + if [[ -n ${install_mg5amc}${install_pineappl} ]]; then + if yesno "Do you want to install the missing dependencies (into \`.prefix\`)?"; then + if [[ -n ${install_mg5amc} ]]; then + install_mg5amc + fi + if [[ -n ${install_pineappl} ]]; then + install_pineappl + fi + + pyver=$(python --version | cut -d' ' -f 2 | cut -d. -f1,2) + export PYTHONPATH="${prefix}"/lib/python${pyver}/site-packages:${PYTHONPATH:-} + export PATH=${prefix}/mg5amc/bin:${prefix}/bin:${PATH:-} + export LD_LIBRARY_PATH=${prefix}/lib:${LD_LIBRARY_PATH:-} + export PKG_CONFIG_PATH=${prefix}/lib/pkgconfig:${PKG_CONFIG_PATH:-} + else + exit 1 fi + fi - mg5amc=$(which mg5_aMC 2> /dev/null || true) + mg5amc=$(which mg5_aMC 2>/dev/null || true) - if [[ ! -x ${mg5amc} ]]; then - echo "The binary \`mg5_aMC\` wasn't found. Something went wrong" >&2 - exit 1 - fi + if [[ ! -x ${mg5amc} ]]; then + echo "The binary \`mg5_aMC\` wasn't found. Something went wrong" >&2 + exit 1 + fi - pineappl=$(which pineappl 2> /dev/null || true) + pineappl=$(which pineappl 2>/dev/null || true) - if [[ ! -x ${pineappl} ]]; then - echo "The binary \`pineappl\` wasn't found. Something went wrong" >&2 - exit 1 - fi + if [[ ! -x ${pineappl} ]]; then + echo "The binary \`pineappl\` wasn't found. Something went wrong" >&2 + exit 1 + fi } output_and_launch() { - # name of the directory where the output is written to - output="${dataset}"-$(date +%Y%m%d%H%M%S) - - if [[ -d $output ]]; then - # since we add a date postfix to the name this shouldn't happen - echo "Error: output directory already exists" >&2 - exit 1 - fi - - mkdir "${output}" - cd "${output}" - - # copy the output file to the directory and replace the variables - output_file=output.txt - cp ../nnpdf31_proc/"${dataset}"/output.txt "${output_file}" - sed -i "s/@OUTPUT@/${dataset}/g" "${output_file}" - - # create output folder - "${mg5amc}" "${output_file}" |& tee output.log - - # copy patches if there are any; use xargs to properly signal failures - cd "${dataset}" - find ../../nnpdf31_proc/"${dataset}" -name '*.patch' -print0 | \ - xargs -0 -I file sh -c 'patch -p1 < file' - cd - - - # enforce proper analysis - cp ../nnpdf31_proc/"${dataset}"/analysis.f "${dataset}"/FixedOrderAnalysis/"${dataset}".f - sed -i "s/analysis_HwU_template/${dataset}/g" "${dataset}"/Cards/FO_analyse_card.dat - - # copy the launch file to the directory and replace the variables - launch_file=launch.txt - cp ../nnpdf31_proc/"${dataset}"/launch.txt "${launch_file}" - sed -i "s/@OUTPUT@/${dataset}/g" "${launch_file}" - - # TODO: write a list with variables that should be replaced in the launch file; for the time - # being we create the file here, but in the future it should be read from the theory database - cat > variables.txt <&2 + exit 1 + fi + + mkdir "${output}" + cd "${output}" + + # copy the output file to the directory and replace the variables + output_file=output.txt + cp ../nnpdf31_proc/"${dataset}"/output.txt "${output_file}" + sed -i "s/@OUTPUT@/${dataset}/g" "${output_file}" + + # create output folder + "${mg5amc}" "${output_file}" |& tee output.log + + # copy patches if there are any; use xargs to properly signal failures + cd "${dataset}" + find ../../nnpdf31_proc/"${dataset}" -name '*.patch' -print0 | + xargs -0 -I file sh -c 'patch -p1 < file' + cd - + + # enforce proper analysis + cp ../nnpdf31_proc/"${dataset}"/analysis.f "${dataset}"/FixedOrderAnalysis/"${dataset}".f + sed -i "s/analysis_HwU_template/${dataset}/g" "${dataset}"/Cards/FO_analyse_card.dat + + # copy the launch file to the directory and replace the variables + launch_file=launch.txt + cp ../nnpdf31_proc/"${dataset}"/launch.txt "${launch_file}" + sed -i "s/@OUTPUT@/${dataset}/g" "${launch_file}" + + # TODO: write a list with variables that should be replaced in the launch file; for the time + # being we create the file here, but in the future it should be read from the theory database + cat >variables.txt < "${launch_file}".arithmetic - - # replace launch file - mv "${launch_file}".arithmetic "${launch_file}" - - # remove the variables file - rm variables.txt - - # parse launch file for user-defined cuts - user_defined_cuts=$(grep '^#user_defined_cut' launch.txt || true) - - # if there are user-defined cuts, implement them - if [[ -n ${user_defined_cuts} ]]; then - cuts=() - mapfile -d ' ' -t cuts < <( - echo "${user_defined_cuts[@]}" | \ - grep -Eo '\w+[[:blank:]]+=[[:blank:]]+([+-]?[0-9]+([.][0-9]+)?|True|False)' | \ - tr '\n' ' ' - ) - ../run_implement_user_defined_cuts.py "${dataset}"/SubProcesses/cuts.f "${cuts[@]}" - fi - - # launch run - "${mg5amc}" "${launch_file}" |& tee launch.log + }' "${launch_file}" >"${launch_file}".arithmetic + + # replace launch file + mv "${launch_file}".arithmetic "${launch_file}" + + # remove the variables file + rm variables.txt + + # parse launch file for user-defined cuts + user_defined_cuts=$(grep '^#user_defined_cut' launch.txt || true) + + # if there are user-defined cuts, implement them + if [[ -n ${user_defined_cuts} ]]; then + cuts=() + mapfile -d ' ' -t cuts < <( + echo "${user_defined_cuts[@]}" | + grep -Eo '\w+[[:blank:]]+=[[:blank:]]+([+-]?[0-9]+([.][0-9]+)?|True|False)' | + tr '\n' ' ' + ) + ../run_implement_user_defined_cuts.py "${dataset}"/SubProcesses/cuts.f "${cuts[@]}" + fi + + # launch run + "${mg5amc}" "${launch_file}" |& tee launch.log } merge() { - # TODO: the following assumes that all observables belong to the same distribution + # TODO: the following assumes that all observables belong to the same distribution - grid="${dataset}".pineappl + grid="${dataset}".pineappl - # sort the file we want to merge into an array properly (1 2 3 ... 10 11 instead of 1 10 11 ...) - merge=() - mapfile -t merge < <(printf "%s\n" "${dataset}"/Events/run_01*/amcblast_obs_*.pineappl | sort -V) + # sort the file we want to merge into an array properly (1 2 3 ... 10 11 instead of 1 10 11 ...) + merge=() + mapfile -t merge < <(printf "%s\n" "${dataset}"/Events/run_01*/amcblast_obs_*.pineappl | sort -V) - # merge the final bins - "${pineappl}" merge "${grid}" "${merge[@]}" + # merge the final bins + "${pineappl}" merge "${grid}" "${merge[@]}" - # optimize the grids - "${pineappl}" optimize "${grid}" "${grid}".tmp - mv "${grid}".tmp "${grid}" + # optimize the grids + "${pineappl}" optimize "${grid}" "${grid}".tmp + mv "${grid}".tmp "${grid}" - # add metadata - runcard=( "${dataset}"/Events/run_01*/run_01*_tag_1_banner.txt ) - if [[ -f ../nnpdf31_proc/"${dataset}"/metadata.txt ]]; then - eval "$(awk -F= "BEGIN { printf \"pineappl set ${grid} ${grid}.tmp \" } + # add metadata + runcard=("${dataset}"/Events/run_01*/run_01*_tag_1_banner.txt) + if [[ -f ../nnpdf31_proc/"${dataset}"/metadata.txt ]]; then + eval "$(awk -F= "BEGIN { printf \"pineappl set ${grid} ${grid}.tmp \" } { printf \"--entry %s '%s' \", \$1, \$2 } END { printf \"--entry_from_file runcard ${runcard[0]}\\n\" }" \ - ../nnpdf31_proc/"${dataset}"/metadata.txt)" - else - "${pineappl}" set "${grid}" "${grid}".tmp --entry_from_file runcard "${runcard[0]}" - fi - mv "${grid}".tmp "${grid}" - - # find out which PDF set was used to generate the predictions - pdfstring=$(grep "set lhaid" "${launch_file}" | sed 's/set lhaid \([0-9]\+\)/\1/') - - # (re-)produce predictions - "${pineappl}" convolute "${grid}" "${pdfstring}" --scales 9 --absolute --integrated \ - > pineappl.convolute - "${pineappl}" orders "${grid}" "${pdfstring}" --absolute > pineappl.orders - "${pineappl}" pdf_uncertainty --threads=1 "${grid}" "${pdfstring}" > pineappl.pdf_uncertainty - - # extract the numerical results from mg5_aMC - sed '/^ [+-]/!d' "${dataset}"/Events/run_01*/MADatNLO.HwU > results.mg5_aMC - - # extract the integrated results from the PineAPPL grid - head -n -2 pineappl.convolute | tail -n +5 | \ - awk '{ print $4, $5, $6, $7, $8, $9, $10, $11, $12, $13 }' > results.grid - - # compare the results from the grid and from mg5_aMC - paste -d ' ' results.grid results.mg5_aMC | awk \ - 'function abs(x) { return x < 0.0 ? -x : x; } + ../nnpdf31_proc/"${dataset}"/metadata.txt)" + else + "${pineappl}" set "${grid}" "${grid}".tmp --entry_from_file runcard "${runcard[0]}" + fi + mv "${grid}".tmp "${grid}" + + # find out which PDF set was used to generate the predictions + pdfstring=$(grep "set lhaid" "${launch_file}" | sed 's/set lhaid \([0-9]\+\)/\1/') + + # (re-)produce predictions + "${pineappl}" convolute "${grid}" "${pdfstring}" --scales 9 --absolute --integrated \ + >pineappl.convolute + "${pineappl}" orders "${grid}" "${pdfstring}" --absolute >pineappl.orders + "${pineappl}" pdf_uncertainty --threads=1 "${grid}" "${pdfstring}" >pineappl.pdf_uncertainty + + # extract the numerical results from mg5_aMC + sed '/^ [+-]/!d' "${dataset}"/Events/run_01*/MADatNLO.HwU >results.mg5_aMC + + # extract the integrated results from the PineAPPL grid + head -n -2 pineappl.convolute | tail -n +5 | + awk '{ print $4, $5, $6, $7, $8, $9, $10, $11, $12, $13 }' >results.grid + + # compare the results from the grid and from mg5_aMC + paste -d ' ' results.grid results.mg5_aMC | awk \ + 'function abs(x) { return x < 0.0 ? -x : x; } function max(x1,x2,x3,x4,x5,x6,x7,x8,x9) { result=x1; if (x2 > result) { result = x2; } @@ -362,68 +365,68 @@ merge() { $16 != 0.0 ? abs(min($2, $3, $4, $5, $6, $7, $8, $9, $10)-$16)/$16*1000 : 0.0, $17 != 0.0 ? abs(max($2, $3, $4, $5, $6, $7, $8, $9, $10)-$17)/$17*1000 : 0.0 }' | tee results.log - rm results.mg5_aMC results.grid + rm results.mg5_aMC results.grid - runcard_gitversion=$(git describe --long --tags --dirty --always) + runcard_gitversion=$(git describe --long --tags --dirty --always) - bzr=$(which bzr 2> /dev/null || which brz 2> /dev/null || true) + bzr=$(which bzr 2>/dev/null || which brz 2>/dev/null || true) - if [[ -x "${bzr}" ]] && "${bzr}" info "$(dirname "${mg5amc}")"/.. &>/dev/null; then - pushd . > /dev/null - cd "$(dirname "${mg5amc}")"/.. + if [[ -x "${bzr}" ]] && "${bzr}" info "$(dirname "${mg5amc}")"/.. &>/dev/null; then + pushd . >/dev/null + cd "$(dirname "${mg5amc}")"/.. - mg5amc_revno=$("${bzr}" revno) - mg5amc_repo=$("${bzr}" info | grep 'parent branch' | sed 's/[[:space:]]*parent branch:[[:space:]]*//') + mg5amc_revno=$("${bzr}" revno) + mg5amc_repo=$("${bzr}" info | grep 'parent branch' | sed 's/[[:space:]]*parent branch:[[:space:]]*//') - popd > /dev/null - else - echo "warning: couldn't extract mg5_aMC@NLO repository information" + popd >/dev/null + else + echo "warning: couldn't extract mg5_aMC@NLO repository information" - mg5amc_revno="" - mg5amc_repo="" - fi + mg5amc_revno="" + mg5amc_repo="" + fi - "${pineappl}" set "${grid}" "${grid}".tmp \ - --entry_from_file results results.log \ - --entry runcard_gitversion "${runcard_gitversion}" \ - --entry mg5amc_revno "${mg5amc_revno}" \ - --entry mg5amc_repo "${mg5amc_repo}" \ - --entry lumi_id_types pdg_mc_ids - mv "${grid}".tmp "${grid}" - - # if there is anything to do after the run, do it! - if [[ -x ../nnpdf31_proc/"${dataset}"/postrun.sh ]]; then - cp ../nnpdf31_proc/"${dataset}"/postrun.sh . - GRID=$grid ./postrun.sh - fi + "${pineappl}" set "${grid}" "${grid}".tmp \ + --entry_from_file results results.log \ + --entry runcard_gitversion "${runcard_gitversion}" \ + --entry mg5amc_revno "${mg5amc_revno}" \ + --entry mg5amc_repo "${mg5amc_repo}" \ + --entry lumi_id_types pdg_mc_ids + mv "${grid}".tmp "${grid}" - lz4=$(which lz4 2> /dev/null || true) + # if there is anything to do after the run, do it! + if [[ -x ../nnpdf31_proc/"${dataset}"/postrun.sh ]]; then + cp ../nnpdf31_proc/"${dataset}"/postrun.sh . + GRID=$grid ./postrun.sh + fi - # compress the grid with `lz4` if it's available - if [[ -x ${lz4} ]]; then - lz4 -9 "${grid}" - rm "${grid}" - fi + lz4=$(which lz4 2>/dev/null || true) + + # compress the grid with `lz4` if it's available + if [[ -x ${lz4} ]]; then + lz4 -9 "${grid}" + rm "${grid}" + fi } check_args_and_cd_output "$@" if [[ -d $1 ]]; then - if yesno "Shall I regenerate the grid in ``$1``?"; then - cd "$1" - dataset=${1%-[0-9]*} - launch_file=launch.txt - output=$1 - fi + if yesno "Shall I regenerate the grid in $()$1$()?"; then + cd "$1" + dataset=${1%-[0-9]*} + launch_file=launch.txt + output=$1 + fi else - # record the time and write it to `time.log` - { { time { output_and_launch 2>&3; } } 2>time.log; } 3>&2 + # record the time and write it to `time.log` + { { time { output_and_launch 2>&3; }; } 2>time.log; } 3>&2 fi merge if [[ -e time.log ]]; then - cat time.log + cat time.log fi echo "Output stored in ${output}" diff --git a/run/dis_.py b/run/dis_.py index a308d879..05b324fa 100644 --- a/run/dis_.py +++ b/run/dis_.py @@ -66,6 +66,10 @@ def run_dataset(name, pdf): grid_path.unlink() grid_path = cpath - table.print_table(table.compute_data(grid_path, pdf), yad.yadism_results(out, pdf)) + table.print_table( + table.parse_pineappl_table(table.compute_data(grid_path, pdf)), + yad.yadism_results(out, pdf), + dest, + ) tools.print_time(t0, "Grid calculation") diff --git a/run/external/mg5.py b/run/external/mg5.py index e28f49ed..5c15ab55 100644 --- a/run/external/mg5.py +++ b/run/external/mg5.py @@ -5,6 +5,7 @@ import io import os +import numpy as np import pandas as pd import pygit2 @@ -195,19 +196,23 @@ def merge(name, dest): f"{pineappl} pdf_uncertainty --threads=1 {grid} {pdf}".split(), stdout=fd ) - return grid, pdf + return (dest / "pineappl.convolute").read_text().splitlines()[2:-2] def results(dest, mg5_dir): madatnlo = next(iter(mg5_dir.glob("Events/run_01*/MADatNLO.HwU"))).read_text() - table = list( - filter( - lambda line: re.match("^ [+-]", line) is not None, madatnlo.splitlines() - ) + table = filter( + lambda line: re.match("^ [+-]", line) is not None, madatnlo.splitlines() ) - res = io.StringIO("\n".join(table)) - __import__("pdb").set_trace() - df = pd.read_csv(res, header=list(range(len(table[0].split())))) + df = pd.DataFrame(np.array([[float(x) for x in l.split()] for l in table])) + # start column from 1 + df.columns += 1 + df["result"] = df[3] + df["error"] = df[4] + df["sv_min"] = df[6] + df["sv_max"] = df[7] + + return df def annotate_versions(name, dest): @@ -235,10 +240,10 @@ def annotate_versions(name, dest): mg5amc_repo = re.search(r"\s*parent branch:\s*(.*)", mg5amc_repo)[1] entries = [] - entries += ["--entries", "runcard_gitversion", runcard_gitversion] - entries += ["--entries", "mg5amc_revno", mg5amc_revno] - entries += ["--entries", "mg5amc_repo", mg5amc_repo] - entries += ["--entries", "lumi_id_types", "pdg_mc_ids"] + entries += ["--entry", "runcard_gitversion", runcard_gitversion] + entries += ["--entry", "mg5amc_revno", mg5amc_revno] + entries += ["--entry", "mg5amc_repo", mg5amc_repo] + entries += ["--entry", "lumi_id_types", "pdg_mc_ids"] subprocess.run( f"{pineappl} set {grid} {gridtmp}".split() + f"--entry_from_file results {results_log}".split() @@ -258,5 +263,5 @@ def postrun(name, dest): subprocess.run("postrun.sh", cwd=dest) if shutil.which("lz4") is not None: - subprocess.run("lz4 -9 {grid}") + subprocess.run(f"lz4 -9 {grid.name}".split(), cwd=grid.parent) grid.unlink() diff --git a/run/hadronic.py b/run/hadronic.py index 835a514b..908eb591 100644 --- a/run/hadronic.py +++ b/run/hadronic.py @@ -42,11 +42,14 @@ def run_dataset(name, pdf): t0 = time.perf_counter() dest = mg5.run_mc(name) - grid, pdf = mg5.merge(name, dest) + pineappl_table = mg5.merge(name, dest) tools.print_time(t0, "Grid calculation") - table.print_table(table.compute_data(grid, pdf), mg5.results(dest, dest / name)) + table.print_table( + table.parse_pineappl_table(pineappl_table), mg5.results(dest, dest / name), dest + ) mg5.annotate_versions(name, dest) mg5.postrun(name, dest) + print(f"Output stored in {dest.name}") diff --git a/run/table.py b/run/table.py index d581825f..869c0206 100644 --- a/run/table.py +++ b/run/table.py @@ -9,8 +9,10 @@ def compute_data(grid, pdf_name): f"pineappl convolute {grid} {pdf_name} --scales 9 --absolute --integrated".split(), capture_output=True, ) + return pineappl_results.stdout.decode().splitlines()[2:-2] - output = pineappl_results.stdout.decode().splitlines()[2:-2] + +def parse_pineappl_table(output): header = output[0].split() header = [ header[0], @@ -29,7 +31,7 @@ def compute_data(grid, pdf_name): return df -def print_table(pineappl_results, external_results): +def print_table(pineappl_results, external_results, dest): comparison = pd.DataFrame() # bare results @@ -58,6 +60,10 @@ def print_table(pineappl_results, external_results): comparison.replace(float("inf"), 0.0, inplace=True) with pd.option_context( - "display.max_rows", None, "display.float_format", lambda f: f"{f:.1e}" + "display.max_rows", None, "display.float_format", lambda f: f"{f:.2e}" ): - print(comparison) + comp_str = str(comparison) + + with open(dest / "results.log", "w") as fd: + fd.write(comp_str) + print(comp_str) From 804fc9274d4c1fb8c7e48c36725961a4f01ac712 Mon Sep 17 00:00:00 2001 From: Alessandro Candido Date: Fri, 27 Aug 2021 20:08:47 +0200 Subject: [PATCH 22/63] Format table --- run/table.py | 32 ++++++++++++++++++++++++++++---- 1 file changed, 28 insertions(+), 4 deletions(-) diff --git a/run/table.py b/run/table.py index 869c0206..b4b6bda7 100644 --- a/run/table.py +++ b/run/table.py @@ -1,5 +1,7 @@ import subprocess import itertools +import inspect + import pandas as pd @@ -59,10 +61,32 @@ def print_table(pineappl_results, external_results, dest): comparison.replace(float("inf"), 0.0, inplace=True) - with pd.option_context( - "display.max_rows", None, "display.float_format", lambda f: f"{f:.2e}" - ): - comp_str = str(comparison) + header = inspect.cleandoc( + """ + ---------------------------------------------------------------------- + PineAPPL MC sigma central min max + 1/100 sigma 1/1000 1/1000 1/1000 + ---------------------------------------------------------------------- + """ + ) + exp_float = lambda f: f" {f:.6e}" + fixed_decimals = lambda w, n: lambda f: f"{{:{w}.{n}f}}".format(f) + formatters = { + "PineAPPL": exp_float, + "MC": exp_float, + "sigma 1/100": fixed_decimals(7, 3), + "central sigma": fixed_decimals(7, 3), + "central 1/1000": fixed_decimals(8, 4), + "min 1/1000": fixed_decimals(8, 4), + "max 1/1000": fixed_decimals(8, 4), + } + + with pd.option_context("display.max_rows", None): + comp_str = comparison.to_string( + index=False, header=False, formatters=formatters + ) + + comp_str = f"{header}\n{comp_str}" with open(dest / "results.log", "w") as fd: fd.write(comp_str) From 18a74acced40b157675b7fadd06566b6e93cfb1f Mon Sep 17 00:00:00 2001 From: Alessandro Candido Date: Wed, 1 Sep 2021 16:20:40 +0200 Subject: [PATCH 23/63] Fix postrun, move compression to python --- run/external/mg5.py | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/run/external/mg5.py b/run/external/mg5.py index 5c15ab55..96f114eb 100644 --- a/run/external/mg5.py +++ b/run/external/mg5.py @@ -8,6 +8,7 @@ import numpy as np import pandas as pd import pygit2 +import lz4.frame from .. import paths, tools from . import interface @@ -260,8 +261,11 @@ def postrun(name, dest): if os.access((source / "postrun.sh"), os.X_OK): shutil.copy2(source / "postrun.sh", dest) os.environ["GRID"] = str(grid) - subprocess.run("postrun.sh", cwd=dest) - - if shutil.which("lz4") is not None: - subprocess.run(f"lz4 -9 {grid.name}".split(), cwd=grid.parent) - grid.unlink() + subprocess.run("./postrun.sh", cwd=dest) + + with lz4.frame.open( + grid.with_suffix(grid.suffix + ".lz4"), + "wb", + compression_level=lz4.frame.COMPRESSIONLEVEL_MAX, + ) as fd: + fd.write(grid.read_bytes()) From 214a32aa12632c7bf03c28ba112a092eddad778b Mon Sep 17 00:00:00 2001 From: Alessandro Candido Date: Wed, 1 Sep 2021 16:20:40 +0200 Subject: [PATCH 24/63] Fix postrun, move compression to python --- run.sh | 432 -------------------------------------------- run/external/mg5.py | 14 +- 2 files changed, 9 insertions(+), 437 deletions(-) delete mode 100755 run.sh diff --git a/run.sh b/run.sh deleted file mode 100755 index 90616df5..00000000 --- a/run.sh +++ /dev/null @@ -1,432 +0,0 @@ -#!/bin/bash - -prefix=$(pwd)/.prefix - -export LC_ALL=C - -yesno() { - echo -n "$@" "[Y/n]" - read -r reply - - if [[ -z $reply ]]; then - reply=Y - fi - - case "${reply}" in - Yes | yes | Y | y) return 0 ;; - No | no | N | n) return 1 ;; - *) - echo "I didn't understand your reply '${reply}'" - yesno "$@" - ;; - esac -} - -install_mg5amc() { ( - mkdir -p "${prefix}" - - brz=$(which brz 2>/dev/null || true) - bzr=$(which bzr 2>/dev/null || true) - pip=$(which pip 2>/dev/null || true) - - repo=lp:~maddevelopers/mg5amcnlo/3.2.0 - - if [[ -x ${pip} ]] && [[ ! -x ${brz} ]] && [[ ! -x ${bzr} ]]; then - pyver=$(python --version | cut -d' ' -f 2 | cut -d. -f1,2) - export PATH="${prefix}"/bin:${PATH} - export PYTHONPATH="${prefix}"/lib/python${pyver}/site-packages - "${pip}" install --prefix "${prefix}" breezy - brz="${prefix}"/bin/brz - fi - - if [[ -x ${brz} ]]; then - "${brz}" branch "${repo}" "${prefix}"/mg5amc - elif [[ -x ${bzr} ]]; then - "${bzr}" branch "${repo}" "${prefix}"/mg5amc - else - echo "Couldn't install Madgraph5_aMC@NLO" >&2 - exit 1 - fi - - if "${pip}" show six 2>&1 | grep 'Package(s) not found' >/dev/null; then - "${pip}" install --prefix "${prefix}" six - fi - - # in case we're using python3, we need to convert the model file - "${prefix}"/mg5amc/bin/mg5_aMC </dev/null || true) - git=$(which git 2>/dev/null) - - repo=https://github.com/N3PDF/pineappl.git - - if [[ ! -x ${cargo} ]]; then - export CARGO_HOME=${prefix}/cargo - curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs >/tmp/rustup-init - bash /tmp/rustup-init --profile minimal --no-modify-path -y - export PATH=${prefix}/cargo/bin:${PATH} - cargo="${prefix}"/cargo/bin/cargo - elif [[ -d ${prefix}/cargo ]]; then - export CARGO_HOME=${prefix}/cargo - fi - - if [[ -d ${prefix}/pineappl ]]; then - "${git}" pull - else - "${git}" clone ${repo} "${prefix}"/pineappl - fi - - "${cargo}" install --force cargo-c - - pushd . >/dev/null - cd "${prefix}"/pineappl - "${cargo}" cinstall --release --prefix "${prefix}" --manifest-path=pineappl_capi/Cargo.toml - "${cargo}" install --path pineappl_cli --root "${prefix}" - popd >/dev/null -); } - -check_args_and_cd_output() { - # exit script at the first sign of an error - set -o errexit - - # the following exits if undeclared variables are used - set -o nounset - - # exit if some program in a pipeline fails - set -o pipefail - - # check arguments of the script - if (($# != 1)); then - echo "Usage: ./run.sh [dataset]" >&2 - echo " The following datasets are available:" >&2 - - for i in nnpdf31_proc/*; do - echo " - ${i##*/}" >&2 - done - - exit 1 - fi - - # name of the dataset - dataset="$1" - - pkg_config=$(which pkg-config 2>/dev/null || true) - - if [[ ! -x ${pkg_config} ]]; then - echo "The binary \`pkg-config\` wasn't found. Please install it" >&2 - exit 1 - fi - - # if we've installed dependencies set the correct paths - if [[ -d ${prefix} ]]; then - pyver=$(python --version | cut -d' ' -f 2 | cut -d. -f1,2) - export PYTHONPATH="${prefix}"/lib/python${pyver}/site-packages:${PYTHONPATH:-} - export PATH=${prefix}/mg5amc/bin:${prefix}/bin:${PATH:-} - export LD_LIBRARY_PATH=${prefix}/lib:${LD_LIBRARY_PATH:-} - export PKG_CONFIG_PATH=${prefix}/lib/pkgconfig:${PKG_CONFIG_PATH:-} - fi - - install_mg5amc= - install_pineappl= - - if ! which mg5_aMC >/dev/null 2>&1; then - install_mg5amc=yes - echo "Madgraph5_aMC@NLO wasn't found" - fi - - if ! "${pkg_config}" pineappl_capi; then - install_pineappl=yes - echo "PineAPPL wasn't found" - elif ! which pineappl >/dev/null 2>&1; then - install_pineappl=yes - echo "PineAPPL wasn't found" - fi - - if [[ -n ${install_mg5amc}${install_pineappl} ]]; then - if yesno "Do you want to install the missing dependencies (into \`.prefix\`)?"; then - if [[ -n ${install_mg5amc} ]]; then - install_mg5amc - fi - if [[ -n ${install_pineappl} ]]; then - install_pineappl - fi - - pyver=$(python --version | cut -d' ' -f 2 | cut -d. -f1,2) - export PYTHONPATH="${prefix}"/lib/python${pyver}/site-packages:${PYTHONPATH:-} - export PATH=${prefix}/mg5amc/bin:${prefix}/bin:${PATH:-} - export LD_LIBRARY_PATH=${prefix}/lib:${LD_LIBRARY_PATH:-} - export PKG_CONFIG_PATH=${prefix}/lib/pkgconfig:${PKG_CONFIG_PATH:-} - else - exit 1 - fi - fi - - mg5amc=$(which mg5_aMC 2>/dev/null || true) - - if [[ ! -x ${mg5amc} ]]; then - echo "The binary \`mg5_aMC\` wasn't found. Something went wrong" >&2 - exit 1 - fi - - pineappl=$(which pineappl 2>/dev/null || true) - - if [[ ! -x ${pineappl} ]]; then - echo "The binary \`pineappl\` wasn't found. Something went wrong" >&2 - exit 1 - fi -} - -output_and_launch() { - # name of the directory where the output is written to - output="${dataset}"-$(date +%Y%m%d%H%M%S) - - if [[ -d $output ]]; then - # since we add a date postfix to the name this shouldn't happen - echo "Error: output directory already exists" >&2 - exit 1 - fi - - mkdir "${output}" - cd "${output}" - - # copy the output file to the directory and replace the variables - output_file=output.txt - cp ../nnpdf31_proc/"${dataset}"/output.txt "${output_file}" - sed -i "s/@OUTPUT@/${dataset}/g" "${output_file}" - - # create output folder - "${mg5amc}" "${output_file}" |& tee output.log - - # copy patches if there are any; use xargs to properly signal failures - cd "${dataset}" - find ../../nnpdf31_proc/"${dataset}" -name '*.patch' -print0 | - xargs -0 -I file sh -c 'patch -p1 < file' - cd - - - # enforce proper analysis - cp ../nnpdf31_proc/"${dataset}"/analysis.f "${dataset}"/FixedOrderAnalysis/"${dataset}".f - sed -i "s/analysis_HwU_template/${dataset}/g" "${dataset}"/Cards/FO_analyse_card.dat - - # copy the launch file to the directory and replace the variables - launch_file=launch.txt - cp ../nnpdf31_proc/"${dataset}"/launch.txt "${launch_file}" - sed -i "s/@OUTPUT@/${dataset}/g" "${launch_file}" - - # TODO: write a list with variables that should be replaced in the launch file; for the time - # being we create the file here, but in the future it should be read from the theory database - cat >variables.txt <"${launch_file}".arithmetic - - # replace launch file - mv "${launch_file}".arithmetic "${launch_file}" - - # remove the variables file - rm variables.txt - - # parse launch file for user-defined cuts - user_defined_cuts=$(grep '^#user_defined_cut' launch.txt || true) - - # if there are user-defined cuts, implement them - if [[ -n ${user_defined_cuts} ]]; then - cuts=() - mapfile -d ' ' -t cuts < <( - echo "${user_defined_cuts[@]}" | - grep -Eo '\w+[[:blank:]]+=[[:blank:]]+([+-]?[0-9]+([.][0-9]+)?|True|False)' | - tr '\n' ' ' - ) - ../run_implement_user_defined_cuts.py "${dataset}"/SubProcesses/cuts.f "${cuts[@]}" - fi - - # launch run - "${mg5amc}" "${launch_file}" |& tee launch.log -} - -merge() { - # TODO: the following assumes that all observables belong to the same distribution - - grid="${dataset}".pineappl - - # sort the file we want to merge into an array properly (1 2 3 ... 10 11 instead of 1 10 11 ...) - merge=() - mapfile -t merge < <(printf "%s\n" "${dataset}"/Events/run_01*/amcblast_obs_*.pineappl | sort -V) - - # merge the final bins - "${pineappl}" merge "${grid}" "${merge[@]}" - - # optimize the grids - "${pineappl}" optimize "${grid}" "${grid}".tmp - mv "${grid}".tmp "${grid}" - - # add metadata - runcard=("${dataset}"/Events/run_01*/run_01*_tag_1_banner.txt) - if [[ -f ../nnpdf31_proc/"${dataset}"/metadata.txt ]]; then - eval "$(awk -F= "BEGIN { printf \"pineappl set ${grid} ${grid}.tmp \" } - { printf \"--entry %s '%s' \", \$1, \$2 } - END { printf \"--entry_from_file runcard ${runcard[0]}\\n\" }" \ - ../nnpdf31_proc/"${dataset}"/metadata.txt)" - else - "${pineappl}" set "${grid}" "${grid}".tmp --entry_from_file runcard "${runcard[0]}" - fi - mv "${grid}".tmp "${grid}" - - # find out which PDF set was used to generate the predictions - pdfstring=$(grep "set lhaid" "${launch_file}" | sed 's/set lhaid \([0-9]\+\)/\1/') - - # (re-)produce predictions - "${pineappl}" convolute "${grid}" "${pdfstring}" --scales 9 --absolute --integrated \ - >pineappl.convolute - "${pineappl}" orders "${grid}" "${pdfstring}" --absolute >pineappl.orders - "${pineappl}" pdf_uncertainty --threads=1 "${grid}" "${pdfstring}" >pineappl.pdf_uncertainty - - # extract the numerical results from mg5_aMC - sed '/^ [+-]/!d' "${dataset}"/Events/run_01*/MADatNLO.HwU >results.mg5_aMC - - # extract the integrated results from the PineAPPL grid - head -n -2 pineappl.convolute | tail -n +5 | - awk '{ print $4, $5, $6, $7, $8, $9, $10, $11, $12, $13 }' >results.grid - - # compare the results from the grid and from mg5_aMC - paste -d ' ' results.grid results.mg5_aMC | awk \ - 'function abs(x) { return x < 0.0 ? -x : x; } - function max(x1,x2,x3,x4,x5,x6,x7,x8,x9) { - result=x1; - if (x2 > result) { result = x2; } - if (x3 > result) { result = x3; } - if (x4 > result) { result = x4; } - if (x5 > result) { result = x5; } - if (x6 > result) { result = x6; } - if (x7 > result) { result = x7; } - if (x8 > result) { result = x8; } - if (x9 > result) { result = x9; } - return result; - } - function min(x1,x2,x3,x4,x5,x6,x7,x8,x9) { - result=x1; - if (x2 < result) { result = x2; } - if (x3 < result) { result = x3; } - if (x4 < result) { result = x4; } - if (x5 < result) { result = x5; } - if (x6 < result) { result = x6; } - if (x7 < result) { result = x7; } - if (x8 < result) { result = x8; } - if (x9 < result) { result = x9; } - return result; - } - BEGIN { print "----------------------------------------------------------------------" - print " PineAPPL MC sigma central min max " - print " 1/100 sigma 1/1000 1/1000 1/1000" - print "----------------------------------------------------------------------" } - { printf "% e % e %7.3f %7.3f %8.4f %8.4f %8.4f\n", - $1, - $13, - $13 != 0.0 ? $14/$13*100 : 0.0, - $14 != 0.0 ? abs($1-$13)/$14 : 0.0, - $13 != 0.0 ? abs($1-$13)/$13*1000 : 0.0, - $16 != 0.0 ? abs(min($2, $3, $4, $5, $6, $7, $8, $9, $10)-$16)/$16*1000 : 0.0, - $17 != 0.0 ? abs(max($2, $3, $4, $5, $6, $7, $8, $9, $10)-$17)/$17*1000 : 0.0 }' | tee results.log - - rm results.mg5_aMC results.grid - - runcard_gitversion=$(git describe --long --tags --dirty --always) - - bzr=$(which bzr 2>/dev/null || which brz 2>/dev/null || true) - - if [[ -x "${bzr}" ]] && "${bzr}" info "$(dirname "${mg5amc}")"/.. &>/dev/null; then - pushd . >/dev/null - cd "$(dirname "${mg5amc}")"/.. - - mg5amc_revno=$("${bzr}" revno) - mg5amc_repo=$("${bzr}" info | grep 'parent branch' | sed 's/[[:space:]]*parent branch:[[:space:]]*//') - - popd >/dev/null - else - echo "warning: couldn't extract mg5_aMC@NLO repository information" - - mg5amc_revno="" - mg5amc_repo="" - fi - - "${pineappl}" set "${grid}" "${grid}".tmp \ - --entry_from_file results results.log \ - --entry runcard_gitversion "${runcard_gitversion}" \ - --entry mg5amc_revno "${mg5amc_revno}" \ - --entry mg5amc_repo "${mg5amc_repo}" \ - --entry lumi_id_types pdg_mc_ids - mv "${grid}".tmp "${grid}" - - # if there is anything to do after the run, do it! - if [[ -x ../nnpdf31_proc/"${dataset}"/postrun.sh ]]; then - cp ../nnpdf31_proc/"${dataset}"/postrun.sh . - GRID=$grid ./postrun.sh - fi - - lz4=$(which lz4 2>/dev/null || true) - - # compress the grid with `lz4` if it's available - if [[ -x ${lz4} ]]; then - lz4 -9 "${grid}" - rm "${grid}" - fi -} - -check_args_and_cd_output "$@" - -if [[ -d $1 ]]; then - if yesno "Shall I regenerate the grid in $()$1$()?"; then - cd "$1" - dataset=${1%-[0-9]*} - launch_file=launch.txt - output=$1 - fi -else - # record the time and write it to `time.log` - { { time { output_and_launch 2>&3; }; } 2>time.log; } 3>&2 -fi - -merge - -if [[ -e time.log ]]; then - cat time.log -fi - -echo "Output stored in ${output}" diff --git a/run/external/mg5.py b/run/external/mg5.py index 5c15ab55..96f114eb 100644 --- a/run/external/mg5.py +++ b/run/external/mg5.py @@ -8,6 +8,7 @@ import numpy as np import pandas as pd import pygit2 +import lz4.frame from .. import paths, tools from . import interface @@ -260,8 +261,11 @@ def postrun(name, dest): if os.access((source / "postrun.sh"), os.X_OK): shutil.copy2(source / "postrun.sh", dest) os.environ["GRID"] = str(grid) - subprocess.run("postrun.sh", cwd=dest) - - if shutil.which("lz4") is not None: - subprocess.run(f"lz4 -9 {grid.name}".split(), cwd=grid.parent) - grid.unlink() + subprocess.run("./postrun.sh", cwd=dest) + + with lz4.frame.open( + grid.with_suffix(grid.suffix + ".lz4"), + "wb", + compression_level=lz4.frame.COMPRESSIONLEVEL_MAX, + ) as fd: + fd.write(grid.read_bytes()) From eb888f451b525c50c517bad6001328fe991afe2e Mon Sep 17 00:00:00 2001 From: Alessandro Candido Date: Wed, 1 Sep 2021 18:16:06 +0200 Subject: [PATCH 25/63] Implement #user_defined_tau_min and #enable_patch in python --- run/external/mg5.py | 46 +++++++++++++++++++++++++++++++++++++++++++++ run/paths.py | 1 + 2 files changed, 47 insertions(+) diff --git a/run/external/mg5.py b/run/external/mg5.py index 96f114eb..b4efa0c3 100644 --- a/run/external/mg5.py +++ b/run/external/mg5.py @@ -75,6 +75,7 @@ def run_mc(name): launch_file = dest / "launch.txt" launch_file.write_text(launch) + # parse launch file for user-defined cuts user_cuts_pattern = re.compile( r"^#user_defined_cut set (\w+)\s+=\s+([+-]?\d+(?:\.\d+)?|True|False)$" ) @@ -84,8 +85,53 @@ def run_mc(name): if m is not None: user_cuts.append((m[1], m[2])) + # if there are user-defined cuts, implement them apply_user_cuts(mg5_dir / "SubProcesses" / "cuts.f", user_cuts) + # parse launch file for user-defined minimum tau + user_taumin_pattern = re.compile(r"^#user_defined_tau_min (.*)") + user_taumin = None + for line in launch.splitlines(): + m = re.fullmatch(user_taumin_pattern, line) + if m is not None: + try: + user_taumin = float(m[1]) + except ValueError: + raise ValueError("User defined tau_min is expected to be a number") + + if user_taumin is not None: + set_tau_min_patch = ( + (paths.patches / "set_tau_min.patch") + .read_text() + .replace("@TAU_MIN@", f"{user_taumin}d0") + ) + (dest / "set_tau_min.patch").write_text(set_tau_min_patch) + subprocess.run( + f"patch -p1 -d '{mg5_dir}'".split(), input=set_tau_min_patch, text=True + ) + + # parse launch file for other patches + enable_patches_pattern = re.compile(r"^#enable_patch (.*)") + enable_patches_list = [] + for line in launch.splitlines(): + m = re.fullmatch(user_taumin_pattern, line) + if m is not None: + enable_patches_list.append(m[1]) + + if len(enable_patches_list) != 0: + for patch in enable_patches_list: + patch_file = paths.patches / patch + patch_file = patch_file.with_suffix(patch_file.suffix + ".patch") + if not patch_file.exists(): + raise ValueError( + f"Patch '{patch}' requested, but does not exist in patches folder" + ) + subprocess.run( + f"patch -p1 -d '{mg5_dir}'".split(), + input=patch_file.read_text(), + text=True, + ) + # launch run launch_log = tools.run_subprocess([str(paths.mg5_exe), str(launch_file)], dest=dest) (dest / "launch.log").write_text(launch_log) diff --git a/run/paths.py b/run/paths.py index 934f0cbe..588bd476 100644 --- a/run/paths.py +++ b/run/paths.py @@ -10,6 +10,7 @@ # external runcards = root / "nnpdf31_proc" +patches = root / "patches" # prefix and locally installed prefix = root / ".prefix" From ba5afd58e7debd4b3d3c1942c8f41042c2cdf8b3 Mon Sep 17 00:00:00 2001 From: Alessandro Candido Date: Fri, 3 Sep 2021 12:43:33 +0200 Subject: [PATCH 26/63] Remove hadronic & dis commands --- pyproject.toml | 3 +- run/__init__.py | 3 +- run/external/interface.py | 65 +++++- run/external/mg5.py | 428 ++++++++++++++++++-------------------- run/hadronic.py | 55 ----- run/run.py | 47 +++++ 6 files changed, 310 insertions(+), 291 deletions(-) delete mode 100644 run/hadronic.py create mode 100644 run/run.py diff --git a/pyproject.toml b/pyproject.toml index d9c1f3e7..372f10c3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -24,8 +24,7 @@ pytest = "^5.2" pdbpp = "^0.10.3" [tool.poetry.scripts] -dis = "run:dis" -hadronic = "run:hadronic" +run = "run:run" [build-system] requires = ["poetry-core>=1.0.0"] diff --git a/run/__init__.py b/run/__init__.py index a8036d46..ca27042b 100644 --- a/run/__init__.py +++ b/run/__init__.py @@ -1,4 +1,3 @@ __version__ = "0.0.0" -from .hadronic import hadronic -from .dis_ import dis +from .run import run diff --git a/run/external/interface.py b/run/external/interface.py index 57884a18..8451324d 100644 --- a/run/external/interface.py +++ b/run/external/interface.py @@ -1,15 +1,74 @@ import abc +import shutil +import subprocess + +import pygit2 + +from .. import paths, tools class External(abc.ABC): + def __init__(self, name): + self.name = name + + @property + def source(self): + return paths.runcards / self.name + + @property + def dest(self): + return tools.create_folder(self.name) + + @property + def grid(self): + return self.dest / f"{self.name}.pineappl" + + @property + def gridtmp(self): + return self.dest / f"{self.name}.pineappl.tmp" + + def update_with_tmp(self): + shutil.move(self.gridtmp, self.grid) + @abc.abstractmethod def run(self): pass - @abc.abstractmethod - def postprocess(self): + @abc.abstractproperty + def results(self): pass @abc.abstractproperty - def results(self): + def generate_pineappl(self): + pass + + @abc.abstractmethod + def collect_versions(self): + pass + + def annotate_versions(self): + results_log = self.dest / "results.log" + pineappl = paths.pineappl_exe() + + versions = {} + versions["runcard_gitversion"] = pygit2.Repository(paths.root).describe( + always_use_long_format=True, + describe_strategy=pygit2.GIT_DESCRIBE_TAGS, + dirty_suffix="-dirty", + show_commit_oid_as_fallback=True, + ) + + entries = [] + for name, version in versions.items(): + entries += ["--entry", name, version] + entries += ["--entry", "lumi_id_types", "pdg_mc_ids"] + subprocess.run( + f"{pineappl} set {self.grid} {self.gridtmp}".split() + + f"--entry_from_file results {results_log}".split() + + entries + ) + self.update_with_tmp() + + @abc.abstractmethod + def postprocess(self): pass diff --git a/run/external/mg5.py b/run/external/mg5.py index b4efa0c3..24062527 100644 --- a/run/external/mg5.py +++ b/run/external/mg5.py @@ -2,12 +2,10 @@ import json import re import shutil -import io import os import numpy as np import pandas as pd -import pygit2 import lz4.frame from .. import paths, tools @@ -15,128 +13,222 @@ class Mg5(interface.External): - pass + @property + def mg5_dir(self): + return self.dest / self.name + + def run(self): + # copy the output file to the directory and replace the variables + output = (self.source / "output.txt").read_text().replace("@OUTPUT@", self.name) + output_file = self.dest / "output.txt" + output_file.write_text(output) + + # create output folder + output_log = tools.run_subprocess( + [str(paths.mg5_exe), str(output_file)], dest=self.dest + ) + (self.dest / "output.log").write_text(output_log) + + # copy patches if there are any; use xargs to properly signal failures + for p in self.source.iterdir(): + if p.suffix == ".patch": + subprocess.run( + "patch -p1".split(), + input=p.read_text(), + text=True, + cwd=self.mg5_dir, + ) + # enforce proper analysis + # - copy analysis.f + analysis = (paths.runcards / self.name / "analysis.f").read_text() + (self.mg5_dir / "FixedOrderAnalysis" / f"{self.name}.f").write_text(analysis) + # - update analysis card + analysis_card = self.mg5_dir / "Cards" / "FO_analyse_card.dat" + analysis_card.write_text( + analysis_card.read_text().replace("analysis_HwU_template", self.name) + ) -def run_mc(name): - source = paths.runcards / name - dest = tools.create_folder(name) - mg5_dir = dest / name + # copy the launch file to the directory and replace the variables + launch = (self.source / "launch.txt").read_text().replace("@OUTPUT@", self.name) - # copy the output file to the directory and replace the variables - output = (source / "output.txt").read_text().replace("@OUTPUT@", name) - output_file = dest / "output.txt" - output_file.write_text(output) + # TODO: write a list with variables that should be replaced in the launch file; for the time + # being we create the file here, but in the future it should be read from the theory database + variables = json.loads((paths.pkg / "variables.json").read_text()) - # create output folder - output_log = tools.run_subprocess([str(paths.mg5_exe), str(output_file)], dest=dest) - (dest / "output.log").write_text(output_log) + # replace the variables with their values + for name, value in variables.items(): + launch = launch.replace(f"@{name}@", value) - # copy patches if there are any; use xargs to properly signal failures - for p in source.iterdir(): - if p.suffix == ".patch": + # finally write launch + launch_file = self.dest / "launch.txt" + launch_file.write_text(launch) + + # parse launch file for user-defined cuts + user_cuts_pattern = re.compile( + r"^#user_defined_cut set (\w+)\s+=\s+([+-]?\d+(?:\.\d+)?|True|False)$" + ) + user_cuts = [] + for line in launch.splitlines(): + m = re.fullmatch(user_cuts_pattern, line) + if m is not None: + user_cuts.append((m[1], m[2])) + + # if there are user-defined cuts, implement them + apply_user_cuts(self.mg5_dir / "SubProcesses" / "cuts.f", user_cuts) + + # parse launch file for user-defined minimum tau + user_taumin_pattern = re.compile(r"^#user_defined_tau_min (.*)") + user_taumin = None + for line in launch.splitlines(): + m = re.fullmatch(user_taumin_pattern, line) + if m is not None: + try: + user_taumin = float(m[1]) + except ValueError: + raise ValueError("User defined tau_min is expected to be a number") + + if user_taumin is not None: + set_tau_min_patch = ( + (paths.patches / "set_tau_min.patch") + .read_text() + .replace("@TAU_MIN@", f"{user_taumin}d0") + ) + (self.dest / "set_tau_min.patch").write_text(set_tau_min_patch) subprocess.run( - "patch -p1".split(), input=p.read_text(), text=True, cwd=mg5_dir + f"patch -p1 -d '{self.mg5_dir}'".split(), + input=set_tau_min_patch, + text=True, ) - # enforce proper analysis - # - copy analysis.f - analysis = (paths.runcards / name / "analysis.f").read_text() - (mg5_dir / "FixedOrderAnalysis" / f"{name}.f").write_text(analysis) - # - update analysis card - analysis_card = mg5_dir / "Cards" / "FO_analyse_card.dat" - analysis_card.write_text( - analysis_card.read_text().replace("analysis_HwU_template", name) - ) - - # copy the launch file to the directory and replace the variables - launch = (source / "launch.txt").read_text().replace("@OUTPUT@", name) - - # TODO: write a list with variables that should be replaced in the launch file; for the time - # being we create the file here, but in the future it should be read from the theory database - variables = json.loads((paths.pkg / "variables.json").read_text()) - - # replace the variables with their values - for name, value in variables.items(): - launch = launch.replace(f"@{name}@", value) - - # perform simple arithmetic on lines containing 'set' and '=' and arithmetic operators - # interpreter = asteval.Interpreter() # use asteval for safety - # lines = [] - # pattern = re.compile(r"(set [\w_]* = )(.*)") - # for line in launch.splitlines(): - # m = re.fullmatch(pattern, line) - # if m is not None: - # line = m[1] + str(interpreter.eval(m[2])) - # lines.append(line) - # launch = "\n".join(lines) - - # finally write launch - launch_file = dest / "launch.txt" - launch_file.write_text(launch) - - # parse launch file for user-defined cuts - user_cuts_pattern = re.compile( - r"^#user_defined_cut set (\w+)\s+=\s+([+-]?\d+(?:\.\d+)?|True|False)$" - ) - user_cuts = [] - for line in launch.splitlines(): - m = re.fullmatch(user_cuts_pattern, line) - if m is not None: - user_cuts.append((m[1], m[2])) - - # if there are user-defined cuts, implement them - apply_user_cuts(mg5_dir / "SubProcesses" / "cuts.f", user_cuts) - - # parse launch file for user-defined minimum tau - user_taumin_pattern = re.compile(r"^#user_defined_tau_min (.*)") - user_taumin = None - for line in launch.splitlines(): - m = re.fullmatch(user_taumin_pattern, line) - if m is not None: - try: - user_taumin = float(m[1]) - except ValueError: - raise ValueError("User defined tau_min is expected to be a number") + # parse launch file for other patches + enable_patches_pattern = re.compile(r"^#enable_patch (.*)") + enable_patches_list = [] + for line in launch.splitlines(): + m = re.fullmatch(user_taumin_pattern, line) + if m is not None: + enable_patches_list.append(m[1]) + + if len(enable_patches_list) != 0: + for patch in enable_patches_list: + patch_file = paths.patches / patch + patch_file = patch_file.with_suffix(patch_file.suffix + ".patch") + if not patch_file.exists(): + raise ValueError( + f"Patch '{patch}' requested, but does not exist in patches folder" + ) + subprocess.run( + f"patch -p1 -d '{self.mg5_dir}'".split(), + input=patch_file.read_text(), + text=True, + ) - if user_taumin is not None: - set_tau_min_patch = ( - (paths.patches / "set_tau_min.patch") - .read_text() - .replace("@TAU_MIN@", f"{user_taumin}d0") + # launch run + launch_log = tools.run_subprocess( + [str(paths.mg5_exe), str(launch_file)], dest=self.dest + ) + (self.dest / "launch.log").write_text(launch_log) + + def results(self): + madatnlo = next( + iter(self.mg5_dir.glob("Events/run_01*/MADatNLO.HwU")) + ).read_text() + table = filter( + lambda line: re.match("^ [+-]", line) is not None, madatnlo.splitlines() ) - (dest / "set_tau_min.patch").write_text(set_tau_min_patch) + df = pd.DataFrame(np.array([[float(x) for x in l.split()] for l in table])) + # start column from 1 + df.columns += 1 + df["result"] = df[3] + df["error"] = df[4] + df["sv_min"] = df[6] + df["sv_max"] = df[7] + + return df + + def generate_pineappl(self): + pineappl = paths.pineappl_exe() + + # merge the final bins + mg5_grids = " ".join( + sorted( + str(p) + for p in self.mg5_dir.glob("Events/run_01*/amcblast_obs_*.pineappl") + ) + ) + subprocess.run(f"{pineappl} merge {self.grid} {mg5_grids}".split()) + + # optimize the grids + subprocess.run(f"{pineappl} optimize {self.grid} {self.gridtmp}".split()) + self.update_with_tmp() + + # add metadata + metadata = self.source / "metadata.txt" + runcard = next( + iter(self.mg5_dir.glob("Events/run_01*/run_01*_tag_1_banner.txt")) + ) + entries = [] + if metadata.exists(): + for line in metadata.read_text().splitlines(): + k, v = line.split("=") + entries += ["--entry", k, f"'{v}'"] subprocess.run( - f"patch -p1 -d '{mg5_dir}'".split(), input=set_tau_min_patch, text=True + f"{pineappl} set {self.grid} {self.gridtmp}".split() + + entries + + f"--entry_from_file runcard {runcard}".split() ) + self.update_with_tmp() - # parse launch file for other patches - enable_patches_pattern = re.compile(r"^#enable_patch (.*)") - enable_patches_list = [] - for line in launch.splitlines(): - m = re.fullmatch(user_taumin_pattern, line) - if m is not None: - enable_patches_list.append(m[1]) - - if len(enable_patches_list) != 0: - for patch in enable_patches_list: - patch_file = paths.patches / patch - patch_file = patch_file.with_suffix(patch_file.suffix + ".patch") - if not patch_file.exists(): - raise ValueError( - f"Patch '{patch}' requested, but does not exist in patches folder" - ) + # find out which PDF set was used to generate the predictions + pdf = re.search(r"set lhaid (\d+)", (self.dest / "launch.txt").read_text())[1] + + # (re-)produce predictions + with open(self.dest / "pineappl.convolute", "w") as fd: subprocess.run( - f"patch -p1 -d '{mg5_dir}'".split(), - input=patch_file.read_text(), - text=True, + f"{pineappl} convolute {self.grid} {pdf} --scales 9 --absolute --integrated".split(), + stdout=fd, + ) + with open(self.dest / "pineappl.orders", "w") as fd: + subprocess.run( + f"{pineappl} orders {self.grid} {pdf} --absolute".split(), stdout=fd + ) + with open(self.dest / "pineappl.pdf_uncertainty", "w") as fd: + subprocess.run( + f"{pineappl} pdf_uncertainty --threads=1 {self.grid} {pdf}".split(), + stdout=fd, + ) + + return (self.dest / "pineappl.convolute").read_text().splitlines()[2:-2] + + def collect_versions(self): + versions = {} + versions["mg5amc_revno"] = ( + subprocess.run( + "brz revno".split(), cwd=paths.mg5amc, stdout=subprocess.PIPE ) + .stdout.decode() + .strip() + ) + mg5amc_repo = ( + subprocess.run("brz info".split(), cwd=paths.mg5amc, stdout=subprocess.PIPE) + .stdout.decode() + .strip() + ) + versions["mg5amc_repo"] = re.search(r"\s*parent branch:\s*(.*)", mg5amc_repo)[1] + return versions - # launch run - launch_log = tools.run_subprocess([str(paths.mg5_exe), str(launch_file)], dest=dest) - (dest / "launch.log").write_text(launch_log) + def postprocess(self): + if os.access((self.source / "postrun.sh"), os.X_OK): + shutil.copy2(self.source / "postrun.sh", self.dest) + os.environ["GRID"] = str(self.grid) + subprocess.run("./postrun.sh", cwd=self.dest) - return dest + with lz4.frame.open( + self.grid.with_suffix(self.grid.suffix + ".lz4"), + "wb", + compression_level=lz4.frame.COMPRESSIONLEVEL_MAX, + ) as fd: + fd.write(self.grid.read_bytes()) def find_marker_position(insertion_marker, contents): @@ -193,125 +285,3 @@ def apply_user_cuts(file_path, user_cuts): with open(file_path, "w") as fd: fd.writelines(contents) - - -def merge(name, dest): - source = paths.runcards / name - mg5_dir = dest / name - grid = dest / f"{name}.pineappl" - gridtmp = dest / f"{name}.pineappl.tmp" - pineappl = paths.pineappl_exe() - - # merge the final bins - mg5_grids = " ".join( - sorted(str(p) for p in mg5_dir.glob("Events/run_01*/amcblast_obs_*.pineappl")) - ) - subprocess.run(f"{pineappl} merge {grid} {mg5_grids}".split()) - - # optimize the grids - subprocess.run(f"{pineappl} optimize {grid} {gridtmp}".split()) - shutil.move(gridtmp, grid) - - # add metadata - metadata = source / "metadata.txt" - runcard = next(iter(mg5_dir.glob("Events/run_01*/run_01*_tag_1_banner.txt"))) - entries = [] - if metadata.exists(): - for line in metadata.read_text().splitlines(): - k, v = line.split("=") - entries += ["--entry", k, f"'{v}'"] - subprocess.run( - f"{pineappl} set {grid} {gridtmp}".split() - + entries - + f"--entry_from_file runcard {runcard}".split() - ) - shutil.move(gridtmp, grid) - - # find out which PDF set was used to generate the predictions - pdf = re.search(r"set lhaid (\d+)", (dest / "launch.txt").read_text())[1] - - # (re-)produce predictions - with open(dest / "pineappl.convolute", "w") as fd: - subprocess.run( - f"{pineappl} convolute {grid} {pdf} --scales 9 --absolute --integrated".split(), - stdout=fd, - ) - with open(dest / "pineappl.orders", "w") as fd: - subprocess.run(f"{pineappl} orders {grid} {pdf} --absolute".split(), stdout=fd) - with open(dest / "pineappl.pdf_uncertainty", "w") as fd: - subprocess.run( - f"{pineappl} pdf_uncertainty --threads=1 {grid} {pdf}".split(), stdout=fd - ) - - return (dest / "pineappl.convolute").read_text().splitlines()[2:-2] - - -def results(dest, mg5_dir): - madatnlo = next(iter(mg5_dir.glob("Events/run_01*/MADatNLO.HwU"))).read_text() - table = filter( - lambda line: re.match("^ [+-]", line) is not None, madatnlo.splitlines() - ) - df = pd.DataFrame(np.array([[float(x) for x in l.split()] for l in table])) - # start column from 1 - df.columns += 1 - df["result"] = df[3] - df["error"] = df[4] - df["sv_min"] = df[6] - df["sv_max"] = df[7] - - return df - - -def annotate_versions(name, dest): - grid = dest / f"{name}.pineappl" - gridtmp = dest / f"{name}.pineappl.tmp" - results_log = dest / "results.log" - pineappl = paths.pineappl_exe() - - runcard_gitversion = pygit2.Repository(paths.root).describe( - always_use_long_format=True, - describe_strategy=pygit2.GIT_DESCRIBE_TAGS, - dirty_suffix="-dirty", - show_commit_oid_as_fallback=True, - ) - mg5amc_revno = ( - subprocess.run("brz revno".split(), cwd=paths.mg5amc, stdout=subprocess.PIPE) - .stdout.decode() - .strip() - ) - mg5amc_repo = ( - subprocess.run("brz info".split(), cwd=paths.mg5amc, stdout=subprocess.PIPE) - .stdout.decode() - .strip() - ) - mg5amc_repo = re.search(r"\s*parent branch:\s*(.*)", mg5amc_repo)[1] - - entries = [] - entries += ["--entry", "runcard_gitversion", runcard_gitversion] - entries += ["--entry", "mg5amc_revno", mg5amc_revno] - entries += ["--entry", "mg5amc_repo", mg5amc_repo] - entries += ["--entry", "lumi_id_types", "pdg_mc_ids"] - subprocess.run( - f"{pineappl} set {grid} {gridtmp}".split() - + f"--entry_from_file results {results_log}".split() - + entries - ) - shutil.move(gridtmp, grid) - - -def postrun(name, dest): - source = paths.runcards / name - mg5_dir = dest / name - grid = dest / f"{name}.pineappl" - - if os.access((source / "postrun.sh"), os.X_OK): - shutil.copy2(source / "postrun.sh", dest) - os.environ["GRID"] = str(grid) - subprocess.run("./postrun.sh", cwd=dest) - - with lz4.frame.open( - grid.with_suffix(grid.suffix + ".lz4"), - "wb", - compression_level=lz4.frame.COMPRESSIONLEVEL_MAX, - ) as fd: - fd.write(grid.read_bytes()) diff --git a/run/hadronic.py b/run/hadronic.py deleted file mode 100644 index 908eb591..00000000 --- a/run/hadronic.py +++ /dev/null @@ -1,55 +0,0 @@ -import time - -import click -import rich - -from . import install, paths, tools, table -from .external import mg5 - - -@click.command() -@click.option("--datasets", multiple=True) -@click.option("--pdf", default="NNPDF31_nlo_as_0118_luxqed") -def hadronic(datasets, pdf): - rich.print("Computing [blue]hadronic[/]...") - if len(datasets) == 0: - datasets = tools.select_datasets([p.stem for p in load_datasets()]) - - rich.print(datasets) - install_reqs() - for name in datasets: - run_dataset(name, pdf) - - -def load_datasets(): - hadronic_sets = [ - p for p in paths.runcards.iterdir() if not (p / "observable.yaml").is_file() - ] - return hadronic_sets - - -def install_reqs(): - t0 = time.perf_counter() - - install.update_environ() - install.mg5amc() - install.pineappl() - - tools.print_time(t0, "Installation") - - -def run_dataset(name, pdf): - t0 = time.perf_counter() - - dest = mg5.run_mc(name) - pineappl_table = mg5.merge(name, dest) - - tools.print_time(t0, "Grid calculation") - - table.print_table( - table.parse_pineappl_table(pineappl_table), mg5.results(dest, dest / name), dest - ) - - mg5.annotate_versions(name, dest) - mg5.postrun(name, dest) - print(f"Output stored in {dest.name}") diff --git a/run/run.py b/run/run.py new file mode 100644 index 00000000..0b4b41da --- /dev/null +++ b/run/run.py @@ -0,0 +1,47 @@ +import time + +import click +import rich + +from . import install, tools, table +from .external import mg5 + + +@click.command() +@click.argument("dataset") +@click.option("--pdf", default="NNPDF31_nlo_as_0118_luxqed") +def run(dataset, pdf): + rich.print("Computing [blue]hadronic[/]...") + + rich.print(dataset) + install_reqs() + run_dataset(dataset, pdf) + + +def install_reqs(): + t0 = time.perf_counter() + + install.update_environ() + install.mg5amc() + install.pineappl() + + tools.print_time(t0, "Installation") + + +def run_dataset(name, pdf): + t0 = time.perf_counter() + + runner = mg5.Mg5(name) + + tools.print_time(t0, "Grid calculation") + + runner.run() + table.print_table( + table.parse_pineappl_table(runner.generate_pineappl()), + runner.results(), + runner.dest, + ) + + runner.annotate_versions() + runner.postprocess() + print(f"Output stored in {runner.dest.name}") From baf5caa9ac85bcaa162a7c13adb8b424ad27819e Mon Sep 17 00:00:00 2001 From: Alessandro Candido Date: Sat, 4 Sep 2021 15:12:51 +0200 Subject: [PATCH 27/63] Make dis generation working back --- run/dis_.py | 53 ------------------- run/external/interface.py | 9 ++-- run/external/yad.py | 108 +++++++++++++++++++++++++------------- run/run.py | 14 +++-- run/tools.py | 4 ++ 5 files changed, 91 insertions(+), 97 deletions(-) diff --git a/run/dis_.py b/run/dis_.py index 05b324fa..b49e56e7 100644 --- a/run/dis_.py +++ b/run/dis_.py @@ -2,8 +2,6 @@ import click import rich -import yaml -import yadism from . import install, tools, paths, table from .external import yad @@ -13,25 +11,6 @@ @click.option("--datasets", multiple=True) @click.option("--pdf", default="NNPDF31_nlo_as_0118_luxqed") def dis(datasets, pdf): - rich.print("Computing [red]dis[/]...") - if len(datasets) == 0: - datasets = tools.select_datasets([p.stem for p in load_datasets()]) - - rich.print(datasets) - - install_reqs() - - for name in datasets: - if tools.avoid_recompute(name): - continue - run_dataset(name, pdf) - - -def load_datasets(): - dis_sets = [ - p for p in paths.runcards.iterdir() if (p / "observable.yaml").is_file() - ] - return dis_sets def install_reqs(): @@ -41,35 +20,3 @@ def install_reqs(): install.pineappl() tools.print_time(t0, "Installation") - - -def run_dataset(name, pdf): - t0 = time.perf_counter() - - # load runcards - with open(paths.pkg / "theory.yaml") as t: - theory = yaml.safe_load(t) - with open(paths.runcards / name / "observable.yaml") as o: - obs = yaml.safe_load(o) - - # run yadism - out = yadism.run_yadism(theory, obs) - - # dump pineappl - dest = tools.create_folder(name) - grid_path = dest / f"{name}.pineappl" - out.dump_pineappl_to_file(str(grid_path), next(iter(obs["observables"].keys()))) - - # compress - cpath = tools.compress(grid_path) - if cpath.exists(): - grid_path.unlink() - grid_path = cpath - - table.print_table( - table.parse_pineappl_table(table.compute_data(grid_path, pdf)), - yad.yadism_results(out, pdf), - dest, - ) - - tools.print_time(t0, "Grid calculation") diff --git a/run/external/interface.py b/run/external/interface.py index 8451324d..2691574b 100644 --- a/run/external/interface.py +++ b/run/external/interface.py @@ -1,6 +1,7 @@ import abc import shutil import subprocess +from pkgconfig.pkgconfig import exists import pygit2 @@ -8,17 +9,15 @@ class External(abc.ABC): - def __init__(self, name): + def __init__(self, name, pdf): self.name = name + self.pdf = pdf + self.dest = tools.create_folder(self.name) @property def source(self): return paths.runcards / self.name - @property - def dest(self): - return tools.create_folder(self.name) - @property def grid(self): return self.dest / f"{self.name}.pineappl" diff --git a/run/external/yad.py b/run/external/yad.py index ccaab9c3..6a4b9a63 100644 --- a/run/external/yad.py +++ b/run/external/yad.py @@ -1,47 +1,83 @@ from functools import reduce import pandas as pd +import yaml +import yadism +import lhapdf -from .. import tools +from .. import paths, table, tools +from . import interface -def yadism_results(out, pdf_name): - import lhapdf +class Yadism(interface.External): + def __init__(self, *args): + super().__init__(*args) + self.out = None - pdf = lhapdf.mkPDF(pdf_name) - pdf_out = out.apply_pdf_alphas_alphaqed_xir_xif( - pdf, - lambda muR: lhapdf.mkAlphaS(pdf_name).alphasQ(muR), - lambda _muR: 0, - 1.0, - 1.0, - ) - pdf_out = next(iter(pdf_out.tables.values())) + def run(self): + print("Running yadism...") - sv_pdf_out = [] - for xiR, xiF in tools.nine_points: - sv_point = out.apply_pdf_alphas_alphaqed_xir_xif( + # load runcards + with open(paths.pkg / "theory.yaml") as t: + theory = yaml.safe_load(t) + with open(paths.runcards / self.name / "observable.yaml") as o: + obs = yaml.safe_load(o) + + # run yadism + self.out = yadism.run_yadism(theory, obs) + + # dump pineappl + self.out.dump_pineappl_to_file( + str(self.grid), next(iter(obs["observables"].keys())) + ) + + def results(self): + pdf = lhapdf.mkPDF(self.pdf) + pdf_out = self.out.apply_pdf_alphas_alphaqed_xir_xif( pdf, - lambda muR: lhapdf.mkAlphaS(pdf_name).alphasQ(muR), - lambda _muR: 0.0, - xiR, - xiF, + lambda muR: lhapdf.mkAlphaS(self.pdf).alphasQ(muR), + lambda _muR: 0, + 1.0, + 1.0, ) - df = ( - next(iter(sv_point.tables.values())) - .rename({"result": (xiR, xiF)}, axis=1) - .drop("error", axis=1) + pdf_out = next(iter(pdf_out.tables.values())) + + sv_pdf_out = [] + for xiR, xiF in tools.nine_points: + sv_point = self.out.apply_pdf_alphas_alphaqed_xir_xif( + pdf, + lambda muR: lhapdf.mkAlphaS(self.pdf).alphasQ(muR), + lambda _muR: 0.0, + xiR, + xiF, + ) + df = ( + next(iter(sv_point.tables.values())) + .rename({"result": (xiR, xiF)}, axis=1) + .drop("error", axis=1) + ) + sv_pdf_out.append(df) + + sv_pdf_merged = reduce( + lambda left, right: pd.merge(left, right, on=["x", "Q2"], how="outer"), + sv_pdf_out, ) - sv_pdf_out.append(df) - - sv_pdf_merged = reduce( - lambda left, right: pd.merge(left, right, on=["x", "Q2"], how="outer"), - sv_pdf_out, - ) - svdf = sv_pdf_merged[ - list(filter(lambda name: isinstance(name, tuple), sv_pdf_merged.columns)) - ] - pdf_out["sv_max"] = svdf.max(axis=1) - pdf_out["sv_min"] = svdf.min(axis=1) - - return pdf_out + svdf = sv_pdf_merged[ + list(filter(lambda name: isinstance(name, tuple), sv_pdf_merged.columns)) + ] + pdf_out["sv_max"] = svdf.max(axis=1) + pdf_out["sv_min"] = svdf.min(axis=1) + + return pdf_out + + def generate_pineappl(self): + return table.compute_data(self.grid, self.pdf) + + def collect_versions(self): + return {} + + def postprocess(self): + # compress + compressed_path = tools.compress(self.grid) + if compressed_path.exists(): + self.grid.unlink() diff --git a/run/run.py b/run/run.py index 0b4b41da..eab00f4d 100644 --- a/run/run.py +++ b/run/run.py @@ -1,20 +1,23 @@ import time +import pathlib import click import rich from . import install, tools, table -from .external import mg5 +from .external import mg5, yad @click.command() @click.argument("dataset") @click.option("--pdf", default="NNPDF31_nlo_as_0118_luxqed") def run(dataset, pdf): - rich.print("Computing [blue]hadronic[/]...") + dataset = pathlib.Path(dataset).name rich.print(dataset) install_reqs() + if tools.avoid_recompute(dataset): + return run_dataset(dataset, pdf) @@ -31,7 +34,12 @@ def install_reqs(): def run_dataset(name, pdf): t0 = time.perf_counter() - runner = mg5.Mg5(name) + if tools.is_dis(name): + rich.print(f"Computing [red]{name}[/]...") + runner = yad.Yadism(name, pdf) + else: + rich.print(f"Computing [blue]{name}[/]...") + runner = mg5.Mg5(name, pdf) tools.print_time(t0, "Grid calculation") diff --git a/run/tools.py b/run/tools.py index 84b67ed1..68fcefab 100644 --- a/run/tools.py +++ b/run/tools.py @@ -31,6 +31,10 @@ def similar(a, b): re_space = re.compile(".*\s+$", re.M) +def is_dis(name): + return (paths.runcards / name / "observable.yaml").exists() + + class Completer: def __init__(self, tokens): self.tokens = tokens From cc4416c57fa84fb3fd25669dcea550f24d4da3bf Mon Sep 17 00:00:00 2001 From: Alessandro Candido Date: Thu, 30 Sep 2021 16:20:04 +0200 Subject: [PATCH 28/63] Introduce pre-commit --- .pre-commit-config.yaml | 18 +++++ poetry.lock | 141 +++++++++++++++++++++++++++++++++++++++- pyproject.toml | 4 +- 3 files changed, 161 insertions(+), 2 deletions(-) create mode 100644 .pre-commit-config.yaml diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 00000000..027f1be4 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,18 @@ +# See https://pre-commit.com for more information +# See https://pre-commit.com/hooks.html for more hooks +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v4.0.1 + hooks: + - id: trailing-whitespace + - id: end-of-file-fixer + - id: check-yaml + - repo: https://github.com/psf/black + rev: 21.6b0 + hooks: + - id: black + - repo: https://github.com/pycqa/isort + rev: 5.9.1 + hooks: + - id: isort + args: ["--profile", "black"] diff --git a/poetry.lock b/poetry.lock index 870ce872..ca490637 100644 --- a/poetry.lock +++ b/poetry.lock @@ -20,6 +20,31 @@ docs = ["furo", "sphinx", "zope.interface", "sphinx-notfound-page"] tests = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "mypy", "pytest-mypy-plugins", "zope.interface"] tests_no_zope = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "mypy", "pytest-mypy-plugins"] +[[package]] +name = "black" +version = "21.9b0" +description = "The uncompromising code formatter." +category = "dev" +optional = false +python-versions = ">=3.6.2" + +[package.dependencies] +click = ">=7.1.2" +mypy-extensions = ">=0.4.3" +pathspec = ">=0.9.0,<1" +platformdirs = ">=2" +regex = ">=2020.1.8" +tomli = ">=0.2.6,<2.0.0" +typed-ast = {version = ">=1.4.2", markers = "python_version < \"3.8\""} +typing-extensions = ">=3.10.0.0" + +[package.extras] +colorama = ["colorama (>=0.4.3)"] +d = ["aiohttp (>=3.6.0)", "aiohttp-cors (>=0.4.0)"] +jupyter = ["ipython (>=7.8.0)", "tokenize-rt (>=3.2.0)"] +python2 = ["typed-ast (>=1.4.2)"] +uvloop = ["uvloop (>=0.15.2)"] + [[package]] name = "breezy" version = "3.2.1" @@ -182,6 +207,20 @@ docs = ["sphinx", "jaraco.packaging (>=8.2)", "rst.linker (>=1.9)"] perf = ["ipython"] testing = ["pytest (>=4.6)", "pytest-checkdocs (>=2.4)", "pytest-flake8", "pytest-cov", "pytest-enabler (>=1.0.1)", "packaging", "pep517", "pyfakefs", "flufl.flake8", "pytest-perf (>=0.9.2)", "pytest-black (>=0.3.7)", "pytest-mypy", "importlib-resources (>=1.3)"] +[[package]] +name = "isort" +version = "5.9.3" +description = "A Python utility / library to sort Python imports." +category = "dev" +optional = false +python-versions = ">=3.6.1,<4.0" + +[package.extras] +pipfile_deprecated_finder = ["pipreqs", "requirementslib"] +requirements_deprecated_finder = ["pipreqs", "pip-api"] +colors = ["colorama (>=0.4.3,<0.5.0)"] +plugins = ["setuptools"] + [[package]] name = "llvmlite" version = "0.36.0" @@ -211,6 +250,14 @@ category = "dev" optional = false python-versions = ">=3.5" +[[package]] +name = "mypy-extensions" +version = "0.4.3" +description = "Experimental type system extensions for programs checked with the mypy typechecker." +category = "dev" +optional = false +python-versions = "*" + [[package]] name = "numba" version = "0.53.1" @@ -258,6 +305,14 @@ pytz = ">=2017.3" [package.extras] test = ["hypothesis (>=3.58)", "pytest (>=6.0)", "pytest-xdist"] +[[package]] +name = "pathspec" +version = "0.9.0" +description = "Utility library for gitignore style pattern matching of file paths." +category = "dev" +optional = false +python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,!=3.4.*,>=2.7" + [[package]] name = "patiencediff" version = "0.2.2" @@ -291,6 +346,18 @@ category = "main" optional = false python-versions = ">=3.3,<4.0" +[[package]] +name = "platformdirs" +version = "2.4.0" +description = "A small Python module for determining appropriate platform-specific dirs, e.g. a \"user data dir\"." +category = "dev" +optional = false +python-versions = ">=3.6" + +[package.extras] +docs = ["Sphinx (>=4)", "furo (>=2021.7.5b38)", "proselint (>=0.10.2)", "sphinx-autodoc-typehints (>=1.12)"] +test = ["appdirs (==1.4.4)", "pytest (>=6)", "pytest-cov (>=2.7)", "pytest-mock (>=3.6)"] + [[package]] name = "pluggy" version = "0.13.1" @@ -501,6 +568,22 @@ category = "main" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*" +[[package]] +name = "tomli" +version = "1.2.1" +description = "A lil' TOML parser" +category = "dev" +optional = false +python-versions = ">=3.6" + +[[package]] +name = "typed-ast" +version = "1.4.3" +description = "a fork of Python 2 and 3 ast modules with type comment support" +category = "dev" +optional = false +python-versions = "*" + [[package]] name = "typing-extensions" version = "3.10.0.0" @@ -569,7 +652,7 @@ testing = ["pytest (>=4.6)", "pytest-checkdocs (>=2.4)", "pytest-flake8", "pytes [metadata] lock-version = "1.1" python-versions = ">=3.7.1,<3.10" -content-hash = "83d9b170b9f434a913c1f3bf7377c2058f98af021e4912833f883336c78a175d" +content-hash = "3dc510bd7e7c9809485ea5224a1fe151bf8ff148caea7dfd0b7986065d82c1e8" [metadata.files] atomicwrites = [ @@ -580,6 +663,10 @@ attrs = [ {file = "attrs-21.2.0-py2.py3-none-any.whl", hash = "sha256:149e90d6d8ac20db7a955ad60cf0e6881a3f20d37096140088356da6c716b0b1"}, {file = "attrs-21.2.0.tar.gz", hash = "sha256:ef6aaac3ca6cd92904cdd0d83f629a15f18053ec84e6432106f7a4d04ae4f5fb"}, ] +black = [ + {file = "black-21.9b0-py3-none-any.whl", hash = "sha256:380f1b5da05e5a1429225676655dddb96f5ae8c75bdf91e53d798871b902a115"}, + {file = "black-21.9b0.tar.gz", hash = "sha256:7de4cfc7eb6b710de325712d40125689101d21d25283eed7e9998722cf10eb91"}, +] breezy = [ {file = "breezy-3.2.1.tar.gz", hash = "sha256:e0b268eb1a28a2af045280c37d021ae32d7ff175f4c9b99f33aad7db0b29d85c"}, ] @@ -688,6 +775,10 @@ importlib-metadata = [ {file = "importlib_metadata-4.7.1-py3-none-any.whl", hash = "sha256:9e04bf59076a15a9b6dd9c27806e8fcdf15280ba529c6a8cc3f4d5b4875bdd61"}, {file = "importlib_metadata-4.7.1.tar.gz", hash = "sha256:c4eb3dec5f697682e383a39701a7de11cd5c02daf8dd93534b69e3e6473f6b1b"}, ] +isort = [ + {file = "isort-5.9.3-py3-none-any.whl", hash = "sha256:e17d6e2b81095c9db0a03a8025a957f334d6ea30b26f9ec70805411e5c7c81f2"}, + {file = "isort-5.9.3.tar.gz", hash = "sha256:9c2ea1e62d871267b78307fe511c0838ba0da28698c5732d54e2790bf3ba9899"}, +] llvmlite = [ {file = "llvmlite-0.36.0-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:cc0f9b9644b4ab0e4a5edb17f1531d791630c88858220d3cc688d6edf10da100"}, {file = "llvmlite-0.36.0-cp36-cp36m-manylinux2010_i686.whl", hash = "sha256:f7918dbac02b1ebbfd7302ad8e8307d7877ab57d782d5f04b70ff9696b53c21b"}, @@ -748,6 +839,10 @@ more-itertools = [ {file = "more-itertools-8.8.0.tar.gz", hash = "sha256:83f0308e05477c68f56ea3a888172c78ed5d5b3c282addb67508e7ba6c8f813a"}, {file = "more_itertools-8.8.0-py3-none-any.whl", hash = "sha256:2cf89ec599962f2ddc4d568a05defc40e0a587fbc10d5989713638864c36be4d"}, ] +mypy-extensions = [ + {file = "mypy_extensions-0.4.3-py2.py3-none-any.whl", hash = "sha256:090fedd75945a69ae91ce1303b5824f428daf5a028d2f6ab8a299250a846f15d"}, + {file = "mypy_extensions-0.4.3.tar.gz", hash = "sha256:2d82818f5bb3e369420cb3c4060a7970edba416647068eb4c5343488a6c604a8"}, +] numba = [ {file = "numba-0.53.1-cp36-cp36m-macosx_10_14_x86_64.whl", hash = "sha256:b23de6b6837c132087d06b8b92d343edb54b885873b824a037967fbd5272ebb7"}, {file = "numba-0.53.1-cp36-cp36m-manylinux2014_i686.whl", hash = "sha256:6545b9e9b0c112b81de7f88a3c787469a357eeff8211e90b8f45ee243d521cc2"}, @@ -828,6 +923,10 @@ pandas = [ {file = "pandas-1.3.2-cp39-cp39-win_amd64.whl", hash = "sha256:89f40e5d21814192802421df809f948247d39ffe171e45fe2ab4abf7bd4279d8"}, {file = "pandas-1.3.2.tar.gz", hash = "sha256:cbcb84d63867af3411fa063af3de64902665bb5b3d40b25b2059e40603594e87"}, ] +pathspec = [ + {file = "pathspec-0.9.0-py2.py3-none-any.whl", hash = "sha256:7d15c4ddb0b5c802d161efc417ec1a2558ea2653c2e8ad9c19098201dc1c993a"}, + {file = "pathspec-0.9.0.tar.gz", hash = "sha256:e564499435a2673d586f6b2130bb5b95f04a3ba06f81b8f895b651a3c76aabb1"}, +] patiencediff = [ {file = "patiencediff-0.2.2-cp36-cp36m-manylinux2014_aarch64.whl", hash = "sha256:e15b894d1941ed773b6c5f7479985fc17ec81bab33f82e3b736ab1920c1804d6"}, {file = "patiencediff-0.2.2-cp37-cp37m-manylinux2014_aarch64.whl", hash = "sha256:f196516e980f17302317f2f6f6a4c2897c6107c34c5268d9d37b820e98fd0deb"}, @@ -843,6 +942,10 @@ pkgconfig = [ {file = "pkgconfig-1.5.5-py3-none-any.whl", hash = "sha256:d20023bbeb42ee6d428a0fac6e0904631f545985a10cdd71a20aa58bc47a4209"}, {file = "pkgconfig-1.5.5.tar.gz", hash = "sha256:deb4163ef11f75b520d822d9505c1f462761b4309b1bb713d08689759ea8b899"}, ] +platformdirs = [ + {file = "platformdirs-2.4.0-py3-none-any.whl", hash = "sha256:8868bbe3c3c80d42f20156f22e7131d2fb321f5bc86a2a345375c6481a67021d"}, + {file = "platformdirs-2.4.0.tar.gz", hash = "sha256:367a5e80b3d04d2428ffa76d33f124cf11e8fff2acdaa9b43d545f5c7d661ef2"}, +] pluggy = [ {file = "pluggy-0.13.1-py2.py3-none-any.whl", hash = "sha256:966c145cd83c96502c3c3868f50408687b38434af77734af1e9ca461a4081d2d"}, {file = "pluggy-0.13.1.tar.gz", hash = "sha256:15b2acde666561e1298d71b523007ed7364de07029219b604cf808bfa1c765b0"}, @@ -1021,6 +1124,42 @@ six = [ {file = "six-1.16.0-py2.py3-none-any.whl", hash = "sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254"}, {file = "six-1.16.0.tar.gz", hash = "sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926"}, ] +tomli = [ + {file = "tomli-1.2.1-py3-none-any.whl", hash = "sha256:8dd0e9524d6f386271a36b41dbf6c57d8e32fd96fd22b6584679dc569d20899f"}, + {file = "tomli-1.2.1.tar.gz", hash = "sha256:a5b75cb6f3968abb47af1b40c1819dc519ea82bcc065776a866e8d74c5ca9442"}, +] +typed-ast = [ + {file = "typed_ast-1.4.3-cp35-cp35m-manylinux1_i686.whl", hash = "sha256:2068531575a125b87a41802130fa7e29f26c09a2833fea68d9a40cf33902eba6"}, + {file = "typed_ast-1.4.3-cp35-cp35m-manylinux1_x86_64.whl", hash = "sha256:c907f561b1e83e93fad565bac5ba9c22d96a54e7ea0267c708bffe863cbe4075"}, + {file = "typed_ast-1.4.3-cp35-cp35m-manylinux2014_aarch64.whl", hash = "sha256:1b3ead4a96c9101bef08f9f7d1217c096f31667617b58de957f690c92378b528"}, + {file = "typed_ast-1.4.3-cp35-cp35m-win32.whl", hash = "sha256:dde816ca9dac1d9c01dd504ea5967821606f02e510438120091b84e852367428"}, + {file = "typed_ast-1.4.3-cp35-cp35m-win_amd64.whl", hash = "sha256:777a26c84bea6cd934422ac2e3b78863a37017618b6e5c08f92ef69853e765d3"}, + {file = "typed_ast-1.4.3-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:f8afcf15cc511ada719a88e013cec87c11aff7b91f019295eb4530f96fe5ef2f"}, + {file = "typed_ast-1.4.3-cp36-cp36m-manylinux1_i686.whl", hash = "sha256:52b1eb8c83f178ab787f3a4283f68258525f8d70f778a2f6dd54d3b5e5fb4341"}, + {file = "typed_ast-1.4.3-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:01ae5f73431d21eead5015997ab41afa53aa1fbe252f9da060be5dad2c730ace"}, + {file = "typed_ast-1.4.3-cp36-cp36m-manylinux2014_aarch64.whl", hash = "sha256:c190f0899e9f9f8b6b7863debfb739abcb21a5c054f911ca3596d12b8a4c4c7f"}, + {file = "typed_ast-1.4.3-cp36-cp36m-win32.whl", hash = "sha256:398e44cd480f4d2b7ee8d98385ca104e35c81525dd98c519acff1b79bdaac363"}, + {file = "typed_ast-1.4.3-cp36-cp36m-win_amd64.whl", hash = "sha256:bff6ad71c81b3bba8fa35f0f1921fb24ff4476235a6e94a26ada2e54370e6da7"}, + {file = "typed_ast-1.4.3-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:0fb71b8c643187d7492c1f8352f2c15b4c4af3f6338f21681d3681b3dc31a266"}, + {file = "typed_ast-1.4.3-cp37-cp37m-manylinux1_i686.whl", hash = "sha256:760ad187b1041a154f0e4d0f6aae3e40fdb51d6de16e5c99aedadd9246450e9e"}, + {file = "typed_ast-1.4.3-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:5feca99c17af94057417d744607b82dd0a664fd5e4ca98061480fd8b14b18d04"}, + {file = "typed_ast-1.4.3-cp37-cp37m-manylinux2014_aarch64.whl", hash = "sha256:95431a26309a21874005845c21118c83991c63ea800dd44843e42a916aec5899"}, + {file = "typed_ast-1.4.3-cp37-cp37m-win32.whl", hash = "sha256:aee0c1256be6c07bd3e1263ff920c325b59849dc95392a05f258bb9b259cf39c"}, + {file = "typed_ast-1.4.3-cp37-cp37m-win_amd64.whl", hash = "sha256:9ad2c92ec681e02baf81fdfa056fe0d818645efa9af1f1cd5fd6f1bd2bdfd805"}, + {file = "typed_ast-1.4.3-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:b36b4f3920103a25e1d5d024d155c504080959582b928e91cb608a65c3a49e1a"}, + {file = "typed_ast-1.4.3-cp38-cp38-manylinux1_i686.whl", hash = "sha256:067a74454df670dcaa4e59349a2e5c81e567d8d65458d480a5b3dfecec08c5ff"}, + {file = "typed_ast-1.4.3-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:7538e495704e2ccda9b234b82423a4038f324f3a10c43bc088a1636180f11a41"}, + {file = "typed_ast-1.4.3-cp38-cp38-manylinux2014_aarch64.whl", hash = "sha256:af3d4a73793725138d6b334d9d247ce7e5f084d96284ed23f22ee626a7b88e39"}, + {file = "typed_ast-1.4.3-cp38-cp38-win32.whl", hash = "sha256:f2362f3cb0f3172c42938946dbc5b7843c2a28aec307c49100c8b38764eb6927"}, + {file = "typed_ast-1.4.3-cp38-cp38-win_amd64.whl", hash = "sha256:dd4a21253f42b8d2b48410cb31fe501d32f8b9fbeb1f55063ad102fe9c425e40"}, + {file = "typed_ast-1.4.3-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:f328adcfebed9f11301eaedfa48e15bdece9b519fb27e6a8c01aa52a17ec31b3"}, + {file = "typed_ast-1.4.3-cp39-cp39-manylinux1_i686.whl", hash = "sha256:2c726c276d09fc5c414693a2de063f521052d9ea7c240ce553316f70656c84d4"}, + {file = "typed_ast-1.4.3-cp39-cp39-manylinux1_x86_64.whl", hash = "sha256:cae53c389825d3b46fb37538441f75d6aecc4174f615d048321b716df2757fb0"}, + {file = "typed_ast-1.4.3-cp39-cp39-manylinux2014_aarch64.whl", hash = "sha256:b9574c6f03f685070d859e75c7f9eeca02d6933273b5e69572e5ff9d5e3931c3"}, + {file = "typed_ast-1.4.3-cp39-cp39-win32.whl", hash = "sha256:209596a4ec71d990d71d5e0d312ac935d86930e6eecff6ccc7007fe54d703808"}, + {file = "typed_ast-1.4.3-cp39-cp39-win_amd64.whl", hash = "sha256:9c6d1a54552b5330bc657b7ef0eae25d00ba7ffe85d9ea8ae6540d2197a3788c"}, + {file = "typed_ast-1.4.3.tar.gz", hash = "sha256:fb1bbeac803adea29cedd70781399c99138358c26d05fcbd23c13016b7f5ec65"}, +] typing-extensions = [ {file = "typing_extensions-3.10.0.0-py2-none-any.whl", hash = "sha256:0ac0f89795dd19de6b97debb0c6af1c70987fd80a2d62d1958f7e56fcc31b497"}, {file = "typing_extensions-3.10.0.0-py3-none-any.whl", hash = "sha256:779383f6086d90c99ae41cf0ff39aac8a7937a9283ce0a414e5dd782f4c94a84"}, diff --git a/pyproject.toml b/pyproject.toml index 372f10c3..f824bd7e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -22,9 +22,11 @@ requests = "^2.26.0" [tool.poetry.dev-dependencies] pytest = "^5.2" pdbpp = "^0.10.3" +black = "^21.9b0" +isort = "^5.9.3" [tool.poetry.scripts] -run = "run:run" +rr = "run:run" [build-system] requires = ["poetry-core>=1.0.0"] From ba28f120f12e4701b7798c972ca3412af96d7fc7 Mon Sep 17 00:00:00 2001 From: Alessandro Candido Date: Thu, 30 Sep 2021 16:49:35 +0200 Subject: [PATCH 29/63] Add install/run script --- poetry.lock | 19 +++++++++++- pyproject.toml | 1 + rr | 83 ++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 102 insertions(+), 1 deletion(-) create mode 100755 rr diff --git a/poetry.lock b/poetry.lock index ca490637..83c571fd 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1,3 +1,11 @@ +[[package]] +name = "a3b2bbc3ced97675ac3a71df45f55ba" +version = "6.4.0" +description = "The LHAPDF parton density evaluation library" +category = "main" +optional = false +python-versions = "*" + [[package]] name = "atomicwrites" version = "1.4.0" @@ -652,9 +660,18 @@ testing = ["pytest (>=4.6)", "pytest-checkdocs (>=2.4)", "pytest-flake8", "pytes [metadata] lock-version = "1.1" python-versions = ">=3.7.1,<3.10" -content-hash = "3dc510bd7e7c9809485ea5224a1fe151bf8ff148caea7dfd0b7986065d82c1e8" +content-hash = "7ec47e78b3b3ed3f2cea67735a843edc0ff5708065efbee61a019ad2fe9934a1" [metadata.files] +a3b2bbc3ced97675ac3a71df45f55ba = [ + {file = "a3b2bbc3ced97675ac3a71df45f55ba-6.4.0-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:d47714ce84c5cd94cc5512d5683b39c5cd681e13ad086961770b4eb093e11154"}, + {file = "a3b2bbc3ced97675ac3a71df45f55ba-6.4.0-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:4ee7ba0247c67a8357685e5ad415df8b2322baf7eadd53120819a6c8d35484fe"}, + {file = "a3b2bbc3ced97675ac3a71df45f55ba-6.4.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a01f7629db6684f9b231e60f98426b70fc66d45efa6a80ba26c6cacec5a95a7b"}, + {file = "a3b2bbc3ced97675ac3a71df45f55ba-6.4.0-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c0eaca66dafb9ab775e6aa2bd3e94e11f70b1bd28fa636fb047b917653b77ad4"}, + {file = "a3b2bbc3ced97675ac3a71df45f55ba-6.4.0-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:3b3aab2121fa218ab30fa7ce72452646f74c183c00639d8d865a4abec57e92f2"}, + {file = "a3b2bbc3ced97675ac3a71df45f55ba-6.4.0-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0147a1d9dab10f8b23ef5fc97f570ce044e9f8409bfee2fbce551180fafcbb2e"}, + {file = "a3b2bbc3ced97675ac3a71df45f55ba-6.4.0.tar.gz", hash = "sha256:1bd60035f9862db1130be035f631c2cfcf90d2ee0cfc6f33ce29fbf8a70b5a04"}, +] atomicwrites = [ {file = "atomicwrites-1.4.0-py2.py3-none-any.whl", hash = "sha256:6d1784dea7c0c8d4a5172b6c620f40b6e4cbfdf96d783691f2e1302a7b88e197"}, {file = "atomicwrites-1.4.0.tar.gz", hash = "sha256:ae70396ad1a434f9c7046fd2dd196fc04b12f9e91ffb859164193be8b6168a7a"}, diff --git a/pyproject.toml b/pyproject.toml index f824bd7e..ba6fd4d3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -18,6 +18,7 @@ six = "^1.16.0" pkgconfig = "^1.5.5" pygit2 = "^1.6.1" requests = "^2.26.0" +a3b2bbc3ced97675ac3a71df45f55ba = "^6.4.0" [tool.poetry.dev-dependencies] pytest = "^5.2" diff --git a/rr b/rr new file mode 100755 index 00000000..dd8ce960 --- /dev/null +++ b/rr @@ -0,0 +1,83 @@ +#!/usr/bin/env python3 +""" +Zero-dependency bootstrap script +""" +import argparse +import pathlib +import subprocess +import sys + +here = pathlib.Path(".").parent.absolute() + + +def parse_args(): + parser = argparse.ArgumentParser() + + silence = parser.add_mutually_exclusive_group() + silence.add_argument( + "-y", "--yes", action="store_true", help="yes to every questions" + ) + silence.add_argument( + "-n", "--no", action="store_true", help="no to every questions" + ) + silence.add_argument( + "--default", action="store_true", help="default to every questions" + ) + + parser.add_argument( + "--user", + action="store_true", + help="install user wide (only relevant for pip installation)", + ) + + return parser.parse_args() + + +def load_options(yes, no, default): + yes_choice = "[Y/n]" + no_choice = "[y/N]" + + def question(input_text, default_yes): + if not any([yes, no, default]): + choice = yes_choice if default_yes else no_choice + answer = input(f"{input_text} {choice} ") + else: + if yes: + answer = "y" + elif no: + answer = "n" + else: + answer = "y" if default_yes else "n" + return answer + + return question + + +def repo_management(pipx, user): + if pipx: + print("installing management dependecies with pipx...") + subprocess.run("pipx install poetry".split()) + subprocess.run("pipx inject poetry poetry-dynamic-versioning".split()) + subprocess.run("pipx install pre-commit".split()) + else: + print("installing management dependecies with pip...") + subprocess.run(f"pip install{user} poetry".split()) + subprocess.run(f"pip install{user} poetry-dynamic-versioning".split()) + subprocess.run(f"pip install{user} pre-commit".split()) + + +if __name__ == "__main__": + if sys.argv[1] != "install": + subprocess.run("poetry run rr".split() + sys.argv[1:]) + else: + args = parse_args() + + question = load_options(args.yes, args.no, args.default) + + pipx_answer = question("Do you want to install with pipx?", False) + + pipx = pipx_answer.lower() in ["y", "yes"] + user = " --user" if args.user else "" + repo_management(pipx, user) + + subprocess.run("poetry install".split()) From d094fe65a1fc6360d4fb9839436eb9df75f9e090 Mon Sep 17 00:00:00 2001 From: Alessandro Candido Date: Thu, 30 Sep 2021 18:06:59 +0200 Subject: [PATCH 30/63] Manage lhapdf related steps --- poetry.lock | 452 +++++++++++++++++++++++++++++--------- pyproject.toml | 5 +- run/confs/lhapdf.conf | 13 ++ run/dis_.py | 22 -- run/external/interface.py | 6 +- run/external/mg5.py | 12 +- run/external/yad.py | 12 +- run/install.py | 14 +- run/paths.py | 7 + run/run.py | 29 +-- run/tools.py | 11 +- 11 files changed, 420 insertions(+), 163 deletions(-) create mode 100644 run/confs/lhapdf.conf delete mode 100644 run/dis_.py diff --git a/poetry.lock b/poetry.lock index 83c571fd..29f261a3 100644 --- a/poetry.lock +++ b/poetry.lock @@ -6,6 +6,14 @@ category = "main" optional = false python-versions = "*" +[[package]] +name = "appnope" +version = "0.1.2" +description = "Disable App Nap on macOS >= 10.9" +category = "dev" +optional = false +python-versions = "*" + [[package]] name = "atomicwrites" version = "1.4.0" @@ -28,6 +36,14 @@ docs = ["furo", "sphinx", "zope.interface", "sphinx-notfound-page"] tests = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "mypy", "pytest-mypy-plugins", "zope.interface"] tests_no_zope = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "mypy", "pytest-mypy-plugins"] +[[package]] +name = "backcall" +version = "0.2.0" +description = "Specifications for callback functions passed in to an API" +category = "dev" +optional = false +python-versions = "*" + [[package]] name = "black" version = "21.9b0" @@ -95,7 +111,7 @@ pycparser = "*" [[package]] name = "charset-normalizer" -version = "2.0.4" +version = "2.0.6" description = "The Real First Universal Charset Detector. Open, modern and actively maintained alternative to Chardet." category = "main" optional = false @@ -146,6 +162,14 @@ python-versions = "*" [package.dependencies] six = "*" +[[package]] +name = "decorator" +version = "5.1.0" +description = "Decorators for Humans" +category = "dev" +optional = false +python-versions = ">=3.5" + [[package]] name = "dulwich" version = "0.20.25" @@ -200,7 +224,7 @@ python-versions = ">=3.5" [[package]] name = "importlib-metadata" -version = "4.7.1" +version = "4.8.1" description = "Read metadata from Python packages" category = "main" optional = false @@ -215,6 +239,49 @@ docs = ["sphinx", "jaraco.packaging (>=8.2)", "rst.linker (>=1.9)"] perf = ["ipython"] testing = ["pytest (>=4.6)", "pytest-checkdocs (>=2.4)", "pytest-flake8", "pytest-cov", "pytest-enabler (>=1.0.1)", "packaging", "pep517", "pyfakefs", "flufl.flake8", "pytest-perf (>=0.9.2)", "pytest-black (>=0.3.7)", "pytest-mypy", "importlib-resources (>=1.3)"] +[[package]] +name = "inquirerpy" +version = "0.2.4" +description = "Python port of Inquirer.js (A collection of common interactive command-line user interfaces)" +category = "main" +optional = false +python-versions = ">=3.7,<4.0" + +[package.dependencies] +prompt-toolkit = ">=3.0.1,<4.0.0" + +[[package]] +name = "ipython" +version = "7.28.0" +description = "IPython: Productive Interactive Computing" +category = "dev" +optional = false +python-versions = ">=3.7" + +[package.dependencies] +appnope = {version = "*", markers = "sys_platform == \"darwin\""} +backcall = "*" +colorama = {version = "*", markers = "sys_platform == \"win32\""} +decorator = "*" +jedi = ">=0.16" +matplotlib-inline = "*" +pexpect = {version = ">4.3", markers = "sys_platform != \"win32\""} +pickleshare = "*" +prompt-toolkit = ">=2.0.0,<3.0.0 || >3.0.0,<3.0.1 || >3.0.1,<3.1.0" +pygments = "*" +traitlets = ">=4.2" + +[package.extras] +all = ["Sphinx (>=1.3)", "ipykernel", "ipyparallel", "ipywidgets", "nbconvert", "nbformat", "nose (>=0.10.1)", "notebook", "numpy (>=1.17)", "pygments", "qtconsole", "requests", "testpath"] +doc = ["Sphinx (>=1.3)"] +kernel = ["ipykernel"] +nbconvert = ["nbconvert"] +nbformat = ["nbformat"] +notebook = ["notebook", "ipywidgets"] +parallel = ["ipyparallel"] +qtconsole = ["qtconsole"] +test = ["nose (>=0.10.1)", "requests", "testpath", "pygments", "nbformat", "ipykernel", "numpy (>=1.17)"] + [[package]] name = "isort" version = "5.9.3" @@ -229,6 +296,33 @@ requirements_deprecated_finder = ["pipreqs", "pip-api"] colors = ["colorama (>=0.4.3,<0.5.0)"] plugins = ["setuptools"] +[[package]] +name = "jedi" +version = "0.18.0" +description = "An autocompletion tool for Python that can be used for text editors." +category = "dev" +optional = false +python-versions = ">=3.6" + +[package.dependencies] +parso = ">=0.8.0,<0.9.0" + +[package.extras] +qa = ["flake8 (==3.8.3)", "mypy (==0.782)"] +testing = ["Django (<3.1)", "colorama", "docopt", "pytest (<6.0.0)"] + +[[package]] +name = "lhapdf-management" +version = "0.1rc1" +description = "python-only lhapdf management" +category = "main" +optional = false +python-versions = ">=3.6" + +[package.dependencies] +pyyaml = "*" +tqdm = "*" + [[package]] name = "llvmlite" version = "0.36.0" @@ -250,9 +344,20 @@ docs = ["sphinx (>=1.6.0)", "sphinx-bootstrap-theme"] flake8 = ["flake8"] tests = ["pytest (!=3.3.0)", "psutil", "pytest-cov"] +[[package]] +name = "matplotlib-inline" +version = "0.1.3" +description = "Inline Matplotlib backend for Jupyter" +category = "dev" +optional = false +python-versions = ">=3.5" + +[package.dependencies] +traitlets = "*" + [[package]] name = "more-itertools" -version = "8.8.0" +version = "8.10.0" description = "More routines for operating on iterables, beyond itertools" category = "dev" optional = false @@ -299,7 +404,7 @@ pyparsing = ">=2.0.2" [[package]] name = "pandas" -version = "1.3.2" +version = "1.3.3" description = "Powerful data structures for data analysis, time series, and statistics" category = "main" optional = false @@ -313,6 +418,18 @@ pytz = ">=2017.3" [package.extras] test = ["hypothesis (>=3.58)", "pytest (>=6.0)", "pytest-xdist"] +[[package]] +name = "parso" +version = "0.8.2" +description = "A Python Parser" +category = "dev" +optional = false +python-versions = ">=3.6" + +[package.extras] +qa = ["flake8 (==3.8.3)", "mypy (==0.782)"] +testing = ["docopt", "pytest (<6.0.0)"] + [[package]] name = "pathspec" version = "0.9.0" @@ -346,6 +463,36 @@ wmctrl = "*" funcsigs = ["funcsigs"] testing = ["funcsigs", "pytest"] +[[package]] +name = "pexpect" +version = "4.8.0" +description = "Pexpect allows easy control of interactive console applications." +category = "dev" +optional = false +python-versions = "*" + +[package.dependencies] +ptyprocess = ">=0.5" + +[[package]] +name = "pickleshare" +version = "0.7.5" +description = "Tiny 'shelve'-like database with concurrency support" +category = "dev" +optional = false +python-versions = "*" + +[[package]] +name = "pineappl" +version = "0.5.0_beta.1" +description = "Python bindings to PineAPPL" +category = "main" +optional = false +python-versions = "*" + +[package.dependencies] +numpy = ">=1.21.0,<1.22.0" + [[package]] name = "pkgconfig" version = "1.5.5" @@ -382,16 +529,23 @@ dev = ["pre-commit", "tox"] [[package]] name = "prompt-toolkit" -version = "1.0.14" +version = "3.0.20" description = "Library for building powerful interactive command lines in Python" category = "main" optional = false -python-versions = "*" +python-versions = ">=3.6.2" [package.dependencies] -six = ">=1.9.0" wcwidth = "*" +[[package]] +name = "ptyprocess" +version = "0.7.0" +description = "Run a subprocess in a pseudo terminal" +category = "dev" +optional = false +python-versions = "*" + [[package]] name = "py" version = "1.10.0" @@ -427,19 +581,6 @@ category = "main" optional = false python-versions = ">=3.5" -[[package]] -name = "pyinquirer" -version = "1.0.3" -description = "A Python module for collection of common interactive command line user interfaces, based on Inquirer.js" -category = "main" -optional = false -python-versions = "*" - -[package.dependencies] -prompt_toolkit = "1.0.14" -Pygments = ">=2.2.0" -regex = ">=2016.11.21" - [[package]] name = "pyparsing" version = "2.4.7" @@ -516,9 +657,9 @@ python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*" [[package]] name = "regex" -version = "2021.8.27" +version = "2021.9.24" description = "Alternative regular expression module, to replace re." -category = "main" +category = "dev" optional = false python-versions = "*" @@ -542,7 +683,7 @@ use_chardet_on_py3 = ["chardet (>=3.0.2,<5)"] [[package]] name = "rich" -version = "10.7.0" +version = "10.11.0" description = "Render rich text, tables, progress bars, syntax highlighting, markdown and more to the terminal" category = "main" optional = false @@ -584,6 +725,33 @@ category = "dev" optional = false python-versions = ">=3.6" +[[package]] +name = "tqdm" +version = "4.62.3" +description = "Fast, Extensible Progress Meter" +category = "main" +optional = false +python-versions = "!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*,>=2.7" + +[package.dependencies] +colorama = {version = "*", markers = "platform_system == \"Windows\""} + +[package.extras] +dev = ["py-make (>=0.1.0)", "twine", "wheel"] +notebook = ["ipywidgets (>=6)"] +telegram = ["requests"] + +[[package]] +name = "traitlets" +version = "5.1.0" +description = "Traitlets Python configuration system" +category = "dev" +optional = false +python-versions = ">=3.7" + +[package.extras] +test = ["pytest"] + [[package]] name = "typed-ast" version = "1.4.3" @@ -594,7 +762,7 @@ python-versions = "*" [[package]] name = "typing-extensions" -version = "3.10.0.0" +version = "3.10.0.2" description = "Backported and Experimental Type Hints for Python 3.5+" category = "main" optional = false @@ -602,7 +770,7 @@ python-versions = "*" [[package]] name = "urllib3" -version = "1.26.6" +version = "1.26.7" description = "HTTP library with thread-safe connection pooling, file post, and more." category = "main" optional = false @@ -647,7 +815,7 @@ scipy = "*" [[package]] name = "zipp" -version = "3.5.0" +version = "3.6.0" description = "Backport of pathlib-compatible object wrapper for zip files" category = "main" optional = false @@ -660,7 +828,7 @@ testing = ["pytest (>=4.6)", "pytest-checkdocs (>=2.4)", "pytest-flake8", "pytes [metadata] lock-version = "1.1" python-versions = ">=3.7.1,<3.10" -content-hash = "7ec47e78b3b3ed3f2cea67735a843edc0ff5708065efbee61a019ad2fe9934a1" +content-hash = "81b90183aa139ea2f84f02bc566b147c36d736c7da5f6bf79e95d64bf19fc630" [metadata.files] a3b2bbc3ced97675ac3a71df45f55ba = [ @@ -672,6 +840,10 @@ a3b2bbc3ced97675ac3a71df45f55ba = [ {file = "a3b2bbc3ced97675ac3a71df45f55ba-6.4.0-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0147a1d9dab10f8b23ef5fc97f570ce044e9f8409bfee2fbce551180fafcbb2e"}, {file = "a3b2bbc3ced97675ac3a71df45f55ba-6.4.0.tar.gz", hash = "sha256:1bd60035f9862db1130be035f631c2cfcf90d2ee0cfc6f33ce29fbf8a70b5a04"}, ] +appnope = [ + {file = "appnope-0.1.2-py2.py3-none-any.whl", hash = "sha256:93aa393e9d6c54c5cd570ccadd8edad61ea0c4b9ea7a01409020c9aa019eb442"}, + {file = "appnope-0.1.2.tar.gz", hash = "sha256:dd83cd4b5b460958838f6eb3000c660b1f9caf2a5b1de4264e941512f603258a"}, +] atomicwrites = [ {file = "atomicwrites-1.4.0-py2.py3-none-any.whl", hash = "sha256:6d1784dea7c0c8d4a5172b6c620f40b6e4cbfdf96d783691f2e1302a7b88e197"}, {file = "atomicwrites-1.4.0.tar.gz", hash = "sha256:ae70396ad1a434f9c7046fd2dd196fc04b12f9e91ffb859164193be8b6168a7a"}, @@ -680,6 +852,10 @@ attrs = [ {file = "attrs-21.2.0-py2.py3-none-any.whl", hash = "sha256:149e90d6d8ac20db7a955ad60cf0e6881a3f20d37096140088356da6c716b0b1"}, {file = "attrs-21.2.0.tar.gz", hash = "sha256:ef6aaac3ca6cd92904cdd0d83f629a15f18053ec84e6432106f7a4d04ae4f5fb"}, ] +backcall = [ + {file = "backcall-0.2.0-py2.py3-none-any.whl", hash = "sha256:fbbce6a29f263178a1f7915c1940bde0ec2b2a967566fe1c65c1dfb7422bd255"}, + {file = "backcall-0.2.0.tar.gz", hash = "sha256:5cbdbf27be5e7cfadb448baf0aa95508f91f2bbc6c6437cd9cd06e2a4c215e1e"}, +] black = [ {file = "black-21.9b0-py3-none-any.whl", hash = "sha256:380f1b5da05e5a1429225676655dddb96f5ae8c75bdf91e53d798871b902a115"}, {file = "black-21.9b0.tar.gz", hash = "sha256:7de4cfc7eb6b710de325712d40125689101d21d25283eed7e9998722cf10eb91"}, @@ -739,8 +915,8 @@ cffi = [ {file = "cffi-1.14.6.tar.gz", hash = "sha256:c9a875ce9d7fe32887784274dd533c57909b7b1dcadcc128a2ac21331a9765dd"}, ] charset-normalizer = [ - {file = "charset-normalizer-2.0.4.tar.gz", hash = "sha256:f23667ebe1084be45f6ae0538e4a5a865206544097e4e8bbcacf42cd02a348f3"}, - {file = "charset_normalizer-2.0.4-py3-none-any.whl", hash = "sha256:0c8911edd15d19223366a194a513099a302055a962bca2cec0f54b8b63175d8b"}, + {file = "charset-normalizer-2.0.6.tar.gz", hash = "sha256:5ec46d183433dcbd0ab716f2d7f29d8dee50505b3fdb40c6b985c7c4f5a3591f"}, + {file = "charset_normalizer-2.0.6-py3-none-any.whl", hash = "sha256:5d209c0a931f215cee683b6445e2d77677e7e75e159f78def0db09d68fafcaa6"}, ] click = [ {file = "click-8.0.1-py3-none-any.whl", hash = "sha256:fba402a4a47334742d782209a7c79bc448911afe1149d07bdabdf480b3e2f4b6"}, @@ -757,6 +933,10 @@ commonmark = [ configobj = [ {file = "configobj-5.0.6.tar.gz", hash = "sha256:a2f5650770e1c87fb335af19a9b7eb73fc05ccf22144eb68db7d00cd2bcb0902"}, ] +decorator = [ + {file = "decorator-5.1.0-py3-none-any.whl", hash = "sha256:7b12e7c3c6ab203a29e157335e9122cb03de9ab7264b137594103fd4a683b374"}, + {file = "decorator-5.1.0.tar.gz", hash = "sha256:e59913af105b9860aa2c8d3272d9de5a56a4e608db9a2f167a8480b323d529a7"}, +] dulwich = [ {file = "dulwich-0.20.25-cp36-cp36m-macosx_10_14_x86_64.whl", hash = "sha256:da7655385e090b805c262df42f8b75a115345343951ca2497476df0a6287c20e"}, {file = "dulwich-0.20.25-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6fad76fca381ceb914d156eb25c0cc77132cff1156d035271203c521134472b6"}, @@ -789,13 +969,28 @@ idna = [ {file = "idna-3.2.tar.gz", hash = "sha256:467fbad99067910785144ce333826c71fb0e63a425657295239737f7ecd125f3"}, ] importlib-metadata = [ - {file = "importlib_metadata-4.7.1-py3-none-any.whl", hash = "sha256:9e04bf59076a15a9b6dd9c27806e8fcdf15280ba529c6a8cc3f4d5b4875bdd61"}, - {file = "importlib_metadata-4.7.1.tar.gz", hash = "sha256:c4eb3dec5f697682e383a39701a7de11cd5c02daf8dd93534b69e3e6473f6b1b"}, + {file = "importlib_metadata-4.8.1-py3-none-any.whl", hash = "sha256:b618b6d2d5ffa2f16add5697cf57a46c76a56229b0ed1c438322e4e95645bd15"}, + {file = "importlib_metadata-4.8.1.tar.gz", hash = "sha256:f284b3e11256ad1e5d03ab86bb2ccd6f5339688ff17a4d797a0fe7df326f23b1"}, +] +inquirerpy = [ + {file = "InquirerPy-0.2.4-py3-none-any.whl", hash = "sha256:051ec6a5f9f7f93f6db6a1bb87a07a5d876cc6cb818b8816f9ba2ae52d43c56b"}, + {file = "InquirerPy-0.2.4.tar.gz", hash = "sha256:22d50a9d7361377b8eb334964b1d52922a7fc8680864139e35fd64a73e71bb65"}, +] +ipython = [ + {file = "ipython-7.28.0-py3-none-any.whl", hash = "sha256:f16148f9163e1e526f1008d7c8d966d9c15600ca20d1a754287cf96d00ba6f1d"}, + {file = "ipython-7.28.0.tar.gz", hash = "sha256:2097be5c814d1b974aea57673176a924c4c8c9583890e7a5f082f547b9975b11"}, ] isort = [ {file = "isort-5.9.3-py3-none-any.whl", hash = "sha256:e17d6e2b81095c9db0a03a8025a957f334d6ea30b26f9ec70805411e5c7c81f2"}, {file = "isort-5.9.3.tar.gz", hash = "sha256:9c2ea1e62d871267b78307fe511c0838ba0da28698c5732d54e2790bf3ba9899"}, ] +jedi = [ + {file = "jedi-0.18.0-py2.py3-none-any.whl", hash = "sha256:18456d83f65f400ab0c2d3319e48520420ef43b23a086fdc05dff34132f0fb93"}, + {file = "jedi-0.18.0.tar.gz", hash = "sha256:92550a404bad8afed881a137ec9a461fed49eca661414be45059329614ed0707"}, +] +lhapdf-management = [ + {file = "lhapdf_management-0.1rc1-1-py3-none-any.whl", hash = "sha256:271ab7002aba5b7089562eb6c6ff1d941d209099e3cecfcb0cde0c89e86a07aa"}, +] llvmlite = [ {file = "llvmlite-0.36.0-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:cc0f9b9644b4ab0e4a5edb17f1531d791630c88858220d3cc688d6edf10da100"}, {file = "llvmlite-0.36.0-cp36-cp36m-manylinux2010_i686.whl", hash = "sha256:f7918dbac02b1ebbfd7302ad8e8307d7877ab57d782d5f04b70ff9696b53c21b"}, @@ -852,9 +1047,13 @@ lz4 = [ {file = "lz4-3.1.3-cp39-cp39-win_amd64.whl", hash = "sha256:37c23ca41040751649e0266f9f267c0148db12968a0a031272ee2a99cef7c753"}, {file = "lz4-3.1.3.tar.gz", hash = "sha256:081ef0a3b5941cb03127f314229a1c78bd70c9c220bb3f4dd80033e707feaa18"}, ] +matplotlib-inline = [ + {file = "matplotlib-inline-0.1.3.tar.gz", hash = "sha256:a04bfba22e0d1395479f866853ec1ee28eea1485c1d69a6faf00dc3e24ff34ee"}, + {file = "matplotlib_inline-0.1.3-py3-none-any.whl", hash = "sha256:aed605ba3b72462d64d475a21a9296f400a19c4f74a31b59103d2a99ffd5aa5c"}, +] more-itertools = [ - {file = "more-itertools-8.8.0.tar.gz", hash = "sha256:83f0308e05477c68f56ea3a888172c78ed5d5b3c282addb67508e7ba6c8f813a"}, - {file = "more_itertools-8.8.0-py3-none-any.whl", hash = "sha256:2cf89ec599962f2ddc4d568a05defc40e0a587fbc10d5989713638864c36be4d"}, + {file = "more-itertools-8.10.0.tar.gz", hash = "sha256:1debcabeb1df793814859d64a81ad7cb10504c24349368ccf214c664c474f41f"}, + {file = "more_itertools-8.10.0-py3-none-any.whl", hash = "sha256:56ddac45541718ba332db05f464bebfb0768110111affd27f66e0051f276fa43"}, ] mypy-extensions = [ {file = "mypy_extensions-0.4.3-py2.py3-none-any.whl", hash = "sha256:090fedd75945a69ae91ce1303b5824f428daf5a028d2f6ab8a299250a846f15d"}, @@ -920,25 +1119,31 @@ packaging = [ {file = "packaging-21.0.tar.gz", hash = "sha256:7dc96269f53a4ccec5c0670940a4281106dd0bb343f47b7471f779df49c2fbe7"}, ] pandas = [ - {file = "pandas-1.3.2-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:ba7ceb8abc6dbdb1e34612d1173d61e4941f1a1eb7e6f703b2633134ae6a6c89"}, - {file = "pandas-1.3.2-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:fcb71b1935249de80e3a808227189eee381d4d74a31760ced2df21eedc92a8e3"}, - {file = "pandas-1.3.2-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fa54dc1d3e5d004a09ab0b1751473698011ddf03e14f1f59b84ad9a6ac630975"}, - {file = "pandas-1.3.2-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:34ced9ce5d5b17b556486da7256961b55b471d64a8990b56e67a84ebeb259416"}, - {file = "pandas-1.3.2-cp37-cp37m-win32.whl", hash = "sha256:a56246de744baf646d1f3e050c4653d632bc9cd2e0605f41051fea59980e880a"}, - {file = "pandas-1.3.2-cp37-cp37m-win_amd64.whl", hash = "sha256:53b17e4debba26b7446b1e4795c19f94f0c715e288e08145e44bdd2865e819b3"}, - {file = "pandas-1.3.2-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:f07a9745ca075ae73a5ce116f5e58f691c0dc9de0bff163527858459df5c176f"}, - {file = "pandas-1.3.2-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c9e8e0ce5284ebebe110efd652c164ed6eab77f5de4c3533abc756302ee77765"}, - {file = "pandas-1.3.2-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:59a78d7066d1c921a77e3306aa0ebf6e55396c097d5dfcc4df8defe3dcecb735"}, - {file = "pandas-1.3.2-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:132def05e73d292c949b02e7ef873debb77acc44a8b119d215921046f0c3a91d"}, - {file = "pandas-1.3.2-cp38-cp38-win32.whl", hash = "sha256:69e1b2f5811f46827722fd641fdaeedb26002bd1e504eacc7a8ec36bdc25393e"}, - {file = "pandas-1.3.2-cp38-cp38-win_amd64.whl", hash = "sha256:7996d311413379136baf0f3cf2a10e331697657c87ced3f17ac7c77f77fe34a3"}, - {file = "pandas-1.3.2-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:1738154049062156429a5cf2fd79a69c9f3fa4f231346a7ec6fd156cd1a9a621"}, - {file = "pandas-1.3.2-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:9cce01f6d655b4add966fcd36c32c5d1fe84628e200626b3f5e2f40db2d16a0f"}, - {file = "pandas-1.3.2-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1099e2a0cd3a01ec62cca183fc1555833a2d43764950ef8cb5948c8abfc51014"}, - {file = "pandas-1.3.2-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:0cd5776be891331a3e6b425b5abeab9596abea18435c5982191356f9b24ae731"}, - {file = "pandas-1.3.2-cp39-cp39-win32.whl", hash = "sha256:66a95361b81b4ba04b699ecd2416b0591f40cd1e24c60a8bfe0d19009cfa575a"}, - {file = "pandas-1.3.2-cp39-cp39-win_amd64.whl", hash = "sha256:89f40e5d21814192802421df809f948247d39ffe171e45fe2ab4abf7bd4279d8"}, - {file = "pandas-1.3.2.tar.gz", hash = "sha256:cbcb84d63867af3411fa063af3de64902665bb5b3d40b25b2059e40603594e87"}, + {file = "pandas-1.3.3-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:68408a39a54ebadb9014ee5a4fae27b2fe524317bc80adf56c9ac59e8f8ea431"}, + {file = "pandas-1.3.3-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:86b16b1b920c4cb27fdd65a2c20258bcd9c794be491290660722bb0ea765054d"}, + {file = "pandas-1.3.3-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:37d63e78e87eb3791da7be4100a65da0383670c2b59e493d9e73098d7a879226"}, + {file = "pandas-1.3.3-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:53e2fb11f86f6253bb1df26e3aeab3bf2e000aaa32a953ec394571bec5dc6fd6"}, + {file = "pandas-1.3.3-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7326b37de08d42dd3fff5b7ef7691d0fd0bf2428f4ba5a2bdc3b3247e9a52e4c"}, + {file = "pandas-1.3.3-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:ed2f29b4da6f6ae7c68f4b3708d9d9e59fa89b2f9e87c2b64ce055cbd39f729e"}, + {file = "pandas-1.3.3-cp37-cp37m-win32.whl", hash = "sha256:3f5020613c1d8e304840c34aeb171377dc755521bf5e69804991030c2a48aec3"}, + {file = "pandas-1.3.3-cp37-cp37m-win_amd64.whl", hash = "sha256:c399200631db9bd9335d013ec7fce4edb98651035c249d532945c78ad453f23a"}, + {file = "pandas-1.3.3-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:a800df4e101b721e94d04c355e611863cc31887f24c0b019572e26518cbbcab6"}, + {file = "pandas-1.3.3-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3334a5a9eeaca953b9db1b2b165dcdc5180b5011f3bec3a57a3580c9c22eae68"}, + {file = "pandas-1.3.3-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:49fd2889d8116d7acef0709e4c82b8560a8b22b0f77471391d12c27596e90267"}, + {file = "pandas-1.3.3-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:7557b39c8e86eb0543a17a002ac1ea0f38911c3c17095bc9350d0a65b32d801c"}, + {file = "pandas-1.3.3-cp38-cp38-win32.whl", hash = "sha256:629138b7cf81a2e55aa29ce7b04c1cece20485271d1f6c469c6a0c03857db6a4"}, + {file = "pandas-1.3.3-cp38-cp38-win_amd64.whl", hash = "sha256:45649503e167d45360aa7c52f18d1591a6d5c70d2f3a26bc90a3297a30ce9a66"}, + {file = "pandas-1.3.3-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:ebbed7312547a924df0cbe133ff1250eeb94cdff3c09a794dc991c5621c8c735"}, + {file = "pandas-1.3.3-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:a9f1b54d7efc9df05320b14a48fb18686f781aa66cc7b47bb62fabfc67a0985c"}, + {file = "pandas-1.3.3-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:e9bc59855598cb57f68fdabd4897d3ed2bc3a3b3bef7b868a0153c4cd03f3207"}, + {file = "pandas-1.3.3-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:4def2ef2fb7fcd62f2aa51bacb817ee9029e5c8efe42fe527ba21f6a3ddf1a9f"}, + {file = "pandas-1.3.3-cp39-cp39-win32.whl", hash = "sha256:f7d84f321674c2f0f31887ee6d5755c54ca1ea5e144d6d54b3bbf566dd9ea0cc"}, + {file = "pandas-1.3.3-cp39-cp39-win_amd64.whl", hash = "sha256:e574c2637c9d27f322e911650b36e858c885702c5996eda8a5a60e35e6648cf2"}, + {file = "pandas-1.3.3.tar.gz", hash = "sha256:272c8cb14aa9793eada6b1ebe81994616e647b5892a370c7135efb2924b701df"}, +] +parso = [ + {file = "parso-0.8.2-py2.py3-none-any.whl", hash = "sha256:a8c4922db71e4fdb90e0d0bc6e50f9b273d3397925e5e60a717e719201778d22"}, + {file = "parso-0.8.2.tar.gz", hash = "sha256:12b83492c6239ce32ff5eed6d3639d6a536170723c6f3f1506869f1ace413398"}, ] pathspec = [ {file = "pathspec-0.9.0-py2.py3-none-any.whl", hash = "sha256:7d15c4ddb0b5c802d161efc417ec1a2558ea2653c2e8ad9c19098201dc1c993a"}, @@ -955,6 +1160,29 @@ pdbpp = [ {file = "pdbpp-0.10.3-py2.py3-none-any.whl", hash = "sha256:79580568e33eb3d6f6b462b1187f53e10cd8e4538f7d31495c9181e2cf9665d1"}, {file = "pdbpp-0.10.3.tar.gz", hash = "sha256:d9e43f4fda388eeb365f2887f4e7b66ac09dce9b6236b76f63616530e2f669f5"}, ] +pexpect = [ + {file = "pexpect-4.8.0-py2.py3-none-any.whl", hash = "sha256:0b48a55dcb3c05f3329815901ea4fc1537514d6ba867a152b581d69ae3710937"}, + {file = "pexpect-4.8.0.tar.gz", hash = "sha256:fc65a43959d153d0114afe13997d439c22823a27cefceb5ff35c2178c6784c0c"}, +] +pickleshare = [ + {file = "pickleshare-0.7.5-py2.py3-none-any.whl", hash = "sha256:9649af414d74d4df115d5d718f82acb59c9d418196b7b4290ed47a12ce62df56"}, + {file = "pickleshare-0.7.5.tar.gz", hash = "sha256:87683d47965c1da65cdacaf31c8441d12b8044cdec9aca500cd78fc2c683afca"}, +] +pineappl = [ + {file = "pineappl-0.5.0_beta.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:05bc212f835c847e71822be9326a5298bfd251de63e227fd206df9f4ba1d1ce9"}, + {file = "pineappl-0.5.0_beta.1-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:87e7ddadcc850e0785501ceea6554cebe1c89f66035e13f1e6a00b44c384cb53"}, + {file = "pineappl-0.5.0_beta.1-cp36-none-win_amd64.whl", hash = "sha256:85658964b3bf15af8e383ec619669863ff73062409a42479e3af33b87b95af6c"}, + {file = "pineappl-0.5.0_beta.1-cp37-cp37m-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl", hash = "sha256:6edb5c281b8903e982ff9e3cec1b26f548bf1a048c9ec9289a80542b5ff22029"}, + {file = "pineappl-0.5.0_beta.1-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:ef4438d434a97c5a462e28ad133b4315e7b5097c96998072e26d1b2c999b261a"}, + {file = "pineappl-0.5.0_beta.1-cp37-none-win_amd64.whl", hash = "sha256:325f010b732415be4ba0dac6e656a58373f12d08941356c0073b6b4dcfa8597a"}, + {file = "pineappl-0.5.0_beta.1-cp38-cp38-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl", hash = "sha256:f33596d3cf7200dae7a0d59cbd344495c95dc95243c7166c521bbbb3d652fd77"}, + {file = "pineappl-0.5.0_beta.1-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a590ba91e6d26c53d3bda806a192db062b2dde344efa6e907bd97c96281b7ecd"}, + {file = "pineappl-0.5.0_beta.1-cp38-none-win_amd64.whl", hash = "sha256:b7d2de854359813ab27e7c660f96fdaf4ac5fb23ecc6c08198520ecce6120113"}, + {file = "pineappl-0.5.0_beta.1-cp39-cp39-macosx_10_9_x86_64.macosx_11_0_arm64.macosx_10_9_universal2.whl", hash = "sha256:e0c9ca1972281b128e1b89414708842e6f326e5f62f83a4d143f1581e2eb5178"}, + {file = "pineappl-0.5.0_beta.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:1dee27621e5adac03a8dd1e5bbfd29b39f05aa691c429be97c0215c3597a1c02"}, + {file = "pineappl-0.5.0_beta.1-cp39-none-win_amd64.whl", hash = "sha256:ebb97bda4c6ce42ac68a4dcd2a985b5735d31565907679c8674f4675b55a1865"}, + {file = "pineappl-0.5.0_beta.1.tar.gz", hash = "sha256:0eac434becd57a9beb5717c61eae47c6003614920121015fb1d027e1c50b8521"}, +] pkgconfig = [ {file = "pkgconfig-1.5.5-py3-none-any.whl", hash = "sha256:d20023bbeb42ee6d428a0fac6e0904631f545985a10cdd71a20aa58bc47a4209"}, {file = "pkgconfig-1.5.5.tar.gz", hash = "sha256:deb4163ef11f75b520d822d9505c1f462761b4309b1bb713d08689759ea8b899"}, @@ -968,9 +1196,12 @@ pluggy = [ {file = "pluggy-0.13.1.tar.gz", hash = "sha256:15b2acde666561e1298d71b523007ed7364de07029219b604cf808bfa1c765b0"}, ] prompt-toolkit = [ - {file = "prompt_toolkit-1.0.14-py2-none-any.whl", hash = "sha256:82c7f8e07d7a0411ff5367a5a8ff520f0112b9179f3e599ee8ad2ad9b943d911"}, - {file = "prompt_toolkit-1.0.14-py3-none-any.whl", hash = "sha256:7281b5199235adaef6980942840c43753e4ab20dfe41338da634fb41c194f9d8"}, - {file = "prompt_toolkit-1.0.14.tar.gz", hash = "sha256:cc66413b1b4b17021675d9f2d15d57e640b06ddfd99bb724c73484126d22622f"}, + {file = "prompt_toolkit-3.0.20-py3-none-any.whl", hash = "sha256:6076e46efae19b1e0ca1ec003ed37a933dc94b4d20f486235d436e64771dcd5c"}, + {file = "prompt_toolkit-3.0.20.tar.gz", hash = "sha256:eb71d5a6b72ce6db177af4a7d4d7085b99756bf656d98ffcc4fecd36850eea6c"}, +] +ptyprocess = [ + {file = "ptyprocess-0.7.0-py2.py3-none-any.whl", hash = "sha256:4b41f3967fce3af57cc7e94b888626c18bf37a083e3651ca8feeb66d492fef35"}, + {file = "ptyprocess-0.7.0.tar.gz", hash = "sha256:5c5d0a3b48ceee0b48485e0c26037c0acd7d29765ca3fbb5cb3831d347423220"}, ] py = [ {file = "py-1.10.0-py2.py3-none-any.whl", hash = "sha256:3b80836aa6d1feeaa108e046da6423ab8f6ceda6468545ae8d02d9d58d18818a"}, @@ -1007,9 +1238,6 @@ pygments = [ {file = "Pygments-2.10.0-py3-none-any.whl", hash = "sha256:b8e67fe6af78f492b3c4b3e2970c0624cbf08beb1e493b2c99b9fa1b67a20380"}, {file = "Pygments-2.10.0.tar.gz", hash = "sha256:f398865f7eb6874156579fdf36bc840a03cab64d1cde9e93d68f46a425ec52c6"}, ] -pyinquirer = [ - {file = "PyInquirer-1.0.3.tar.gz", hash = "sha256:c9a92d68d7727fbd886a7908c08fd9e9773e5dc211bf5cbf836ba90d366dee51"}, -] pyparsing = [ {file = "pyparsing-2.4.7-py2.py3-none-any.whl", hash = "sha256:ef9d7589ef3c200abe66653d3f1ab1033c3c419ae9b9bdb1240a85b024efc88b"}, {file = "pyparsing-2.4.7.tar.gz", hash = "sha256:c203ec8783bf771a155b207279b9bccb8dea02d8f0c9e5f8ead507bc3246ecc1"}, @@ -1066,55 +1294,55 @@ pyyaml = [ {file = "PyYAML-5.4.1.tar.gz", hash = "sha256:607774cbba28732bfa802b54baa7484215f530991055bb562efbed5b2f20a45e"}, ] regex = [ - {file = "regex-2021.8.27-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:507861cf3d97a86fbe26ea6cc04660ae028b9e4080b8290e28b99547b4e15d89"}, - {file = "regex-2021.8.27-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:105122fa63da98d8456d5026bc6ac5a1399fd82fa6bad22c6ea641b1572c9142"}, - {file = "regex-2021.8.27-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:83946ca9278b304728b637bc8d8200ab1663a79de85e47724594917aeed0e892"}, - {file = "regex-2021.8.27-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:ee318974a1fdacba1701bc9e552e9015788d6345416364af6fa987424ff8df53"}, - {file = "regex-2021.8.27-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:dde0ac721c7c5bfa5f9fc285e811274dec3c392f2c1225f7d07ca98a8187ca84"}, - {file = "regex-2021.8.27-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:862b6164e9a38b5c495be2c2854e75fd8af12c5be4c61dc9b42d255980d7e907"}, - {file = "regex-2021.8.27-cp310-cp310-win32.whl", hash = "sha256:7684016b73938ca12d160d2907d141f06b7597bd17d854e32bb7588be01afa1d"}, - {file = "regex-2021.8.27-cp310-cp310-win_amd64.whl", hash = "sha256:a5f3bc727fea58f21d99c22e6d4fca652dc11dbc2a1e7cfc4838cd53b2e3691f"}, - {file = "regex-2021.8.27-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:db888d4fb33a2fd54b57ac55d5015e51fa849f0d8592bd799b4e47f83bd04e00"}, - {file = "regex-2021.8.27-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:92eb03f47427fea452ff6956d11f5d5a3f22a048c90a0f34fa223e6badab6c85"}, - {file = "regex-2021.8.27-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:7406dd2e44c7cfb4680c0a45a03264381802c67890cf506c147288f04c67177d"}, - {file = "regex-2021.8.27-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:7db58ad61f3f6ea393aaf124d774ee0c58806320bc85c06dc9480f5c7219c250"}, - {file = "regex-2021.8.27-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:cd45b4542134de63e7b9dd653e0a2d7d47ffed9615e3637c27ca5f6b78ea68bb"}, - {file = "regex-2021.8.27-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:e02dad60e3e8442eefd28095e99b2ac98f2b8667167493ac6a2f3aadb5d84a17"}, - {file = "regex-2021.8.27-cp36-cp36m-win32.whl", hash = "sha256:de0d06ccbc06af5bf93bddec10f4f80275c5d74ea6d28b456931f3955f58bc8c"}, - {file = "regex-2021.8.27-cp36-cp36m-win_amd64.whl", hash = "sha256:2a0a5e323cf86760784ce2b91d8ab5ea09d0865d6ef4da0151e03d15d097b24e"}, - {file = "regex-2021.8.27-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:6530b7b9505123cdea40a2301225183ca65f389bc6129f0c225b9b41680268d8"}, - {file = "regex-2021.8.27-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:4f3e36086d6631ceaf468503f96a3be0d247caef0660c9452fb1b0c055783851"}, - {file = "regex-2021.8.27-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:8ddb4f9ce6bb388ecc97b4b3eb37e786f05d7d5815e8822e0d87a3dbd7100649"}, - {file = "regex-2021.8.27-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:2de1429e4eeab799c168a4f6e6eecdf30fcaa389bba4039cc8a065d6b7aad647"}, - {file = "regex-2021.8.27-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:4f03fc0a25122cdcbf39136510d4ea7627f732206892db522adf510bc03b8c67"}, - {file = "regex-2021.8.27-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:503c1ba0920a46a1844363725215ef44d59fcac2bd2c03ae3c59aa9d08d29bd6"}, - {file = "regex-2021.8.27-cp37-cp37m-win32.whl", hash = "sha256:24d68499a27b2d93831fde4a9b84ea5b19e0ab141425fbc9ab1e5b4dad179df7"}, - {file = "regex-2021.8.27-cp37-cp37m-win_amd64.whl", hash = "sha256:6729914dd73483cd1c8aaace3ac082436fc98b0072743ac136eaea0b3811d42f"}, - {file = "regex-2021.8.27-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:2d9cbe0c755ab8b6f583169c0783f7278fc6b195e423b09c5a8da6f858025e96"}, - {file = "regex-2021.8.27-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:d2404336fd16788ea757d4218a2580de60adb052d9888031e765320be8884309"}, - {file = "regex-2021.8.27-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:208851a2f8dd31e468f0b5aa6c94433975bd67a107a4e7da3bdda947c9f85e25"}, - {file = "regex-2021.8.27-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:3ee8ad16a35c45a5bab098e39020ecb6fec3b0e700a9d88983d35cbabcee79c8"}, - {file = "regex-2021.8.27-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:56ae6e3cf0506ec0c40b466e31f41ee7a7149a2b505ae0ee50edd9043b423d27"}, - {file = "regex-2021.8.27-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:2778c6cb379d804e429cc8e627392909e60db5152b42c695c37ae5757aae50ae"}, - {file = "regex-2021.8.27-cp38-cp38-win32.whl", hash = "sha256:e960fe211496333b2f7e36badf4c22a919d740386681f79139ee346b403d1ca1"}, - {file = "regex-2021.8.27-cp38-cp38-win_amd64.whl", hash = "sha256:116c277774f84266044e889501fe79cfd293a8b4336b7a5e89b9f20f1e5a9f21"}, - {file = "regex-2021.8.27-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:32753eda8d413ce4f208cfe01dd61171a78068a6f5d5f38ccd751e00585cdf1d"}, - {file = "regex-2021.8.27-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:84057cfae5676f456b03970eb78b7e182fddc80c2daafd83465a3d6ca9ff8dbf"}, - {file = "regex-2021.8.27-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:a6180dbf5945b27e9420e1b58c3cacfc79ad5278bdad3ea35109f5680fbe16d1"}, - {file = "regex-2021.8.27-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:b158f673ae6a6523f13704f70aa7e4ce875f91e379bece4362c89db18db189d5"}, - {file = "regex-2021.8.27-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:19acdb8831a4e3b03b23369db43178d8fee1f17b99c83af6cd907886f76bd9d4"}, - {file = "regex-2021.8.27-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:12eaf0bbe568bd62e6cade7937e0bf01a2a4cef49a82f4fd204401e78409e158"}, - {file = "regex-2021.8.27-cp39-cp39-win32.whl", hash = "sha256:1401cfa4320691cbd91191ec678735c727dee674d0997b0902a5a38ad482faf5"}, - {file = "regex-2021.8.27-cp39-cp39-win_amd64.whl", hash = "sha256:0696eb934dee723e3292056a2c046ddb1e4dd3887685783a9f4af638e85dee76"}, - {file = "regex-2021.8.27.tar.gz", hash = "sha256:e9700c52749cb3e90c98efd72b730c97b7e4962992fca5fbcaf1363be8e3b849"}, + {file = "regex-2021.9.24-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:0628ed7d6334e8f896f882a5c1240de8c4d9b0dd7c7fb8e9f4692f5684b7d656"}, + {file = "regex-2021.9.24-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:3baf3eaa41044d4ced2463fd5d23bf7bd4b03d68739c6c99a59ce1f95599a673"}, + {file = "regex-2021.9.24-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:c000635fd78400a558bd7a3c2981bb2a430005ebaa909d31e6e300719739a949"}, + {file = "regex-2021.9.24-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:295bc8a13554a25ad31e44c4bedabd3c3e28bba027e4feeb9bb157647a2344a7"}, + {file = "regex-2021.9.24-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:b0e3f59d3c772f2c3baaef2db425e6fc4149d35a052d874bb95ccfca10a1b9f4"}, + {file = "regex-2021.9.24-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:aea4006b73b555fc5bdb650a8b92cf486d678afa168cf9b38402bb60bf0f9c18"}, + {file = "regex-2021.9.24-cp310-cp310-win32.whl", hash = "sha256:09eb62654030f39f3ba46bc6726bea464069c29d00a9709e28c9ee9623a8da4a"}, + {file = "regex-2021.9.24-cp310-cp310-win_amd64.whl", hash = "sha256:8d80087320632457aefc73f686f66139801959bf5b066b4419b92be85be3543c"}, + {file = "regex-2021.9.24-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:7e3536f305f42ad6d31fc86636c54c7dafce8d634e56fef790fbacb59d499dd5"}, + {file = "regex-2021.9.24-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c31f35a984caffb75f00a86852951a337540b44e4a22171354fb760cefa09346"}, + {file = "regex-2021.9.24-cp36-cp36m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:9c7cb25adba814d5f419733fe565f3289d6fa629ab9e0b78f6dff5fa94ab0456"}, + {file = "regex-2021.9.24-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:85c61bee5957e2d7be390392feac7e1d7abd3a49cbaed0c8cee1541b784c8561"}, + {file = "regex-2021.9.24-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:c94722bf403b8da744b7d0bb87e1f2529383003ceec92e754f768ef9323f69ad"}, + {file = "regex-2021.9.24-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:6adc1bd68f81968c9d249aab8c09cdc2cbe384bf2d2cb7f190f56875000cdc72"}, + {file = "regex-2021.9.24-cp36-cp36m-win32.whl", hash = "sha256:2054dea683f1bda3a804fcfdb0c1c74821acb968093d0be16233873190d459e3"}, + {file = "regex-2021.9.24-cp36-cp36m-win_amd64.whl", hash = "sha256:7783d89bd5413d183a38761fbc68279b984b9afcfbb39fa89d91f63763fbfb90"}, + {file = "regex-2021.9.24-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:b15dc34273aefe522df25096d5d087abc626e388a28a28ac75a4404bb7668736"}, + {file = "regex-2021.9.24-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:10a7a9cbe30bd90b7d9a1b4749ef20e13a3528e4215a2852be35784b6bd070f0"}, + {file = "regex-2021.9.24-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:fb9f5844db480e2ef9fce3a72e71122dd010ab7b2920f777966ba25f7eb63819"}, + {file = "regex-2021.9.24-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:17310b181902e0bb42b29c700e2c2346b8d81f26e900b1328f642e225c88bce1"}, + {file = "regex-2021.9.24-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:0bba1f6df4eafe79db2ecf38835c2626dbd47911e0516f6962c806f83e7a99ae"}, + {file = "regex-2021.9.24-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:821e10b73e0898544807a0692a276e539e5bafe0a055506a6882814b6a02c3ec"}, + {file = "regex-2021.9.24-cp37-cp37m-win32.whl", hash = "sha256:9c371dd326289d85906c27ec2bc1dcdedd9d0be12b543d16e37bad35754bde48"}, + {file = "regex-2021.9.24-cp37-cp37m-win_amd64.whl", hash = "sha256:1e8d1898d4fb817120a5f684363b30108d7b0b46c7261264b100d14ec90a70e7"}, + {file = "regex-2021.9.24-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:8a5c2250c0a74428fd5507ae8853706fdde0f23bfb62ee1ec9418eeacf216078"}, + {file = "regex-2021.9.24-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:8aec4b4da165c4a64ea80443c16e49e3b15df0f56c124ac5f2f8708a65a0eddc"}, + {file = "regex-2021.9.24-cp38-cp38-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:650c4f1fc4273f4e783e1d8e8b51a3e2311c2488ba0fcae6425b1e2c248a189d"}, + {file = "regex-2021.9.24-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:2cdb3789736f91d0b3333ac54d12a7e4f9efbc98f53cb905d3496259a893a8b3"}, + {file = "regex-2021.9.24-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:4e61100200fa6ab7c99b61476f9f9653962ae71b931391d0264acfb4d9527d9c"}, + {file = "regex-2021.9.24-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:8c268e78d175798cd71d29114b0a1f1391c7d011995267d3b62319ec1a4ecaa1"}, + {file = "regex-2021.9.24-cp38-cp38-win32.whl", hash = "sha256:658e3477676009083422042c4bac2bdad77b696e932a3de001c42cc046f8eda2"}, + {file = "regex-2021.9.24-cp38-cp38-win_amd64.whl", hash = "sha256:a731552729ee8ae9c546fb1c651c97bf5f759018fdd40d0e9b4d129e1e3a44c8"}, + {file = "regex-2021.9.24-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:86f9931eb92e521809d4b64ec8514f18faa8e11e97d6c2d1afa1bcf6c20a8eab"}, + {file = "regex-2021.9.24-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:dcbbc9cfa147d55a577d285fd479b43103188855074552708df7acc31a476dd9"}, + {file = "regex-2021.9.24-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:29385c4dbb3f8b3a55ce13de6a97a3d21bd00de66acd7cdfc0b49cb2f08c906c"}, + {file = "regex-2021.9.24-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:c50a6379763c733562b1fee877372234d271e5c78cd13ade5f25978aa06744db"}, + {file = "regex-2021.9.24-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_17_i686.manylinux2014_i686.whl", hash = "sha256:6f74b6d8f59f3cfb8237e25c532b11f794b96f5c89a6f4a25857d85f84fbef11"}, + {file = "regex-2021.9.24-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:6c4d83d21d23dd854ffbc8154cf293f4e43ba630aa9bd2539c899343d7f59da3"}, + {file = "regex-2021.9.24-cp39-cp39-win32.whl", hash = "sha256:95e89a8558c8c48626dcffdf9c8abac26b7c251d352688e7ab9baf351e1c7da6"}, + {file = "regex-2021.9.24-cp39-cp39-win_amd64.whl", hash = "sha256:835962f432bce92dc9bf22903d46c50003c8d11b1dc64084c8fae63bca98564a"}, + {file = "regex-2021.9.24.tar.gz", hash = "sha256:6266fde576e12357b25096351aac2b4b880b0066263e7bc7a9a1b4307991bb0e"}, ] requests = [ {file = "requests-2.26.0-py2.py3-none-any.whl", hash = "sha256:6c1246513ecd5ecd4528a0906f910e8f0f9c6b8ec72030dc9fd154dc1a6efd24"}, {file = "requests-2.26.0.tar.gz", hash = "sha256:b8aa58f8cf793ffd8782d3d8cb19e66ef36f7aba4353eec859e74678b01b07a7"}, ] rich = [ - {file = "rich-10.7.0-py3-none-any.whl", hash = "sha256:517b4e0efd064dd1fe821ca93dd3095d73380ceac1f0a07173d507d9b18f1396"}, - {file = "rich-10.7.0.tar.gz", hash = "sha256:13ac80676e12cf528dc4228dc682c8402f82577c2aa67191e294350fa2c3c4e9"}, + {file = "rich-10.11.0-py3-none-any.whl", hash = "sha256:44bb3f9553d00b3c8938abf89828df870322b9ba43caf3b12bb7758debdc6dec"}, + {file = "rich-10.11.0.tar.gz", hash = "sha256:016fa105f34b69c434e7f908bb5bd7fefa9616efdb218a2917117683a6394ce5"}, ] scipy = [ {file = "scipy-1.7.1-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:2a0eeaab01258e0870c4022a6cd329aef3b7c6c2b606bd7cf7bb2ba9820ae561"}, @@ -1145,6 +1373,14 @@ tomli = [ {file = "tomli-1.2.1-py3-none-any.whl", hash = "sha256:8dd0e9524d6f386271a36b41dbf6c57d8e32fd96fd22b6584679dc569d20899f"}, {file = "tomli-1.2.1.tar.gz", hash = "sha256:a5b75cb6f3968abb47af1b40c1819dc519ea82bcc065776a866e8d74c5ca9442"}, ] +tqdm = [ + {file = "tqdm-4.62.3-py2.py3-none-any.whl", hash = "sha256:8dd278a422499cd6b727e6ae4061c40b48fce8b76d1ccbf5d34fca9b7f925b0c"}, + {file = "tqdm-4.62.3.tar.gz", hash = "sha256:d359de7217506c9851b7869f3708d8ee53ed70a1b8edbba4dbcb47442592920d"}, +] +traitlets = [ + {file = "traitlets-5.1.0-py3-none-any.whl", hash = "sha256:03f172516916220b58c9f19d7f854734136dd9528103d04e9bf139a92c9f54c4"}, + {file = "traitlets-5.1.0.tar.gz", hash = "sha256:bd382d7ea181fbbcce157c133db9a829ce06edffe097bcf3ab945b435452b46d"}, +] typed-ast = [ {file = "typed_ast-1.4.3-cp35-cp35m-manylinux1_i686.whl", hash = "sha256:2068531575a125b87a41802130fa7e29f26c09a2833fea68d9a40cf33902eba6"}, {file = "typed_ast-1.4.3-cp35-cp35m-manylinux1_x86_64.whl", hash = "sha256:c907f561b1e83e93fad565bac5ba9c22d96a54e7ea0267c708bffe863cbe4075"}, @@ -1178,13 +1414,13 @@ typed-ast = [ {file = "typed_ast-1.4.3.tar.gz", hash = "sha256:fb1bbeac803adea29cedd70781399c99138358c26d05fcbd23c13016b7f5ec65"}, ] typing-extensions = [ - {file = "typing_extensions-3.10.0.0-py2-none-any.whl", hash = "sha256:0ac0f89795dd19de6b97debb0c6af1c70987fd80a2d62d1958f7e56fcc31b497"}, - {file = "typing_extensions-3.10.0.0-py3-none-any.whl", hash = "sha256:779383f6086d90c99ae41cf0ff39aac8a7937a9283ce0a414e5dd782f4c94a84"}, - {file = "typing_extensions-3.10.0.0.tar.gz", hash = "sha256:50b6f157849174217d0656f99dc82fe932884fb250826c18350e159ec6cdf342"}, + {file = "typing_extensions-3.10.0.2-py2-none-any.whl", hash = "sha256:d8226d10bc02a29bcc81df19a26e56a9647f8b0a6d4a83924139f4a8b01f17b7"}, + {file = "typing_extensions-3.10.0.2-py3-none-any.whl", hash = "sha256:f1d25edafde516b146ecd0613dabcc61409817af4766fbbcfb8d1ad4ec441a34"}, + {file = "typing_extensions-3.10.0.2.tar.gz", hash = "sha256:49f75d16ff11f1cd258e1b988ccff82a3ca5570217d7ad8c5f48205dd99a677e"}, ] urllib3 = [ - {file = "urllib3-1.26.6-py2.py3-none-any.whl", hash = "sha256:39fb8672126159acb139a7718dd10806104dec1e2f0f6c88aab05d17df10c8d4"}, - {file = "urllib3-1.26.6.tar.gz", hash = "sha256:f57b4c16c62fa2760b7e3d97c35b255512fb6b59a259730f36ba32ce9f8e342f"}, + {file = "urllib3-1.26.7-py2.py3-none-any.whl", hash = "sha256:c4fdf4019605b6e5423637e01bc9fe4daef873709a7973e195ceba0a62bbc844"}, + {file = "urllib3-1.26.7.tar.gz", hash = "sha256:4987c65554f7a2dbf30c18fd48778ef124af6fab771a377103da0585e2336ece"}, ] wcwidth = [ {file = "wcwidth-0.2.5-py2.py3-none-any.whl", hash = "sha256:beb4802a9cebb9144e99086eff703a642a13d6a0052920003a230f3294bbe784"}, @@ -1197,6 +1433,6 @@ yadism = [ {file = "yadism-0.7.0-py3-none-any.whl", hash = "sha256:5da4afecfd52796318b572e399807537a7784c8398df298e947fa330e71f62fc"}, ] zipp = [ - {file = "zipp-3.5.0-py3-none-any.whl", hash = "sha256:957cfda87797e389580cb8b9e3870841ca991e2125350677b2ca83a0e99390a3"}, - {file = "zipp-3.5.0.tar.gz", hash = "sha256:f5812b1e007e48cff63449a5e9f4e7ebea716b4111f9c4f9a645f91d579bf0c4"}, + {file = "zipp-3.6.0-py3-none-any.whl", hash = "sha256:9fe5ea21568a0a70e50f273397638d39b03353731e6cbbb3fd8502a33fec40bc"}, + {file = "zipp-3.6.0.tar.gz", hash = "sha256:71c644c5369f4a6e07636f0aa966270449561fcea2e3d6747b8d23efaa9d7832"}, ] diff --git a/pyproject.toml b/pyproject.toml index ba6fd4d3..c6c10a47 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -7,7 +7,6 @@ authors = ["Alessandro Candido "] [tool.poetry.dependencies] python = ">=3.7.1,<3.10" click = "^8.0.1" -PyInquirer = "^1.0.3" rich = "^10.6.0" PyYAML = "^5.4.1" yadism = "^0.7.0" @@ -19,12 +18,16 @@ pkgconfig = "^1.5.5" pygit2 = "^1.6.1" requests = "^2.26.0" a3b2bbc3ced97675ac3a71df45f55ba = "^6.4.0" +inquirerpy = "^0.2.4" +lhapdf-management = "^0.1rc1" +pineappl = {version = "0.5.0_beta.1", allow-prereleases = true} [tool.poetry.dev-dependencies] pytest = "^5.2" pdbpp = "^0.10.3" black = "^21.9b0" isort = "^5.9.3" +ipython = "^7.28.0" [tool.poetry.scripts] rr = "run:run" diff --git a/run/confs/lhapdf.conf b/run/confs/lhapdf.conf new file mode 100644 index 00000000..10ae3f39 --- /dev/null +++ b/run/confs/lhapdf.conf @@ -0,0 +1,13 @@ +Verbosity: 1 +Interpolator: logcubic +Extrapolator: continuation +ForcePositive: 0 +AlphaS_Type: analytic +MZ: 91.1876 +MUp: 0.002 +MDown: 0.005 +MStrange: 0.10 +MCharm: 1.29 +MBottom: 4.19 +MTop: 172.9 +Pythia6LambdaV5Compat: true diff --git a/run/dis_.py b/run/dis_.py deleted file mode 100644 index b49e56e7..00000000 --- a/run/dis_.py +++ /dev/null @@ -1,22 +0,0 @@ -import time - -import click -import rich - -from . import install, tools, paths, table -from .external import yad - - -@click.command() -@click.option("--datasets", multiple=True) -@click.option("--pdf", default="NNPDF31_nlo_as_0118_luxqed") -def dis(datasets, pdf): - - -def install_reqs(): - t0 = time.perf_counter() - - install.update_environ() - install.pineappl() - - tools.print_time(t0, "Installation") diff --git a/run/external/interface.py b/run/external/interface.py index 2691574b..cb269df9 100644 --- a/run/external/interface.py +++ b/run/external/interface.py @@ -1,9 +1,9 @@ import abc import shutil import subprocess -from pkgconfig.pkgconfig import exists import pygit2 +from pkgconfig.pkgconfig import exists from .. import paths, tools @@ -29,6 +29,10 @@ def gridtmp(self): def update_with_tmp(self): shutil.move(self.gridtmp, self.grid) + @staticmethod + def install(): + pass + @abc.abstractmethod def run(self): pass diff --git a/run/external/mg5.py b/run/external/mg5.py index 24062527..926b99eb 100644 --- a/run/external/mg5.py +++ b/run/external/mg5.py @@ -1,14 +1,14 @@ -import subprocess import json +import os import re import shutil -import os +import subprocess +import lz4.frame import numpy as np import pandas as pd -import lz4.frame -from .. import paths, tools +from .. import install, paths, tools from . import interface @@ -17,6 +17,10 @@ class Mg5(interface.External): def mg5_dir(self): return self.dest / self.name + @staticmethod + def install(): + install.mg5amc() + def run(self): # copy the output file to the directory and replace the variables output = (self.source / "output.txt").read_text().replace("@OUTPUT@", self.name) diff --git a/run/external/yad.py b/run/external/yad.py index 6a4b9a63..167bc11d 100644 --- a/run/external/yad.py +++ b/run/external/yad.py @@ -1,11 +1,12 @@ from functools import reduce +import lhapdf +import lhapdf_management import pandas as pd -import yaml import yadism -import lhapdf +import yaml -from .. import paths, table, tools +from .. import install, paths, table, tools from . import interface @@ -14,6 +15,10 @@ def __init__(self, *args): super().__init__(*args) self.out = None + @staticmethod + def install(): + install.lhapdf() + def run(self): print("Running yadism...") @@ -32,6 +37,7 @@ def run(self): ) def results(self): + lhapdf_management.pdf_install(self.pdf) pdf = lhapdf.mkPDF(self.pdf) pdf_out = self.out.apply_pdf_alphas_alphaqed_xir_xif( pdf, diff --git a/run/install.py b/run/install.py index e069ca68..632edb9d 100644 --- a/run/install.py +++ b/run/install.py @@ -1,16 +1,15 @@ -import sys import os -import subprocess import shutil +import subprocess +import sys +import InquirerPy import pkgconfig import pygit2 import requests -import PyInquirer from . import paths, tools - paths.prefix.mkdir(exist_ok=True) paths.bin.mkdir(exist_ok=True) paths.lib.mkdir(exist_ok=True) @@ -34,7 +33,7 @@ def confirm(name): "message": "Do you want to install it?", } ] - answers = PyInquirer.prompt(questions) + answers = InquirerPy.prompt(questions) return answers["install"] @@ -126,6 +125,11 @@ def pineappl(): return condition() +def lhapdf(): + paths.lhapdf_data.mkdir(parents=True, exist_ok=True) + shutil.copy2(paths.lhapdf_conf, paths.lhapdf_data) + + def update_environ(): def prepend(name, value): os.environ[name] = str(value) + os.pathsep + os.environ[name] diff --git a/run/paths.py b/run/paths.py index 588bd476..63183b5b 100644 --- a/run/paths.py +++ b/run/paths.py @@ -1,12 +1,15 @@ import pathlib import shutil +import lhapdf + pkg = pathlib.Path(__file__).absolute().parent root = pkg.parent # internal cuts_code = pkg / "cuts_code" cuts_variables = pkg / "cuts_variables" +lhapdf_conf = pkg / "confs" / "lhapdf.conf" # external runcards = root / "nnpdf31_proc" @@ -24,3 +27,7 @@ # tmp rust_init = pathlib.Path("/tmp/rustup-init") + +# lhapdf +lhapdf_data = prefix / "share" / "LHAPDF" +lhapdf.pathsPrepend(str(lhapdf_data)) diff --git a/run/run.py b/run/run.py index eab00f4d..5a196516 100644 --- a/run/run.py +++ b/run/run.py @@ -1,10 +1,10 @@ -import time import pathlib +import time import click import rich -from . import install, tools, table +from . import install, table, tools from .external import mg5, yad @@ -15,32 +15,33 @@ def run(dataset, pdf): dataset = pathlib.Path(dataset).name rich.print(dataset) - install_reqs() + + if tools.is_dis(dataset): + rich.print(f"Computing [red]{dataset}[/]...") + runner = yad.Yadism(dataset, pdf) + else: + rich.print(f"Computing [blue]{dataset}[/]...") + runner = mg5.Mg5(dataset, pdf) + + install_reqs(runner) if tools.avoid_recompute(dataset): return - run_dataset(dataset, pdf) + run_dataset(runner, dataset, pdf) -def install_reqs(): +def install_reqs(runner): t0 = time.perf_counter() install.update_environ() - install.mg5amc() + runner.install() install.pineappl() tools.print_time(t0, "Installation") -def run_dataset(name, pdf): +def run_dataset(runner, name, pdf): t0 = time.perf_counter() - if tools.is_dis(name): - rich.print(f"Computing [red]{name}[/]...") - runner = yad.Yadism(name, pdf) - else: - rich.print(f"Computing [blue]{name}[/]...") - runner = mg5.Mg5(name, pdf) - tools.print_time(t0, "Grid calculation") runner.run() diff --git a/run/tools.py b/run/tools.py index 68fcefab..9e1de2cb 100644 --- a/run/tools.py +++ b/run/tools.py @@ -1,12 +1,13 @@ -import time, datetime +import datetime import itertools -from difflib import SequenceMatcher import subprocess +import time +from difflib import SequenceMatcher -import rich +import InquirerPy import lz4.frame import pygit2 -import PyInquirer +import rich from . import paths @@ -80,7 +81,7 @@ def avoid_recompute(name): "message": f"Do you want to recompute '{name}'?\n", } ] - answers = PyInquirer.prompt(questions) + answers = InquirerPy.prompt(questions) return not answers["recompute"] return False From ec885be34765fe65024d25bebd1d702a2839b414 Mon Sep 17 00:00:00 2001 From: Alessandro Candido Date: Fri, 1 Oct 2021 09:55:50 +0200 Subject: [PATCH 31/63] Change package name --- pyproject.toml | 4 ++-- {run => runcardsrunner}/__init__.py | 0 {run => runcardsrunner}/confs/lhapdf.conf | 0 {run => runcardsrunner}/cuts_code/abscoscsmax.f | 1 - {run => runcardsrunner}/cuts_code/abscoscsmin.f | 1 - {run => runcardsrunner}/cuts_code/atlas_1jet_8tev_r06.f | 1 - {run => runcardsrunner}/cuts_code/atlas_2jet_7tev_r06.f | 1 - {run => runcardsrunner}/cuts_code/atlas_dy3d_8tev.f | 0 {run => runcardsrunner}/cuts_code/atlas_wzrap11_cf.f | 0 {run => runcardsrunner}/cuts_code/cms_2jet_3d_8tev.f | 1 - {run => runcardsrunner}/cuts_code/cms_2jets_7tev.f | 1 - {run => runcardsrunner}/cuts_code/dyjj.f | 1 - {run => runcardsrunner}/cuts_code/minetal.f | 1 - {run => runcardsrunner}/cuts_code/mjj.f | 1 - {run => runcardsrunner}/cuts_code/mmllmax.f | 1 - {run => runcardsrunner}/cuts_code/mtw.f | 1 - {run => runcardsrunner}/cuts_code/ptj1min.f | 1 - {run => runcardsrunner}/cuts_code/ptl1min.f | 1 - {run => runcardsrunner}/cuts_code/ptmiss.f | 1 - {run => runcardsrunner}/cuts_code/ptzmax.f | 1 - {run => runcardsrunner}/cuts_code/ptzmin.f | 1 - {run => runcardsrunner}/cuts_code/yh.f | 1 - {run => runcardsrunner}/cuts_code/yll.f | 1 - {run => runcardsrunner}/cuts_code/yt.f | 1 - {run => runcardsrunner}/cuts_code/yz.f | 1 - {run => runcardsrunner}/cuts_code/yzmin.f | 1 - {run => runcardsrunner}/cuts_variables/abscoscs.f | 0 {run => runcardsrunner}/cuts_variables/atlas_1jet_8tev_r06.f | 0 {run => runcardsrunner}/cuts_variables/atlas_2jet_7tev_r06.f | 0 {run => runcardsrunner}/cuts_variables/atlas_dy3d_8tev.f | 0 {run => runcardsrunner}/cuts_variables/atlas_wzrap11_cf.f | 0 {run => runcardsrunner}/cuts_variables/cms_2jet_3d_8tev.f | 0 {run => runcardsrunner}/cuts_variables/cms_2jets_7tev.f | 0 {run => runcardsrunner}/cuts_variables/mtw.f | 0 {run => runcardsrunner}/cuts_variables/ptmiss.f | 0 {run => runcardsrunner}/external/__init__.py | 0 {run => runcardsrunner}/external/interface.py | 0 {run => runcardsrunner}/external/mg5.py | 0 {run => runcardsrunner}/external/yad.py | 0 {run => runcardsrunner}/install.py | 0 {run => runcardsrunner}/paths.py | 0 {run => runcardsrunner}/run.py | 0 {run => runcardsrunner}/table.py | 5 ++--- {run => runcardsrunner}/theory.yaml | 0 {run => runcardsrunner}/tools.py | 0 {run => runcardsrunner}/variables.json | 0 46 files changed, 4 insertions(+), 26 deletions(-) rename {run => runcardsrunner}/__init__.py (100%) rename {run => runcardsrunner}/confs/lhapdf.conf (100%) rename {run => runcardsrunner}/cuts_code/abscoscsmax.f (99%) rename {run => runcardsrunner}/cuts_code/abscoscsmin.f (99%) rename {run => runcardsrunner}/cuts_code/atlas_1jet_8tev_r06.f (99%) rename {run => runcardsrunner}/cuts_code/atlas_2jet_7tev_r06.f (99%) rename {run => runcardsrunner}/cuts_code/atlas_dy3d_8tev.f (100%) rename {run => runcardsrunner}/cuts_code/atlas_wzrap11_cf.f (100%) rename {run => runcardsrunner}/cuts_code/cms_2jet_3d_8tev.f (99%) rename {run => runcardsrunner}/cuts_code/cms_2jets_7tev.f (99%) rename {run => runcardsrunner}/cuts_code/dyjj.f (99%) rename {run => runcardsrunner}/cuts_code/minetal.f (99%) rename {run => runcardsrunner}/cuts_code/mjj.f (99%) rename {run => runcardsrunner}/cuts_code/mmllmax.f (99%) rename {run => runcardsrunner}/cuts_code/mtw.f (99%) rename {run => runcardsrunner}/cuts_code/ptj1min.f (99%) rename {run => runcardsrunner}/cuts_code/ptl1min.f (99%) rename {run => runcardsrunner}/cuts_code/ptmiss.f (99%) rename {run => runcardsrunner}/cuts_code/ptzmax.f (99%) rename {run => runcardsrunner}/cuts_code/ptzmin.f (99%) rename {run => runcardsrunner}/cuts_code/yh.f (99%) rename {run => runcardsrunner}/cuts_code/yll.f (99%) rename {run => runcardsrunner}/cuts_code/yt.f (99%) rename {run => runcardsrunner}/cuts_code/yz.f (99%) rename {run => runcardsrunner}/cuts_code/yzmin.f (99%) rename {run => runcardsrunner}/cuts_variables/abscoscs.f (100%) rename {run => runcardsrunner}/cuts_variables/atlas_1jet_8tev_r06.f (100%) rename {run => runcardsrunner}/cuts_variables/atlas_2jet_7tev_r06.f (100%) rename {run => runcardsrunner}/cuts_variables/atlas_dy3d_8tev.f (100%) rename {run => runcardsrunner}/cuts_variables/atlas_wzrap11_cf.f (100%) rename {run => runcardsrunner}/cuts_variables/cms_2jet_3d_8tev.f (100%) rename {run => runcardsrunner}/cuts_variables/cms_2jets_7tev.f (100%) rename {run => runcardsrunner}/cuts_variables/mtw.f (100%) rename {run => runcardsrunner}/cuts_variables/ptmiss.f (100%) rename {run => runcardsrunner}/external/__init__.py (100%) rename {run => runcardsrunner}/external/interface.py (100%) rename {run => runcardsrunner}/external/mg5.py (100%) rename {run => runcardsrunner}/external/yad.py (100%) rename {run => runcardsrunner}/install.py (100%) rename {run => runcardsrunner}/paths.py (100%) rename {run => runcardsrunner}/run.py (100%) rename {run => runcardsrunner}/table.py (99%) rename {run => runcardsrunner}/theory.yaml (100%) rename {run => runcardsrunner}/tools.py (100%) rename {run => runcardsrunner}/variables.json (100%) diff --git a/pyproject.toml b/pyproject.toml index c6c10a47..2c257e4c 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,5 +1,5 @@ [tool.poetry] -name = "run" +name = "runcardsrunner" version = "0.0.0" description = "generate runcards" authors = ["Alessandro Candido "] @@ -30,7 +30,7 @@ isort = "^5.9.3" ipython = "^7.28.0" [tool.poetry.scripts] -rr = "run:run" +rr = "runcardsrunner:run" [build-system] requires = ["poetry-core>=1.0.0"] diff --git a/run/__init__.py b/runcardsrunner/__init__.py similarity index 100% rename from run/__init__.py rename to runcardsrunner/__init__.py diff --git a/run/confs/lhapdf.conf b/runcardsrunner/confs/lhapdf.conf similarity index 100% rename from run/confs/lhapdf.conf rename to runcardsrunner/confs/lhapdf.conf diff --git a/run/cuts_code/abscoscsmax.f b/runcardsrunner/cuts_code/abscoscsmax.f similarity index 99% rename from run/cuts_code/abscoscsmax.f rename to runcardsrunner/cuts_code/abscoscsmax.f index 37ddbfe1..1ca22c7f 100644 --- a/run/cuts_code/abscoscsmax.f +++ b/runcardsrunner/cuts_code/abscoscsmax.f @@ -38,4 +38,3 @@ enddo endif enddo - diff --git a/run/cuts_code/abscoscsmin.f b/runcardsrunner/cuts_code/abscoscsmin.f similarity index 99% rename from run/cuts_code/abscoscsmin.f rename to runcardsrunner/cuts_code/abscoscsmin.f index 8df6f97a..eaaa64c9 100644 --- a/run/cuts_code/abscoscsmin.f +++ b/runcardsrunner/cuts_code/abscoscsmin.f @@ -38,4 +38,3 @@ enddo endif enddo - diff --git a/run/cuts_code/atlas_1jet_8tev_r06.f b/runcardsrunner/cuts_code/atlas_1jet_8tev_r06.f similarity index 99% rename from run/cuts_code/atlas_1jet_8tev_r06.f rename to runcardsrunner/cuts_code/atlas_1jet_8tev_r06.f index 59ab986f..bf388750 100644 --- a/run/cuts_code/atlas_1jet_8tev_r06.f +++ b/runcardsrunner/cuts_code/atlas_1jet_8tev_r06.f @@ -44,4 +44,3 @@ return endif endif - diff --git a/run/cuts_code/atlas_2jet_7tev_r06.f b/runcardsrunner/cuts_code/atlas_2jet_7tev_r06.f similarity index 99% rename from run/cuts_code/atlas_2jet_7tev_r06.f rename to runcardsrunner/cuts_code/atlas_2jet_7tev_r06.f index 398b3ec9..aad5fde0 100644 --- a/run/cuts_code/atlas_2jet_7tev_r06.f +++ b/runcardsrunner/cuts_code/atlas_2jet_7tev_r06.f @@ -44,4 +44,3 @@ return endif endif - diff --git a/run/cuts_code/atlas_dy3d_8tev.f b/runcardsrunner/cuts_code/atlas_dy3d_8tev.f similarity index 100% rename from run/cuts_code/atlas_dy3d_8tev.f rename to runcardsrunner/cuts_code/atlas_dy3d_8tev.f diff --git a/run/cuts_code/atlas_wzrap11_cf.f b/runcardsrunner/cuts_code/atlas_wzrap11_cf.f similarity index 100% rename from run/cuts_code/atlas_wzrap11_cf.f rename to runcardsrunner/cuts_code/atlas_wzrap11_cf.f diff --git a/run/cuts_code/cms_2jet_3d_8tev.f b/runcardsrunner/cuts_code/cms_2jet_3d_8tev.f similarity index 99% rename from run/cuts_code/cms_2jet_3d_8tev.f rename to runcardsrunner/cuts_code/cms_2jet_3d_8tev.f index 26bd001a..c9cf439f 100644 --- a/run/cuts_code/cms_2jet_3d_8tev.f +++ b/runcardsrunner/cuts_code/cms_2jet_3d_8tev.f @@ -66,4 +66,3 @@ return endif endif - diff --git a/run/cuts_code/cms_2jets_7tev.f b/runcardsrunner/cuts_code/cms_2jets_7tev.f similarity index 99% rename from run/cuts_code/cms_2jets_7tev.f rename to runcardsrunner/cuts_code/cms_2jets_7tev.f index bec33959..4e3052f5 100644 --- a/run/cuts_code/cms_2jets_7tev.f +++ b/runcardsrunner/cuts_code/cms_2jets_7tev.f @@ -39,4 +39,3 @@ return endif endif - diff --git a/run/cuts_code/dyjj.f b/runcardsrunner/cuts_code/dyjj.f similarity index 99% rename from run/cuts_code/dyjj.f rename to runcardsrunner/cuts_code/dyjj.f index 5b01e59e..06400965 100644 --- a/run/cuts_code/dyjj.f +++ b/runcardsrunner/cuts_code/dyjj.f @@ -5,4 +5,3 @@ passcuts_user=.false. return endif - diff --git a/run/cuts_code/minetal.f b/runcardsrunner/cuts_code/minetal.f similarity index 99% rename from run/cuts_code/minetal.f rename to runcardsrunner/cuts_code/minetal.f index aafbceaf..a6b07d18 100644 --- a/run/cuts_code/minetal.f +++ b/runcardsrunner/cuts_code/minetal.f @@ -8,4 +8,3 @@ endif endif enddo - diff --git a/run/cuts_code/mjj.f b/runcardsrunner/cuts_code/mjj.f similarity index 99% rename from run/cuts_code/mjj.f rename to runcardsrunner/cuts_code/mjj.f index 037952f6..e63402bd 100644 --- a/run/cuts_code/mjj.f +++ b/runcardsrunner/cuts_code/mjj.f @@ -3,4 +3,3 @@ passcuts_user=.false. return endif - diff --git a/run/cuts_code/mmllmax.f b/runcardsrunner/cuts_code/mmllmax.f similarity index 99% rename from run/cuts_code/mmllmax.f rename to runcardsrunner/cuts_code/mmllmax.f index 347e10d1..547a513c 100644 --- a/run/cuts_code/mmllmax.f +++ b/runcardsrunner/cuts_code/mmllmax.f @@ -11,4 +11,3 @@ enddo endif enddo - diff --git a/run/cuts_code/mtw.f b/runcardsrunner/cuts_code/mtw.f similarity index 99% rename from run/cuts_code/mtw.f rename to runcardsrunner/cuts_code/mtw.f index 73d535a1..ba93c1c6 100644 --- a/run/cuts_code/mtw.f +++ b/runcardsrunner/cuts_code/mtw.f @@ -15,4 +15,3 @@ endif enddo enddo - diff --git a/run/cuts_code/ptj1min.f b/runcardsrunner/cuts_code/ptj1min.f similarity index 99% rename from run/cuts_code/ptj1min.f rename to runcardsrunner/cuts_code/ptj1min.f index 78e07ff6..b5257955 100644 --- a/run/cuts_code/ptj1min.f +++ b/runcardsrunner/cuts_code/ptj1min.f @@ -3,4 +3,3 @@ passcuts_user=.false. return endif - diff --git a/run/cuts_code/ptl1min.f b/runcardsrunner/cuts_code/ptl1min.f similarity index 99% rename from run/cuts_code/ptl1min.f rename to runcardsrunner/cuts_code/ptl1min.f index 081baf16..806d2e61 100644 --- a/run/cuts_code/ptl1min.f +++ b/runcardsrunner/cuts_code/ptl1min.f @@ -11,4 +11,3 @@ passcuts_user=.false. return endif - diff --git a/run/cuts_code/ptmiss.f b/runcardsrunner/cuts_code/ptmiss.f similarity index 99% rename from run/cuts_code/ptmiss.f rename to runcardsrunner/cuts_code/ptmiss.f index 26578514..5073e147 100644 --- a/run/cuts_code/ptmiss.f +++ b/runcardsrunner/cuts_code/ptmiss.f @@ -14,4 +14,3 @@ passcuts_user=.false. return endif - diff --git a/run/cuts_code/ptzmax.f b/runcardsrunner/cuts_code/ptzmax.f similarity index 99% rename from run/cuts_code/ptzmax.f rename to runcardsrunner/cuts_code/ptzmax.f index 02be2c5c..b4ee8a75 100644 --- a/run/cuts_code/ptzmax.f +++ b/runcardsrunner/cuts_code/ptzmax.f @@ -12,4 +12,3 @@ enddo endif enddo - diff --git a/run/cuts_code/ptzmin.f b/runcardsrunner/cuts_code/ptzmin.f similarity index 99% rename from run/cuts_code/ptzmin.f rename to runcardsrunner/cuts_code/ptzmin.f index 0bc3f3ce..eb7b3c68 100644 --- a/run/cuts_code/ptzmin.f +++ b/runcardsrunner/cuts_code/ptzmin.f @@ -12,4 +12,3 @@ enddo endif enddo - diff --git a/run/cuts_code/yh.f b/runcardsrunner/cuts_code/yh.f similarity index 99% rename from run/cuts_code/yh.f rename to runcardsrunner/cuts_code/yh.f index 3de158a8..898f3487 100644 --- a/run/cuts_code/yh.f +++ b/runcardsrunner/cuts_code/yh.f @@ -8,4 +8,3 @@ endif endif enddo - diff --git a/run/cuts_code/yll.f b/runcardsrunner/cuts_code/yll.f similarity index 99% rename from run/cuts_code/yll.f rename to runcardsrunner/cuts_code/yll.f index a81d59b9..25f4ace5 100644 --- a/run/cuts_code/yll.f +++ b/runcardsrunner/cuts_code/yll.f @@ -26,4 +26,3 @@ passcuts_user=.false. return endif - diff --git a/run/cuts_code/yt.f b/runcardsrunner/cuts_code/yt.f similarity index 99% rename from run/cuts_code/yt.f rename to runcardsrunner/cuts_code/yt.f index 02483ee8..a7a2d3f0 100644 --- a/run/cuts_code/yt.f +++ b/runcardsrunner/cuts_code/yt.f @@ -8,4 +8,3 @@ endif endif enddo - diff --git a/run/cuts_code/yz.f b/runcardsrunner/cuts_code/yz.f similarity index 99% rename from run/cuts_code/yz.f rename to runcardsrunner/cuts_code/yz.f index 3c4dfca1..031fade2 100644 --- a/run/cuts_code/yz.f +++ b/runcardsrunner/cuts_code/yz.f @@ -12,4 +12,3 @@ enddo endif enddo - diff --git a/run/cuts_code/yzmin.f b/runcardsrunner/cuts_code/yzmin.f similarity index 99% rename from run/cuts_code/yzmin.f rename to runcardsrunner/cuts_code/yzmin.f index a4fe66f0..1cd47dfd 100644 --- a/run/cuts_code/yzmin.f +++ b/runcardsrunner/cuts_code/yzmin.f @@ -12,4 +12,3 @@ enddo endif enddo - diff --git a/run/cuts_variables/abscoscs.f b/runcardsrunner/cuts_variables/abscoscs.f similarity index 100% rename from run/cuts_variables/abscoscs.f rename to runcardsrunner/cuts_variables/abscoscs.f diff --git a/run/cuts_variables/atlas_1jet_8tev_r06.f b/runcardsrunner/cuts_variables/atlas_1jet_8tev_r06.f similarity index 100% rename from run/cuts_variables/atlas_1jet_8tev_r06.f rename to runcardsrunner/cuts_variables/atlas_1jet_8tev_r06.f diff --git a/run/cuts_variables/atlas_2jet_7tev_r06.f b/runcardsrunner/cuts_variables/atlas_2jet_7tev_r06.f similarity index 100% rename from run/cuts_variables/atlas_2jet_7tev_r06.f rename to runcardsrunner/cuts_variables/atlas_2jet_7tev_r06.f diff --git a/run/cuts_variables/atlas_dy3d_8tev.f b/runcardsrunner/cuts_variables/atlas_dy3d_8tev.f similarity index 100% rename from run/cuts_variables/atlas_dy3d_8tev.f rename to runcardsrunner/cuts_variables/atlas_dy3d_8tev.f diff --git a/run/cuts_variables/atlas_wzrap11_cf.f b/runcardsrunner/cuts_variables/atlas_wzrap11_cf.f similarity index 100% rename from run/cuts_variables/atlas_wzrap11_cf.f rename to runcardsrunner/cuts_variables/atlas_wzrap11_cf.f diff --git a/run/cuts_variables/cms_2jet_3d_8tev.f b/runcardsrunner/cuts_variables/cms_2jet_3d_8tev.f similarity index 100% rename from run/cuts_variables/cms_2jet_3d_8tev.f rename to runcardsrunner/cuts_variables/cms_2jet_3d_8tev.f diff --git a/run/cuts_variables/cms_2jets_7tev.f b/runcardsrunner/cuts_variables/cms_2jets_7tev.f similarity index 100% rename from run/cuts_variables/cms_2jets_7tev.f rename to runcardsrunner/cuts_variables/cms_2jets_7tev.f diff --git a/run/cuts_variables/mtw.f b/runcardsrunner/cuts_variables/mtw.f similarity index 100% rename from run/cuts_variables/mtw.f rename to runcardsrunner/cuts_variables/mtw.f diff --git a/run/cuts_variables/ptmiss.f b/runcardsrunner/cuts_variables/ptmiss.f similarity index 100% rename from run/cuts_variables/ptmiss.f rename to runcardsrunner/cuts_variables/ptmiss.f diff --git a/run/external/__init__.py b/runcardsrunner/external/__init__.py similarity index 100% rename from run/external/__init__.py rename to runcardsrunner/external/__init__.py diff --git a/run/external/interface.py b/runcardsrunner/external/interface.py similarity index 100% rename from run/external/interface.py rename to runcardsrunner/external/interface.py diff --git a/run/external/mg5.py b/runcardsrunner/external/mg5.py similarity index 100% rename from run/external/mg5.py rename to runcardsrunner/external/mg5.py diff --git a/run/external/yad.py b/runcardsrunner/external/yad.py similarity index 100% rename from run/external/yad.py rename to runcardsrunner/external/yad.py diff --git a/run/install.py b/runcardsrunner/install.py similarity index 100% rename from run/install.py rename to runcardsrunner/install.py diff --git a/run/paths.py b/runcardsrunner/paths.py similarity index 100% rename from run/paths.py rename to runcardsrunner/paths.py diff --git a/run/run.py b/runcardsrunner/run.py similarity index 100% rename from run/run.py rename to runcardsrunner/run.py diff --git a/run/table.py b/runcardsrunner/table.py similarity index 99% rename from run/table.py rename to runcardsrunner/table.py index b4b6bda7..e65d595c 100644 --- a/run/table.py +++ b/runcardsrunner/table.py @@ -1,7 +1,6 @@ -import subprocess -import itertools import inspect - +import itertools +import subprocess import pandas as pd diff --git a/run/theory.yaml b/runcardsrunner/theory.yaml similarity index 100% rename from run/theory.yaml rename to runcardsrunner/theory.yaml diff --git a/run/tools.py b/runcardsrunner/tools.py similarity index 100% rename from run/tools.py rename to runcardsrunner/tools.py diff --git a/run/variables.json b/runcardsrunner/variables.json similarity index 100% rename from run/variables.json rename to runcardsrunner/variables.json From 70247cd9326805ab044f31bd729f3777f89d0d12 Mon Sep 17 00:00:00 2001 From: Alessandro Candido Date: Fri, 1 Oct 2021 10:51:49 +0200 Subject: [PATCH 32/63] Fix directory existence check --- runcardsrunner/run.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/runcardsrunner/run.py b/runcardsrunner/run.py index 5a196516..f5be29ab 100644 --- a/runcardsrunner/run.py +++ b/runcardsrunner/run.py @@ -15,6 +15,8 @@ def run(dataset, pdf): dataset = pathlib.Path(dataset).name rich.print(dataset) + if tools.avoid_recompute(dataset): + return if tools.is_dis(dataset): rich.print(f"Computing [red]{dataset}[/]...") @@ -24,8 +26,6 @@ def run(dataset, pdf): runner = mg5.Mg5(dataset, pdf) install_reqs(runner) - if tools.avoid_recompute(dataset): - return run_dataset(runner, dataset, pdf) From 07f6f3fe23909debeb5df4a3d6a0adbbf6cf0da0 Mon Sep 17 00:00:00 2001 From: Alessandro Candido Date: Fri, 1 Oct 2021 11:04:30 +0200 Subject: [PATCH 33/63] Upgrade cuts related snippets --- .../cuts_code/atlas_2jet_7tev_r06.f | 46 ------------------- .../cuts_code/atlas_2jet_7tev_r06_0005.f | 20 ++++++++ .../cuts_code/atlas_2jet_7tev_r06_0510.f | 20 ++++++++ .../cuts_code/atlas_2jet_7tev_r06_1015.f | 20 ++++++++ .../cuts_code/atlas_2jet_7tev_r06_1520.f | 20 ++++++++ .../cuts_code/atlas_2jet_7tev_r06_2025.f | 20 ++++++++ .../cuts_code/atlas_2jet_7tev_r06_2530.f | 20 ++++++++ runcardsrunner/cuts_code/cms_2jets_7tev.f | 41 ----------------- .../cuts_code/cms_2jets_7tev_0005.f | 20 ++++++++ .../cuts_code/cms_2jets_7tev_0510.f | 20 ++++++++ .../cuts_code/cms_2jets_7tev_1015.f | 20 ++++++++ .../cuts_code/cms_2jets_7tev_1520.f | 20 ++++++++ .../cuts_code/cms_2jets_7tev_2025.f | 20 ++++++++ .../cuts_variables/atlas_2jet_7tev_r06.f | 2 - .../cuts_variables/cms_2jets_7tev.f | 2 - 15 files changed, 220 insertions(+), 91 deletions(-) delete mode 100644 runcardsrunner/cuts_code/atlas_2jet_7tev_r06.f create mode 100644 runcardsrunner/cuts_code/atlas_2jet_7tev_r06_0005.f create mode 100644 runcardsrunner/cuts_code/atlas_2jet_7tev_r06_0510.f create mode 100644 runcardsrunner/cuts_code/atlas_2jet_7tev_r06_1015.f create mode 100644 runcardsrunner/cuts_code/atlas_2jet_7tev_r06_1520.f create mode 100644 runcardsrunner/cuts_code/atlas_2jet_7tev_r06_2025.f create mode 100644 runcardsrunner/cuts_code/atlas_2jet_7tev_r06_2530.f delete mode 100644 runcardsrunner/cuts_code/cms_2jets_7tev.f create mode 100644 runcardsrunner/cuts_code/cms_2jets_7tev_0005.f create mode 100644 runcardsrunner/cuts_code/cms_2jets_7tev_0510.f create mode 100644 runcardsrunner/cuts_code/cms_2jets_7tev_1015.f create mode 100644 runcardsrunner/cuts_code/cms_2jets_7tev_1520.f create mode 100644 runcardsrunner/cuts_code/cms_2jets_7tev_2025.f delete mode 100644 runcardsrunner/cuts_variables/atlas_2jet_7tev_r06.f delete mode 100644 runcardsrunner/cuts_variables/cms_2jets_7tev.f diff --git a/runcardsrunner/cuts_code/atlas_2jet_7tev_r06.f b/runcardsrunner/cuts_code/atlas_2jet_7tev_r06.f deleted file mode 100644 index aad5fde0..00000000 --- a/runcardsrunner/cuts_code/atlas_2jet_7tev_r06.f +++ /dev/null @@ -1,46 +0,0 @@ -c - if ({}) then - if (njet.lt.2) then - passcuts_user=.false. - return - endif - - xystar = 0.5d0 * dabs(atanh(pjet(3,1)/pjet(0,1))- - $ atanh(pjet(3,2)/pjet(0,2))) - xmjj = sqrt(invm2_04(pjet(0,1),pjet(0,2),1d0)) - - if (xystar.lt.0.5d0) then - if (xmjj.lt.260d0 .or. xmjj.gt.4270d0) then - passcuts_user=.false. - return - endif - else if (xystar.lt.1.0d0) then - if (xmjj.lt.310d0 .or. xmjj.gt.4270d0) then - passcuts_user=.false. - return - endif - else if (xystar.lt.1.5d0) then - if (xmjj.lt.510d0 .or. xmjj.gt.4640d0) then - passcuts_user=.false. - return - endif - else if (xystar.lt.2.0d0) then - if (xmjj.lt.760d0 .or. xmjj.gt.4640d0) then - passcuts_user=.false. - return - endif - else if (xystar.lt.2.5d0) then - if (xmjj.lt.1310d0 .or. xmjj.gt.5040d0) then - passcuts_user=.false. - return - endif - else if (xystar.lt.3.0d0) then - if (xmjj.lt.2120d0 .or. xmjj.gt.5040d0) then - passcuts_user=.false. - return - endif - else - passcuts_user=.false. - return - endif - endif diff --git a/runcardsrunner/cuts_code/atlas_2jet_7tev_r06_0005.f b/runcardsrunner/cuts_code/atlas_2jet_7tev_r06_0005.f new file mode 100644 index 00000000..11d5ddb2 --- /dev/null +++ b/runcardsrunner/cuts_code/atlas_2jet_7tev_r06_0005.f @@ -0,0 +1,20 @@ +c + if ({}) then + if (njet < 2) then + passcuts_user=.false. + return + endif + + block + real*8 xystar, xmjj + + xystar = 0.5d0 * abs(atanh(pjet(3,1)/pjet(0,1))- + $ atanh(pjet(3,2)/pjet(0,2))) + xmjj = sqrt(invm2_04(pjet(0,1),pjet(0,2),1d0)) + + if (xystar > 0.5d0 .or. xmjj < 260d0 .or. xmjj > 4270d0) then + passcuts_user=.false. + return + endif + end block + endif diff --git a/runcardsrunner/cuts_code/atlas_2jet_7tev_r06_0510.f b/runcardsrunner/cuts_code/atlas_2jet_7tev_r06_0510.f new file mode 100644 index 00000000..605960db --- /dev/null +++ b/runcardsrunner/cuts_code/atlas_2jet_7tev_r06_0510.f @@ -0,0 +1,20 @@ +c + if ({}) then + if (njet < 2) then + passcuts_user=.false. + return + endif + + block + real*8 xystar, xmjj + + xystar = 0.5d0 * abs(atanh(pjet(3,1)/pjet(0,1))- + $ atanh(pjet(3,2)/pjet(0,2))) + xmjj = sqrt(invm2_04(pjet(0,1),pjet(0,2),1d0)) + + if (xystar < 0.5d0 .or. xystar > 1.0d0 .or. xmjj < 310d0 .or. xmjj > 4270d0) then + passcuts_user=.false. + return + endif + end block + endif diff --git a/runcardsrunner/cuts_code/atlas_2jet_7tev_r06_1015.f b/runcardsrunner/cuts_code/atlas_2jet_7tev_r06_1015.f new file mode 100644 index 00000000..12b930c1 --- /dev/null +++ b/runcardsrunner/cuts_code/atlas_2jet_7tev_r06_1015.f @@ -0,0 +1,20 @@ +c + if ({}) then + if (njet < 2) then + passcuts_user=.false. + return + endif + + block + real*8 xystar, xmjj + + xystar = 0.5d0 * abs(atanh(pjet(3,1)/pjet(0,1))- + $ atanh(pjet(3,2)/pjet(0,2))) + xmjj = sqrt(invm2_04(pjet(0,1),pjet(0,2),1d0)) + + if (xystar < 1.0d0 .or. xystar > 1.5d0 .or. xmjj < 510d0 .or. xmjj > 4640d0) then + passcuts_user=.false. + return + endif + end block + endif diff --git a/runcardsrunner/cuts_code/atlas_2jet_7tev_r06_1520.f b/runcardsrunner/cuts_code/atlas_2jet_7tev_r06_1520.f new file mode 100644 index 00000000..2599dbed --- /dev/null +++ b/runcardsrunner/cuts_code/atlas_2jet_7tev_r06_1520.f @@ -0,0 +1,20 @@ +c + if ({}) then + if (njet < 2) then + passcuts_user=.false. + return + endif + + block + real*8 xystar, xmjj + + xystar = 0.5d0 * abs(atanh(pjet(3,1)/pjet(0,1))- + $ atanh(pjet(3,2)/pjet(0,2))) + xmjj = sqrt(invm2_04(pjet(0,1),pjet(0,2),1d0)) + + if (xystar < 1.5d0 .or. xystar > 2.0d0 .or. xmjj < 760d0 .or. xmjj > 4640d0) then + passcuts_user=.false. + return + endif + end block + endif diff --git a/runcardsrunner/cuts_code/atlas_2jet_7tev_r06_2025.f b/runcardsrunner/cuts_code/atlas_2jet_7tev_r06_2025.f new file mode 100644 index 00000000..3b51907d --- /dev/null +++ b/runcardsrunner/cuts_code/atlas_2jet_7tev_r06_2025.f @@ -0,0 +1,20 @@ +c + if ({}) then + if (njet < 2) then + passcuts_user=.false. + return + endif + + block + real*8 xystar, xmjj + + xystar = 0.5d0 * abs(atanh(pjet(3,1)/pjet(0,1))- + $ atanh(pjet(3,2)/pjet(0,2))) + xmjj = sqrt(invm2_04(pjet(0,1),pjet(0,2),1d0)) + + if (xystar < 2.0d0 .or. xystar > 2.5d0 .or. xmjj < 1310d0 .or. xmjj > 5040d0) then + passcuts_user=.false. + return + endif + end block + endif diff --git a/runcardsrunner/cuts_code/atlas_2jet_7tev_r06_2530.f b/runcardsrunner/cuts_code/atlas_2jet_7tev_r06_2530.f new file mode 100644 index 00000000..5260f400 --- /dev/null +++ b/runcardsrunner/cuts_code/atlas_2jet_7tev_r06_2530.f @@ -0,0 +1,20 @@ +c + if ({}) then + if (njet < 2) then + passcuts_user=.false. + return + endif + + block + real*8 xystar, xmjj + + xystar = 0.5d0 * abs(atanh(pjet(3,1)/pjet(0,1))- + $ atanh(pjet(3,2)/pjet(0,2))) + xmjj = sqrt(invm2_04(pjet(0,1),pjet(0,2),1d0)) + + if (xystar < 2.5d0 .or. xystar > 3.0d0 .or. xmjj < 2120d0 .or. xmjj > 5040d0) then + passcuts_user=.false. + return + endif + end block + endif diff --git a/runcardsrunner/cuts_code/cms_2jets_7tev.f b/runcardsrunner/cuts_code/cms_2jets_7tev.f deleted file mode 100644 index 4e3052f5..00000000 --- a/runcardsrunner/cuts_code/cms_2jets_7tev.f +++ /dev/null @@ -1,41 +0,0 @@ -c - if ({}) then - if (njet.lt.2) then - passcuts_user=.false. - return - endif - - xymax = max(dabs(atanh(pjet(3,1)/pjet(0,1))), - $ dabs(atanh(pjet(3,2)/pjet(0,2)))) - xmjj = sqrt(invm2_04(pjet(0,1),pjet(0,2),1d0)) - - if (xymax.lt.0.5d0) then - if (xmjj.lt.197d0 .or. xmjj.gt.4010d0) then - passcuts_user=.false. - return - endif - else if (xymax.lt.1.0d0) then - if (xmjj.lt.270d0 .or. xmjj.gt.4010d0) then - passcuts_user=.false. - return - endif - else if (xymax.lt.1.5d0) then - if (xmjj.lt.419d0 .or. xmjj.gt.4509d0) then - passcuts_user=.false. - return - endif - else if (xymax.lt.2.0d0) then - if (xmjj.lt.565d0 .or. xmjj.gt.5058d0) then - passcuts_user=.false. - return - endif - else if (xymax.lt.2.5d0) then - if (xmjj.lt.1000d0 .or. xmjj.gt.5058d0) then - passcuts_user=.false. - return - endif - else - passcuts_user=.false. - return - endif - endif diff --git a/runcardsrunner/cuts_code/cms_2jets_7tev_0005.f b/runcardsrunner/cuts_code/cms_2jets_7tev_0005.f new file mode 100644 index 00000000..c49bed70 --- /dev/null +++ b/runcardsrunner/cuts_code/cms_2jets_7tev_0005.f @@ -0,0 +1,20 @@ +c + if ({}) then + block + real*8 xymax, xmjj + + if (njet < 2) then + passcuts_user = .false. + return + end if + + xymax = max(abs(atanh(pjet(3,1)/pjet(0,1))), + $ abs(atanh(pjet(3,2)/pjet(0,2)))) + xmjj = sqrt(invm2_04(pjet(0,1),pjet(0,2),1d0)) + + if (xymax > 0.5d0 .or. xmjj < 197d0 .or. xmjj > 4010d0) then + passcuts_user=.false. + return + end if + end block + end if diff --git a/runcardsrunner/cuts_code/cms_2jets_7tev_0510.f b/runcardsrunner/cuts_code/cms_2jets_7tev_0510.f new file mode 100644 index 00000000..62ec1984 --- /dev/null +++ b/runcardsrunner/cuts_code/cms_2jets_7tev_0510.f @@ -0,0 +1,20 @@ +c + if ({}) then + block + real*8 xymax, xmjj + + if (njet < 2) then + passcuts_user = .false. + return + end if + + xymax = max(abs(atanh(pjet(3,1)/pjet(0,1))), + $ abs(atanh(pjet(3,2)/pjet(0,2)))) + xmjj = sqrt(invm2_04(pjet(0,1),pjet(0,2),1d0)) + + if (xymax < 0.5d0 .or. xymax > 1.0d0 .or. xmjj < 270d0 .or. xmjj > 4010d0) then + passcuts_user=.false. + return + end if + end block + end if diff --git a/runcardsrunner/cuts_code/cms_2jets_7tev_1015.f b/runcardsrunner/cuts_code/cms_2jets_7tev_1015.f new file mode 100644 index 00000000..e6705500 --- /dev/null +++ b/runcardsrunner/cuts_code/cms_2jets_7tev_1015.f @@ -0,0 +1,20 @@ +c + if ({}) then + block + real*8 xymax, xmjj + + if (njet < 2) then + passcuts_user = .false. + return + end if + + xymax = max(abs(atanh(pjet(3,1)/pjet(0,1))), + $ abs(atanh(pjet(3,2)/pjet(0,2)))) + xmjj = sqrt(invm2_04(pjet(0,1),pjet(0,2),1d0)) + + if (xymax < 1.0d0 .or. xymax > 1.5d0 .or. xmjj < 419d0 .or. xmjj > 4509d0) then + passcuts_user=.false. + return + end if + end block + end if diff --git a/runcardsrunner/cuts_code/cms_2jets_7tev_1520.f b/runcardsrunner/cuts_code/cms_2jets_7tev_1520.f new file mode 100644 index 00000000..4121825f --- /dev/null +++ b/runcardsrunner/cuts_code/cms_2jets_7tev_1520.f @@ -0,0 +1,20 @@ +c + if ({}) then + block + real*8 xymax, xmjj + + if (njet < 2) then + passcuts_user = .false. + return + end if + + xymax = max(abs(atanh(pjet(3,1)/pjet(0,1))), + $ abs(atanh(pjet(3,2)/pjet(0,2)))) + xmjj = sqrt(invm2_04(pjet(0,1),pjet(0,2),1d0)) + + if (xymax < 1.5d0 .or. xymax > 2.0d0 .or. xmjj < 565d0 .or. xmjj > 5058d0) then + passcuts_user=.false. + return + end if + end block + end if diff --git a/runcardsrunner/cuts_code/cms_2jets_7tev_2025.f b/runcardsrunner/cuts_code/cms_2jets_7tev_2025.f new file mode 100644 index 00000000..db77b7c1 --- /dev/null +++ b/runcardsrunner/cuts_code/cms_2jets_7tev_2025.f @@ -0,0 +1,20 @@ +c + if ({}) then + block + real*8 xymax, xmjj + + if (njet < 2) then + passcuts_user = .false. + return + end if + + xymax = max(abs(atanh(pjet(3,1)/pjet(0,1))), + $ abs(atanh(pjet(3,2)/pjet(0,2)))) + xmjj = sqrt(invm2_04(pjet(0,1),pjet(0,2),1d0)) + + if (xymax < 2.0d0 .or. xymax > 2.5d0 .or. xmjj < 1000d0 .or. xmjj > 5058d0) then + passcuts_user=.false. + return + end if + end block + end if diff --git a/runcardsrunner/cuts_variables/atlas_2jet_7tev_r06.f b/runcardsrunner/cuts_variables/atlas_2jet_7tev_r06.f deleted file mode 100644 index 1a08f4de..00000000 --- a/runcardsrunner/cuts_variables/atlas_2jet_7tev_r06.f +++ /dev/null @@ -1,2 +0,0 @@ -c - real*8 xystar,xmjj diff --git a/runcardsrunner/cuts_variables/cms_2jets_7tev.f b/runcardsrunner/cuts_variables/cms_2jets_7tev.f deleted file mode 100644 index f69c5731..00000000 --- a/runcardsrunner/cuts_variables/cms_2jets_7tev.f +++ /dev/null @@ -1,2 +0,0 @@ -c variables for cms_2jets_7tev cuts - real*8 xymax,xmjj From 58f7e81f02c485e8399cd3a7975600b57d7e10e8 Mon Sep 17 00:00:00 2001 From: Felix Hekhorn Date: Fri, 1 Oct 2021 11:40:50 +0200 Subject: [PATCH 34/63] Apply some small fixes --- pyproject.toml | 2 +- rr | 1 + run/run.py | 4 +++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index c6c10a47..0710da86 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,7 +1,7 @@ [tool.poetry] name = "run" version = "0.0.0" -description = "generate runcards" +description = "Generate runcards for producing PineAPPL grids." authors = ["Alessandro Candido "] [tool.poetry.dependencies] diff --git a/rr b/rr index dd8ce960..a0f23622 100755 --- a/rr +++ b/rr @@ -70,6 +70,7 @@ if __name__ == "__main__": if sys.argv[1] != "install": subprocess.run("poetry run rr".split() + sys.argv[1:]) else: + sys.argv = [sys.argv[0]] + sys.argv[2:] args = parse_args() question = load_options(args.yes, args.no, args.default) diff --git a/run/run.py b/run/run.py index 5a196516..06af0d74 100644 --- a/run/run.py +++ b/run/run.py @@ -45,9 +45,11 @@ def run_dataset(runner, name, pdf): tools.print_time(t0, "Grid calculation") runner.run() + # we need results first because this may install the PDF set + results = runner.results() table.print_table( table.parse_pineappl_table(runner.generate_pineappl()), - runner.results(), + results, runner.dest, ) From 7a4a5b57baedbab914ae9646902046b7079b0461 Mon Sep 17 00:00:00 2001 From: Alessandro Candido Date: Fri, 1 Oct 2021 11:58:23 +0200 Subject: [PATCH 35/63] More intuitive installation of lhapdf --- runcardsrunner/external/yad.py | 2 -- runcardsrunner/run.py | 6 +++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/runcardsrunner/external/yad.py b/runcardsrunner/external/yad.py index 167bc11d..f2a37e0c 100644 --- a/runcardsrunner/external/yad.py +++ b/runcardsrunner/external/yad.py @@ -1,7 +1,6 @@ from functools import reduce import lhapdf -import lhapdf_management import pandas as pd import yadism import yaml @@ -37,7 +36,6 @@ def run(self): ) def results(self): - lhapdf_management.pdf_install(self.pdf) pdf = lhapdf.mkPDF(self.pdf) pdf_out = self.out.apply_pdf_alphas_alphaqed_xir_xif( pdf, diff --git a/runcardsrunner/run.py b/runcardsrunner/run.py index 0255adb5..f57c0235 100644 --- a/runcardsrunner/run.py +++ b/runcardsrunner/run.py @@ -2,6 +2,7 @@ import time import click +import lhapdf_management import rich from . import install, table, tools @@ -26,6 +27,7 @@ def run(dataset, pdf): runner = mg5.Mg5(dataset, pdf) install_reqs(runner) + lhapdf_management.pdf_install(pdf) run_dataset(runner, dataset, pdf) @@ -45,11 +47,9 @@ def run_dataset(runner, name, pdf): tools.print_time(t0, "Grid calculation") runner.run() - # we need results first because this may install the PDF set - results = runner.results() table.print_table( table.parse_pineappl_table(runner.generate_pineappl()), - results, + runner.results(), runner.dest, ) From 98fa6169446a052f37126a00f0ebaade6af43d15 Mon Sep 17 00:00:00 2001 From: Felix Hekhorn Date: Fri, 1 Oct 2021 12:06:57 +0200 Subject: [PATCH 36/63] Init sphinx --- doc/Makefile | 35 ++ doc/make.bat | 35 ++ doc/source/_static/.gitkeep | 0 doc/source/conf.py | 148 +++++++ doc/source/index.rst | 10 + doc/source/indices.rst | 6 + .../runcardsrunner.external.rst | 34 ++ .../modules/runcardsrunner/runcardsrunner.rst | 58 +++ doc/source/refs.bib | 0 doc/source/shared/roles.rst | 77 ++++ poetry.lock | 365 +++++++++++++++++- pyproject.toml | 3 + 12 files changed, 770 insertions(+), 1 deletion(-) create mode 100644 doc/Makefile create mode 100644 doc/make.bat create mode 100644 doc/source/_static/.gitkeep create mode 100644 doc/source/conf.py create mode 100644 doc/source/index.rst create mode 100644 doc/source/indices.rst create mode 100644 doc/source/modules/runcardsrunner/runcardsrunner.external.rst create mode 100644 doc/source/modules/runcardsrunner/runcardsrunner.rst create mode 100644 doc/source/refs.bib create mode 100644 doc/source/shared/roles.rst diff --git a/doc/Makefile b/doc/Makefile new file mode 100644 index 00000000..78fdd421 --- /dev/null +++ b/doc/Makefile @@ -0,0 +1,35 @@ +# Minimal makefile for Sphinx documentation +# + +# You can set these variables from the command line, and also +# from the environment for the first two. +SPHINXOPTS ?= +SPHINXBUILD ?= sphinx-build +SOURCEDIR = source +BUILDDIR = build + +RROUT = $(SOURCEDIR)/modules + +# Put it first so that "make" without argument is like "make help". +help: + @$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) + +view: + $(BROWSER) $(BUILDDIR)/html/index.html + +server: + python3 -m http.server 8000 --bind 127.0.0.1 --directory build/html + +clean: + rm -rf build + rm -rf _build + +cleanall: clean + rm -rf $(RROUT) + +.PHONY: help Makefile + +# Catch-all target: route all unknown targets to Sphinx using the new +# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). +%: Makefile + @$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) diff --git a/doc/make.bat b/doc/make.bat new file mode 100644 index 00000000..6247f7e2 --- /dev/null +++ b/doc/make.bat @@ -0,0 +1,35 @@ +@ECHO OFF + +pushd %~dp0 + +REM Command file for Sphinx documentation + +if "%SPHINXBUILD%" == "" ( + set SPHINXBUILD=sphinx-build +) +set SOURCEDIR=source +set BUILDDIR=build + +if "%1" == "" goto help + +%SPHINXBUILD% >NUL 2>NUL +if errorlevel 9009 ( + echo. + echo.The 'sphinx-build' command was not found. Make sure you have Sphinx + echo.installed, then set the SPHINXBUILD environment variable to point + echo.to the full path of the 'sphinx-build' executable. Alternatively you + echo.may add the Sphinx directory to PATH. + echo. + echo.If you don't have Sphinx installed, grab it from + echo.http://sphinx-doc.org/ + exit /b 1 +) + +%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% +goto end + +:help +%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% + +:end +popd diff --git a/doc/source/_static/.gitkeep b/doc/source/_static/.gitkeep new file mode 100644 index 00000000..e69de29b diff --git a/doc/source/conf.py b/doc/source/conf.py new file mode 100644 index 00000000..a127ce61 --- /dev/null +++ b/doc/source/conf.py @@ -0,0 +1,148 @@ +# Configuration file for the Sphinx documentation builder. +# +# This file only contains a selection of the most common options. For a full +# list see the documentation: +# https://www.sphinx-doc.org/en/master/usage/configuration.html + +# -- Path setup -------------------------------------------------------------- + +# If extensions (or modules to document with autodoc) are in another directory, +# add these directories to sys.path here. If the directory is relative to the +# documentation root, use os.path.abspath to make it absolute, like shown here. +# +# import os +# import sys +# sys.path.insert(0, os.path.abspath('.')) + +import os +import pathlib +import sys + +here = pathlib.Path(__file__).absolute().parent + +# -- Project information ----------------------------------------------------- + +project = "runcardsrunner" +copyright = "2021, the runcardsrunner team" +author = "the runcardsrunner team" + + +# -- General configuration --------------------------------------------------- + +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom +# ones. +extensions = [ + "sphinx.ext.autodoc", + "sphinx.ext.doctest", + "sphinx.ext.intersphinx", + "sphinx.ext.todo", + "sphinx.ext.coverage", + "sphinx.ext.mathjax", + "sphinx.ext.ifconfig", + "sphinx.ext.viewcode", + "sphinx.ext.autosectionlabel", + "sphinx.ext.napoleon", + "sphinxcontrib.bibtex", + "sphinx.ext.graphviz", + "sphinx.ext.extlinks", +] + +# Add any paths that contain templates here, relative to this directory. +templates_path = ["_templates"] + +# The suffix(es) of source filenames. +# You can specify multiple suffix as a list of string: +# +source_suffix = { + ".rst": "restructuredtext", + ".txt": "restructuredtext", +} + +autosectionlabel_prefix_document = True +# autosectionlabel_maxdepth = 10 +# Allow to embed rst syntax in markdown files. +enable_eval_rst = True + +# The master toctree document. +master_doc = "index" +bibtex_bibfiles = ["refs.bib"] + +# The language for content autogenerated by Sphinx. Refer to documentation +# for a list of supported languages. +# +# This is also used if you do content translation via gettext catalogs. +# Usually you set "language" from the command line for these cases. +language = None + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +# This pattern also affects html_static_path and html_extra_path. +exclude_patterns = ["shared/*"] + +# The name of the Pygments (syntax highlighting) style to use. +pygments_style = None + +# A string to be included at the beginning of all files +shared = here / "shared" +rst_prolog = "\n".join([open(x).read() for x in os.scandir(shared)]) + +extlinks = { + # "yadism": ("https://n3pdf.github.io/yadism/%s", "yadism"), + # "rustdoc": ("https://docs.rs/pineappl/latest/pineappl/%s", "pineappl"), + # "pineko": ("https://github.com/N3PDF/pineko/%s", "pineko"), +} + +# -- Options for HTML output ------------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +# +html_theme = "sphinx_rtd_theme" + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +html_static_path = ["_static"] + +# -- Extension configuration ------------------------------------------------- + +# -- Options for intersphinx extension --------------------------------------- + +# Example configuration for intersphinx: refer to the Python standard library. +# Thanks https://github.com/bskinn/sphobjinv +intersphinx_mapping = { + "python": ("https://docs.python.org/3/", None), + "scipy": ("https://docs.scipy.org/doc/scipy/reference", None), + "numpy": ("https://numpy.org/doc/stable", None), +} +# -- Options for todo extension ---------------------------------------------- + +# If true, `todo` and `todoList` produce output, else they produce nothing. +todo_include_todos = True + +mathjax3_config = { + "tex": { + "macros": { + # fncs + # "atan": [r"\text{atan}", 0], + # "span": [r"\text{span}", 0], + } + } +} + +# https://github.com/readthedocs/readthedocs.org/issues/1139#issuecomment-312626491 +def run_apidoc(_): + from sphinx.ext.apidoc import main # pylint: disable=import-outside-toplevel + + sys.path.append(str(here.parent)) + + # analyse 'pineappl' + docs_dest = here / "modules" / "runcardsrunner" + package = here.parents[1] / "runcardsrunner" + main(["--module-first", "-o", str(docs_dest), str(package)]) + (docs_dest / "modules.rst").unlink() + + +def setup(app): + app.connect("builder-inited", run_apidoc) diff --git a/doc/source/index.rst b/doc/source/index.rst new file mode 100644 index 00000000..bafd4e11 --- /dev/null +++ b/doc/source/index.rst @@ -0,0 +1,10 @@ +Welcome to runcardsrunner's documentation! +========================================== + +.. toctree:: + :maxdepth: 1 + :hidden: + :caption: Contents: + + API + indices diff --git a/doc/source/indices.rst b/doc/source/indices.rst new file mode 100644 index 00000000..d46b839f --- /dev/null +++ b/doc/source/indices.rst @@ -0,0 +1,6 @@ +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` diff --git a/doc/source/modules/runcardsrunner/runcardsrunner.external.rst b/doc/source/modules/runcardsrunner/runcardsrunner.external.rst new file mode 100644 index 00000000..df8a681d --- /dev/null +++ b/doc/source/modules/runcardsrunner/runcardsrunner.external.rst @@ -0,0 +1,34 @@ +runcardsrunner.external package +=============================== + +.. automodule:: runcardsrunner.external + :members: + :undoc-members: + :show-inheritance: + +Submodules +---------- + +runcardsrunner.external.interface module +---------------------------------------- + +.. automodule:: runcardsrunner.external.interface + :members: + :undoc-members: + :show-inheritance: + +runcardsrunner.external.mg5 module +---------------------------------- + +.. automodule:: runcardsrunner.external.mg5 + :members: + :undoc-members: + :show-inheritance: + +runcardsrunner.external.yad module +---------------------------------- + +.. automodule:: runcardsrunner.external.yad + :members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/modules/runcardsrunner/runcardsrunner.rst b/doc/source/modules/runcardsrunner/runcardsrunner.rst new file mode 100644 index 00000000..c090ff14 --- /dev/null +++ b/doc/source/modules/runcardsrunner/runcardsrunner.rst @@ -0,0 +1,58 @@ +runcardsrunner package +====================== + +.. automodule:: runcardsrunner + :members: + :undoc-members: + :show-inheritance: + +Subpackages +----------- + +.. toctree:: + :maxdepth: 4 + + runcardsrunner.external + +Submodules +---------- + +runcardsrunner.install module +----------------------------- + +.. automodule:: runcardsrunner.install + :members: + :undoc-members: + :show-inheritance: + +runcardsrunner.paths module +--------------------------- + +.. automodule:: runcardsrunner.paths + :members: + :undoc-members: + :show-inheritance: + +runcardsrunner.run module +------------------------- + +.. automodule:: runcardsrunner.run + :members: + :undoc-members: + :show-inheritance: + +runcardsrunner.table module +--------------------------- + +.. automodule:: runcardsrunner.table + :members: + :undoc-members: + :show-inheritance: + +runcardsrunner.tools module +--------------------------- + +.. automodule:: runcardsrunner.tools + :members: + :undoc-members: + :show-inheritance: diff --git a/doc/source/refs.bib b/doc/source/refs.bib new file mode 100644 index 00000000..e69de29b diff --git a/doc/source/shared/roles.rst b/doc/source/shared/roles.rst new file mode 100644 index 00000000..408d3cca --- /dev/null +++ b/doc/source/shared/roles.rst @@ -0,0 +1,77 @@ +:orphan: + +.. define custom roles and other site-wide stuffs + + +.. ---- + code + ---- + +.. role:: py(code) + :language: python + +.. role:: bash(code) + :language: bash + + +.. ---------- + references + ---------- + +.. .. role-- eq + +.. ---------- + custom css + ---------- + +.. raw:: html + + + +.. role:: underlined + :class: underlined + +.. role:: red + :class: red + +.. role:: green + :class: green + +.. role:: blue + :class: blue + +.. role:: purple + :class: purple + +.. :underlined:`test` + + +.. raw:: html + + + +.. role:: eqref + :class: eqref diff --git a/poetry.lock b/poetry.lock index 29f261a3..9958dccc 100644 --- a/poetry.lock +++ b/poetry.lock @@ -6,6 +6,14 @@ category = "main" optional = false python-versions = "*" +[[package]] +name = "alabaster" +version = "0.7.12" +description = "A configurable sidebar-enabled Sphinx theme" +category = "dev" +optional = false +python-versions = "*" + [[package]] name = "appnope" version = "0.1.2" @@ -36,6 +44,17 @@ docs = ["furo", "sphinx", "zope.interface", "sphinx-notfound-page"] tests = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "mypy", "pytest-mypy-plugins", "zope.interface"] tests_no_zope = ["coverage[toml] (>=5.0.2)", "hypothesis", "pympler", "pytest (>=4.3.0)", "six", "mypy", "pytest-mypy-plugins"] +[[package]] +name = "babel" +version = "2.9.1" +description = "Internationalization utilities" +category = "dev" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" + +[package.dependencies] +pytz = ">=2015.7" + [[package]] name = "backcall" version = "0.2.0" @@ -170,6 +189,14 @@ category = "dev" optional = false python-versions = ">=3.5" +[[package]] +name = "docutils" +version = "0.17.1" +description = "Docutils -- Python Documentation Utilities" +category = "dev" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*" + [[package]] name = "dulwich" version = "0.20.25" @@ -222,6 +249,14 @@ category = "main" optional = false python-versions = ">=3.5" +[[package]] +name = "imagesize" +version = "1.2.0" +description = "Getting image size from png/jpeg/jpeg2000/gif file" +category = "dev" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" + [[package]] name = "importlib-metadata" version = "4.8.1" @@ -311,6 +346,31 @@ parso = ">=0.8.0,<0.9.0" qa = ["flake8 (==3.8.3)", "mypy (==0.782)"] testing = ["Django (<3.1)", "colorama", "docopt", "pytest (<6.0.0)"] +[[package]] +name = "jinja2" +version = "3.0.1" +description = "A very fast and expressive template engine." +category = "dev" +optional = false +python-versions = ">=3.6" + +[package.dependencies] +MarkupSafe = ">=2.0" + +[package.extras] +i18n = ["Babel (>=2.7)"] + +[[package]] +name = "latexcodec" +version = "2.0.1" +description = "A lexer and codec to work with LaTeX code in Python." +category = "dev" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" + +[package.dependencies] +six = ">=1.4.1" + [[package]] name = "lhapdf-management" version = "0.1rc1" @@ -344,6 +404,14 @@ docs = ["sphinx (>=1.6.0)", "sphinx-bootstrap-theme"] flake8 = ["flake8"] tests = ["pytest (!=3.3.0)", "psutil", "pytest-cov"] +[[package]] +name = "markupsafe" +version = "2.0.1" +description = "Safely add untrusted strings to HTML/XML markup." +category = "dev" +optional = false +python-versions = ">=3.6" + [[package]] name = "matplotlib-inline" version = "0.1.3" @@ -554,6 +622,34 @@ category = "dev" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" +[[package]] +name = "pybtex" +version = "0.24.0" +description = "A BibTeX-compatible bibliography processor in Python" +category = "dev" +optional = false +python-versions = ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*" + +[package.dependencies] +latexcodec = ">=1.0.4" +PyYAML = ">=3.01" +six = "*" + +[package.extras] +test = ["pytest"] + +[[package]] +name = "pybtex-docutils" +version = "1.0.1" +description = "A docutils backend for pybtex." +category = "dev" +optional = false +python-versions = ">=3.6" + +[package.dependencies] +docutils = ">=0.8" +pybtex = ">=0.16" + [[package]] name = "pycparser" version = "2.20" @@ -717,6 +813,145 @@ category = "main" optional = false python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*" +[[package]] +name = "snowballstemmer" +version = "2.1.0" +description = "This package provides 29 stemmers for 28 languages generated from Snowball algorithms." +category = "dev" +optional = false +python-versions = "*" + +[[package]] +name = "sphinx" +version = "4.2.0" +description = "Python documentation generator" +category = "dev" +optional = false +python-versions = ">=3.6" + +[package.dependencies] +alabaster = ">=0.7,<0.8" +babel = ">=1.3" +colorama = {version = ">=0.3.5", markers = "sys_platform == \"win32\""} +docutils = ">=0.14,<0.18" +imagesize = "*" +Jinja2 = ">=2.3" +packaging = "*" +Pygments = ">=2.0" +requests = ">=2.5.0" +snowballstemmer = ">=1.1" +sphinxcontrib-applehelp = "*" +sphinxcontrib-devhelp = "*" +sphinxcontrib-htmlhelp = ">=2.0.0" +sphinxcontrib-jsmath = "*" +sphinxcontrib-qthelp = "*" +sphinxcontrib-serializinghtml = ">=1.1.5" + +[package.extras] +docs = ["sphinxcontrib-websupport"] +lint = ["flake8 (>=3.5.0)", "isort", "mypy (>=0.900)", "docutils-stubs", "types-typed-ast", "types-pkg-resources", "types-requests"] +test = ["pytest", "pytest-cov", "html5lib", "cython", "typed-ast"] + +[[package]] +name = "sphinx-rtd-theme" +version = "1.0.0" +description = "Read the Docs theme for Sphinx" +category = "dev" +optional = false +python-versions = ">=2.7,!=3.0.*,!=3.1.*,!=3.2.*,!=3.3.*" + +[package.dependencies] +docutils = "<0.18" +sphinx = ">=1.6" + +[package.extras] +dev = ["transifex-client", "sphinxcontrib-httpdomain", "bump2version"] + +[[package]] +name = "sphinxcontrib-applehelp" +version = "1.0.2" +description = "sphinxcontrib-applehelp is a sphinx extension which outputs Apple help books" +category = "dev" +optional = false +python-versions = ">=3.5" + +[package.extras] +lint = ["flake8", "mypy", "docutils-stubs"] +test = ["pytest"] + +[[package]] +name = "sphinxcontrib-bibtex" +version = "2.4.1" +description = "Sphinx extension for BibTeX style citations." +category = "dev" +optional = false +python-versions = ">=3.6" + +[package.dependencies] +docutils = ">=0.8" +pybtex = ">=0.20" +pybtex-docutils = ">=1.0.0" +Sphinx = ">=2.1" + +[[package]] +name = "sphinxcontrib-devhelp" +version = "1.0.2" +description = "sphinxcontrib-devhelp is a sphinx extension which outputs Devhelp document." +category = "dev" +optional = false +python-versions = ">=3.5" + +[package.extras] +lint = ["flake8", "mypy", "docutils-stubs"] +test = ["pytest"] + +[[package]] +name = "sphinxcontrib-htmlhelp" +version = "2.0.0" +description = "sphinxcontrib-htmlhelp is a sphinx extension which renders HTML help files" +category = "dev" +optional = false +python-versions = ">=3.6" + +[package.extras] +lint = ["flake8", "mypy", "docutils-stubs"] +test = ["pytest", "html5lib"] + +[[package]] +name = "sphinxcontrib-jsmath" +version = "1.0.1" +description = "A sphinx extension which renders display math in HTML via JavaScript" +category = "dev" +optional = false +python-versions = ">=3.5" + +[package.extras] +test = ["pytest", "flake8", "mypy"] + +[[package]] +name = "sphinxcontrib-qthelp" +version = "1.0.3" +description = "sphinxcontrib-qthelp is a sphinx extension which outputs QtHelp document." +category = "dev" +optional = false +python-versions = ">=3.5" + +[package.extras] +lint = ["flake8", "mypy", "docutils-stubs"] +test = ["pytest"] + +[[package]] +name = "sphinxcontrib-serializinghtml" +version = "1.1.5" +description = "sphinxcontrib-serializinghtml is a sphinx extension which outputs \"serialized\" HTML files (json and pickle)." +category = "dev" +optional = false +python-versions = ">=3.5" + +[package.extras] +lint = ["flake8", "mypy", "docutils-stubs"] +test = ["pytest"] + [[package]] name = "tomli" version = "1.2.1" @@ -828,7 +1063,7 @@ testing = ["pytest (>=4.6)", "pytest-checkdocs (>=2.4)", "pytest-flake8", "pytes [metadata] lock-version = "1.1" python-versions = ">=3.7.1,<3.10" -content-hash = "81b90183aa139ea2f84f02bc566b147c36d736c7da5f6bf79e95d64bf19fc630" +content-hash = "e2232d8b6e7f48d08980c6ec117d301de03e4814f902e2f6562604a893188274" [metadata.files] a3b2bbc3ced97675ac3a71df45f55ba = [ @@ -840,6 +1075,10 @@ a3b2bbc3ced97675ac3a71df45f55ba = [ {file = "a3b2bbc3ced97675ac3a71df45f55ba-6.4.0-pp37-pypy37_pp73-manylinux_2_17_x86_64.manylinux2014_x86_64.whl", hash = "sha256:0147a1d9dab10f8b23ef5fc97f570ce044e9f8409bfee2fbce551180fafcbb2e"}, {file = "a3b2bbc3ced97675ac3a71df45f55ba-6.4.0.tar.gz", hash = "sha256:1bd60035f9862db1130be035f631c2cfcf90d2ee0cfc6f33ce29fbf8a70b5a04"}, ] +alabaster = [ + {file = "alabaster-0.7.12-py2.py3-none-any.whl", hash = "sha256:446438bdcca0e05bd45ea2de1668c1d9b032e1a9154c2c259092d77031ddd359"}, + {file = "alabaster-0.7.12.tar.gz", hash = "sha256:a661d72d58e6ea8a57f7a86e37d86716863ee5e92788398526d58b26a4e4dc02"}, +] appnope = [ {file = "appnope-0.1.2-py2.py3-none-any.whl", hash = "sha256:93aa393e9d6c54c5cd570ccadd8edad61ea0c4b9ea7a01409020c9aa019eb442"}, {file = "appnope-0.1.2.tar.gz", hash = "sha256:dd83cd4b5b460958838f6eb3000c660b1f9caf2a5b1de4264e941512f603258a"}, @@ -852,6 +1091,10 @@ attrs = [ {file = "attrs-21.2.0-py2.py3-none-any.whl", hash = "sha256:149e90d6d8ac20db7a955ad60cf0e6881a3f20d37096140088356da6c716b0b1"}, {file = "attrs-21.2.0.tar.gz", hash = "sha256:ef6aaac3ca6cd92904cdd0d83f629a15f18053ec84e6432106f7a4d04ae4f5fb"}, ] +babel = [ + {file = "Babel-2.9.1-py2.py3-none-any.whl", hash = "sha256:ab49e12b91d937cd11f0b67cb259a57ab4ad2b59ac7a3b41d6c06c0ac5b0def9"}, + {file = "Babel-2.9.1.tar.gz", hash = "sha256:bc0c176f9f6a994582230df350aa6e05ba2ebe4b3ac317eab29d9be5d2768da0"}, +] backcall = [ {file = "backcall-0.2.0-py2.py3-none-any.whl", hash = "sha256:fbbce6a29f263178a1f7915c1940bde0ec2b2a967566fe1c65c1dfb7422bd255"}, {file = "backcall-0.2.0.tar.gz", hash = "sha256:5cbdbf27be5e7cfadb448baf0aa95508f91f2bbc6c6437cd9cd06e2a4c215e1e"}, @@ -937,6 +1180,10 @@ decorator = [ {file = "decorator-5.1.0-py3-none-any.whl", hash = "sha256:7b12e7c3c6ab203a29e157335e9122cb03de9ab7264b137594103fd4a683b374"}, {file = "decorator-5.1.0.tar.gz", hash = "sha256:e59913af105b9860aa2c8d3272d9de5a56a4e608db9a2f167a8480b323d529a7"}, ] +docutils = [ + {file = "docutils-0.17.1-py2.py3-none-any.whl", hash = "sha256:cf316c8370a737a022b72b56874f6602acf974a37a9fba42ec2876387549fc61"}, + {file = "docutils-0.17.1.tar.gz", hash = "sha256:686577d2e4c32380bb50cbb22f575ed742d58168cee37e99117a854bcd88f125"}, +] dulwich = [ {file = "dulwich-0.20.25-cp36-cp36m-macosx_10_14_x86_64.whl", hash = "sha256:da7655385e090b805c262df42f8b75a115345343951ca2497476df0a6287c20e"}, {file = "dulwich-0.20.25-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6fad76fca381ceb914d156eb25c0cc77132cff1156d035271203c521134472b6"}, @@ -968,6 +1215,10 @@ idna = [ {file = "idna-3.2-py3-none-any.whl", hash = "sha256:14475042e284991034cb48e06f6851428fb14c4dc953acd9be9a5e95c7b6dd7a"}, {file = "idna-3.2.tar.gz", hash = "sha256:467fbad99067910785144ce333826c71fb0e63a425657295239737f7ecd125f3"}, ] +imagesize = [ + {file = "imagesize-1.2.0-py2.py3-none-any.whl", hash = "sha256:6965f19a6a2039c7d48bca7dba2473069ff854c36ae6f19d2cde309d998228a1"}, + {file = "imagesize-1.2.0.tar.gz", hash = "sha256:b1f6b5a4eab1f73479a50fb79fcf729514a900c341d8503d62a62dbc4127a2b1"}, +] importlib-metadata = [ {file = "importlib_metadata-4.8.1-py3-none-any.whl", hash = "sha256:b618b6d2d5ffa2f16add5697cf57a46c76a56229b0ed1c438322e4e95645bd15"}, {file = "importlib_metadata-4.8.1.tar.gz", hash = "sha256:f284b3e11256ad1e5d03ab86bb2ccd6f5339688ff17a4d797a0fe7df326f23b1"}, @@ -988,6 +1239,14 @@ jedi = [ {file = "jedi-0.18.0-py2.py3-none-any.whl", hash = "sha256:18456d83f65f400ab0c2d3319e48520420ef43b23a086fdc05dff34132f0fb93"}, {file = "jedi-0.18.0.tar.gz", hash = "sha256:92550a404bad8afed881a137ec9a461fed49eca661414be45059329614ed0707"}, ] +jinja2 = [ + {file = "Jinja2-3.0.1-py3-none-any.whl", hash = "sha256:1f06f2da51e7b56b8f238affdd6b4e2c61e39598a378cc49345bc1bd42a978a4"}, + {file = "Jinja2-3.0.1.tar.gz", hash = "sha256:703f484b47a6af502e743c9122595cc812b0271f661722403114f71a79d0f5a4"}, +] +latexcodec = [ + {file = "latexcodec-2.0.1-py2.py3-none-any.whl", hash = "sha256:c277a193638dc7683c4c30f6684e3db728a06efb0dc9cf346db8bd0aa6c5d271"}, + {file = "latexcodec-2.0.1.tar.gz", hash = "sha256:2aa2551c373261cefe2ad3a8953a6d6533e68238d180eb4bb91d7964adb3fe9a"}, +] lhapdf-management = [ {file = "lhapdf_management-0.1rc1-1-py3-none-any.whl", hash = "sha256:271ab7002aba5b7089562eb6c6ff1d941d209099e3cecfcb0cde0c89e86a07aa"}, ] @@ -1047,6 +1306,62 @@ lz4 = [ {file = "lz4-3.1.3-cp39-cp39-win_amd64.whl", hash = "sha256:37c23ca41040751649e0266f9f267c0148db12968a0a031272ee2a99cef7c753"}, {file = "lz4-3.1.3.tar.gz", hash = "sha256:081ef0a3b5941cb03127f314229a1c78bd70c9c220bb3f4dd80033e707feaa18"}, ] +markupsafe = [ + {file = "MarkupSafe-2.0.1-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:d8446c54dc28c01e5a2dbac5a25f071f6653e6e40f3a8818e8b45d790fe6ef53"}, + {file = "MarkupSafe-2.0.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:36bc903cbb393720fad60fc28c10de6acf10dc6cc883f3e24ee4012371399a38"}, + {file = "MarkupSafe-2.0.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2d7d807855b419fc2ed3e631034685db6079889a1f01d5d9dac950f764da3dad"}, + {file = "MarkupSafe-2.0.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:add36cb2dbb8b736611303cd3bfcee00afd96471b09cda130da3581cbdc56a6d"}, + {file = "MarkupSafe-2.0.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:168cd0a3642de83558a5153c8bd34f175a9a6e7f6dc6384b9655d2697312a646"}, + {file = "MarkupSafe-2.0.1-cp310-cp310-win32.whl", hash = "sha256:99df47edb6bda1249d3e80fdabb1dab8c08ef3975f69aed437cb69d0a5de1e28"}, + {file = "MarkupSafe-2.0.1-cp310-cp310-win_amd64.whl", hash = "sha256:e0f138900af21926a02425cf736db95be9f4af72ba1bb21453432a07f6082134"}, + {file = "MarkupSafe-2.0.1-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:f9081981fe268bd86831e5c75f7de206ef275defcb82bc70740ae6dc507aee51"}, + {file = "MarkupSafe-2.0.1-cp36-cp36m-manylinux1_i686.whl", hash = "sha256:0955295dd5eec6cb6cc2fe1698f4c6d84af2e92de33fbcac4111913cd100a6ff"}, + {file = "MarkupSafe-2.0.1-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:0446679737af14f45767963a1a9ef7620189912317d095f2d9ffa183a4d25d2b"}, + {file = "MarkupSafe-2.0.1-cp36-cp36m-manylinux2010_i686.whl", hash = "sha256:f826e31d18b516f653fe296d967d700fddad5901ae07c622bb3705955e1faa94"}, + {file = "MarkupSafe-2.0.1-cp36-cp36m-manylinux2010_x86_64.whl", hash = "sha256:fa130dd50c57d53368c9d59395cb5526eda596d3ffe36666cd81a44d56e48872"}, + {file = "MarkupSafe-2.0.1-cp36-cp36m-manylinux2014_aarch64.whl", hash = "sha256:905fec760bd2fa1388bb5b489ee8ee5f7291d692638ea5f67982d968366bef9f"}, + {file = "MarkupSafe-2.0.1-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:bf5d821ffabf0ef3533c39c518f3357b171a1651c1ff6827325e4489b0e46c3c"}, + {file = "MarkupSafe-2.0.1-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:0d4b31cc67ab36e3392bbf3862cfbadac3db12bdd8b02a2731f509ed5b829724"}, + {file = "MarkupSafe-2.0.1-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:baa1a4e8f868845af802979fcdbf0bb11f94f1cb7ced4c4b8a351bb60d108145"}, + {file = "MarkupSafe-2.0.1-cp36-cp36m-win32.whl", hash = "sha256:6c4ca60fa24e85fe25b912b01e62cb969d69a23a5d5867682dd3e80b5b02581d"}, + {file = "MarkupSafe-2.0.1-cp36-cp36m-win_amd64.whl", hash = "sha256:b2f4bf27480f5e5e8ce285a8c8fd176c0b03e93dcc6646477d4630e83440c6a9"}, + {file = "MarkupSafe-2.0.1-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:0717a7390a68be14b8c793ba258e075c6f4ca819f15edfc2a3a027c823718567"}, + {file = "MarkupSafe-2.0.1-cp37-cp37m-manylinux1_i686.whl", hash = "sha256:6557b31b5e2c9ddf0de32a691f2312a32f77cd7681d8af66c2692efdbef84c18"}, + {file = "MarkupSafe-2.0.1-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:49e3ceeabbfb9d66c3aef5af3a60cc43b85c33df25ce03d0031a608b0a8b2e3f"}, + {file = "MarkupSafe-2.0.1-cp37-cp37m-manylinux2010_i686.whl", hash = "sha256:d7f9850398e85aba693bb640262d3611788b1f29a79f0c93c565694658f4071f"}, + {file = "MarkupSafe-2.0.1-cp37-cp37m-manylinux2010_x86_64.whl", hash = "sha256:6a7fae0dd14cf60ad5ff42baa2e95727c3d81ded453457771d02b7d2b3f9c0c2"}, + {file = "MarkupSafe-2.0.1-cp37-cp37m-manylinux2014_aarch64.whl", hash = "sha256:b7f2d075102dc8c794cbde1947378051c4e5180d52d276987b8d28a3bd58c17d"}, + {file = "MarkupSafe-2.0.1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e9936f0b261d4df76ad22f8fee3ae83b60d7c3e871292cd42f40b81b70afae85"}, + {file = "MarkupSafe-2.0.1-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:2a7d351cbd8cfeb19ca00de495e224dea7e7d919659c2841bbb7f420ad03e2d6"}, + {file = "MarkupSafe-2.0.1-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:60bf42e36abfaf9aff1f50f52644b336d4f0a3fd6d8a60ca0d054ac9f713a864"}, + {file = "MarkupSafe-2.0.1-cp37-cp37m-win32.whl", hash = "sha256:a30e67a65b53ea0a5e62fe23682cfe22712e01f453b95233b25502f7c61cb415"}, + {file = "MarkupSafe-2.0.1-cp37-cp37m-win_amd64.whl", hash = "sha256:611d1ad9a4288cf3e3c16014564df047fe08410e628f89805e475368bd304914"}, + {file = "MarkupSafe-2.0.1-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:5bb28c636d87e840583ee3adeb78172efc47c8b26127267f54a9c0ec251d41a9"}, + {file = "MarkupSafe-2.0.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:be98f628055368795d818ebf93da628541e10b75b41c559fdf36d104c5787066"}, + {file = "MarkupSafe-2.0.1-cp38-cp38-manylinux1_i686.whl", hash = "sha256:1d609f577dc6e1aa17d746f8bd3c31aa4d258f4070d61b2aa5c4166c1539de35"}, + {file = "MarkupSafe-2.0.1-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:7d91275b0245b1da4d4cfa07e0faedd5b0812efc15b702576d103293e252af1b"}, + {file = "MarkupSafe-2.0.1-cp38-cp38-manylinux2010_i686.whl", hash = "sha256:01a9b8ea66f1658938f65b93a85ebe8bc016e6769611be228d797c9d998dd298"}, + {file = "MarkupSafe-2.0.1-cp38-cp38-manylinux2010_x86_64.whl", hash = "sha256:47ab1e7b91c098ab893b828deafa1203de86d0bc6ab587b160f78fe6c4011f75"}, + {file = "MarkupSafe-2.0.1-cp38-cp38-manylinux2014_aarch64.whl", hash = "sha256:97383d78eb34da7e1fa37dd273c20ad4320929af65d156e35a5e2d89566d9dfb"}, + {file = "MarkupSafe-2.0.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6fcf051089389abe060c9cd7caa212c707e58153afa2c649f00346ce6d260f1b"}, + {file = "MarkupSafe-2.0.1-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:5855f8438a7d1d458206a2466bf82b0f104a3724bf96a1c781ab731e4201731a"}, + {file = "MarkupSafe-2.0.1-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:3dd007d54ee88b46be476e293f48c85048603f5f516008bee124ddd891398ed6"}, + {file = "MarkupSafe-2.0.1-cp38-cp38-win32.whl", hash = "sha256:023cb26ec21ece8dc3907c0e8320058b2e0cb3c55cf9564da612bc325bed5e64"}, + {file = "MarkupSafe-2.0.1-cp38-cp38-win_amd64.whl", hash = "sha256:984d76483eb32f1bcb536dc27e4ad56bba4baa70be32fa87152832cdd9db0833"}, + {file = "MarkupSafe-2.0.1-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:2ef54abee730b502252bcdf31b10dacb0a416229b72c18b19e24a4509f273d26"}, + {file = "MarkupSafe-2.0.1-cp39-cp39-macosx_10_9_x86_64.whl", hash = "sha256:3c112550557578c26af18a1ccc9e090bfe03832ae994343cfdacd287db6a6ae7"}, + {file = "MarkupSafe-2.0.1-cp39-cp39-manylinux1_i686.whl", hash = "sha256:53edb4da6925ad13c07b6d26c2a852bd81e364f95301c66e930ab2aef5b5ddd8"}, + {file = "MarkupSafe-2.0.1-cp39-cp39-manylinux1_x86_64.whl", hash = "sha256:f5653a225f31e113b152e56f154ccbe59eeb1c7487b39b9d9f9cdb58e6c79dc5"}, + {file = "MarkupSafe-2.0.1-cp39-cp39-manylinux2010_i686.whl", hash = "sha256:4efca8f86c54b22348a5467704e3fec767b2db12fc39c6d963168ab1d3fc9135"}, + {file = "MarkupSafe-2.0.1-cp39-cp39-manylinux2010_x86_64.whl", hash = "sha256:ab3ef638ace319fa26553db0624c4699e31a28bb2a835c5faca8f8acf6a5a902"}, + {file = "MarkupSafe-2.0.1-cp39-cp39-manylinux2014_aarch64.whl", hash = "sha256:f8ba0e8349a38d3001fae7eadded3f6606f0da5d748ee53cc1dab1d6527b9509"}, + {file = "MarkupSafe-2.0.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c47adbc92fc1bb2b3274c4b3a43ae0e4573d9fbff4f54cd484555edbf030baf1"}, + {file = "MarkupSafe-2.0.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:37205cac2a79194e3750b0af2a5720d95f786a55ce7df90c3af697bfa100eaac"}, + {file = "MarkupSafe-2.0.1-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:1f2ade76b9903f39aa442b4aadd2177decb66525062db244b35d71d0ee8599b6"}, + {file = "MarkupSafe-2.0.1-cp39-cp39-win32.whl", hash = "sha256:10f82115e21dc0dfec9ab5c0223652f7197feb168c940f3ef61563fc2d6beb74"}, + {file = "MarkupSafe-2.0.1-cp39-cp39-win_amd64.whl", hash = "sha256:693ce3f9e70a6cf7d2fb9e6c9d8b204b6b39897a2c4a1aa65728d5ac97dcc1d8"}, + {file = "MarkupSafe-2.0.1.tar.gz", hash = "sha256:594c67807fb16238b30c44bdf74f36c02cdf22d1c8cda91ef8a0ed8dabf5620a"}, +] matplotlib-inline = [ {file = "matplotlib-inline-0.1.3.tar.gz", hash = "sha256:a04bfba22e0d1395479f866853ec1ee28eea1485c1d69a6faf00dc3e24ff34ee"}, {file = "matplotlib_inline-0.1.3-py3-none-any.whl", hash = "sha256:aed605ba3b72462d64d475a21a9296f400a19c4f74a31b59103d2a99ffd5aa5c"}, @@ -1207,6 +1522,14 @@ py = [ {file = "py-1.10.0-py2.py3-none-any.whl", hash = "sha256:3b80836aa6d1feeaa108e046da6423ab8f6ceda6468545ae8d02d9d58d18818a"}, {file = "py-1.10.0.tar.gz", hash = "sha256:21b81bda15b66ef5e1a777a21c4dcd9c20ad3efd0b3f817e7a809035269e1bd3"}, ] +pybtex = [ + {file = "pybtex-0.24.0-py2.py3-none-any.whl", hash = "sha256:e1e0c8c69998452fea90e9179aa2a98ab103f3eed894405b7264e517cc2fcc0f"}, + {file = "pybtex-0.24.0.tar.gz", hash = "sha256:818eae35b61733e5c007c3fcd2cfb75ed1bc8b4173c1f70b56cc4c0802d34755"}, +] +pybtex-docutils = [ + {file = "pybtex-docutils-1.0.1.tar.gz", hash = "sha256:d53aa0c31dc94d61fd30ea3f06c749e6f510f9ff0e78cb2765a9300f173d8626"}, + {file = "pybtex_docutils-1.0.1-py3-none-any.whl", hash = "sha256:42e379bd1d5473b9fd7be4b3a64ca291d4fdc9ae6c6854e52d1d0157c955bbfa"}, +] pycparser = [ {file = "pycparser-2.20-py2.py3-none-any.whl", hash = "sha256:7582ad22678f0fcd81102833f60ef8d0e57288b6b5fb00323d101be910e35705"}, {file = "pycparser-2.20.tar.gz", hash = "sha256:2d475327684562c3a96cc71adf7dc8c4f0565175cf86b6d7a404ff4c771f15f0"}, @@ -1369,6 +1692,46 @@ six = [ {file = "six-1.16.0-py2.py3-none-any.whl", hash = "sha256:8abb2f1d86890a2dfb989f9a77cfcfd3e47c2a354b01111771326f8aa26e0254"}, {file = "six-1.16.0.tar.gz", hash = "sha256:1e61c37477a1626458e36f7b1d82aa5c9b094fa4802892072e49de9c60c4c926"}, ] +snowballstemmer = [ + {file = "snowballstemmer-2.1.0-py2.py3-none-any.whl", hash = "sha256:b51b447bea85f9968c13b650126a888aabd4cb4463fca868ec596826325dedc2"}, + {file = "snowballstemmer-2.1.0.tar.gz", hash = "sha256:e997baa4f2e9139951b6f4c631bad912dfd3c792467e2f03d7239464af90e914"}, +] +sphinx = [ + {file = "Sphinx-4.2.0-py3-none-any.whl", hash = "sha256:98a535c62a4fcfcc362528592f69b26f7caec587d32cd55688db580be0287ae0"}, + {file = "Sphinx-4.2.0.tar.gz", hash = "sha256:94078db9184491e15bce0a56d9186e0aec95f16ac20b12d00e06d4e36f1058a6"}, +] +sphinx-rtd-theme = [ + {file = "sphinx_rtd_theme-1.0.0-py2.py3-none-any.whl", hash = "sha256:4d35a56f4508cfee4c4fb604373ede6feae2a306731d533f409ef5c3496fdbd8"}, + {file = "sphinx_rtd_theme-1.0.0.tar.gz", hash = "sha256:eec6d497e4c2195fa0e8b2016b337532b8a699a68bcb22a512870e16925c6a5c"}, +] +sphinxcontrib-applehelp = [ + {file = "sphinxcontrib-applehelp-1.0.2.tar.gz", hash = "sha256:a072735ec80e7675e3f432fcae8610ecf509c5f1869d17e2eecff44389cdbc58"}, + {file = "sphinxcontrib_applehelp-1.0.2-py2.py3-none-any.whl", hash = "sha256:806111e5e962be97c29ec4c1e7fe277bfd19e9652fb1a4392105b43e01af885a"}, +] +sphinxcontrib-bibtex = [ + {file = "sphinxcontrib-bibtex-2.4.1.tar.gz", hash = "sha256:282223309bbaf34cd20a8fe1ba346fe8642f403a8930607e77a8cb08ae81fc5f"}, + {file = "sphinxcontrib_bibtex-2.4.1-py3-none-any.whl", hash = "sha256:b7da94e960a855c07c6816c7b0f4e8619b5b3ada00a5cb99b1eaa847a788f779"}, +] +sphinxcontrib-devhelp = [ + {file = "sphinxcontrib-devhelp-1.0.2.tar.gz", hash = "sha256:ff7f1afa7b9642e7060379360a67e9c41e8f3121f2ce9164266f61b9f4b338e4"}, + {file = "sphinxcontrib_devhelp-1.0.2-py2.py3-none-any.whl", hash = "sha256:8165223f9a335cc1af7ffe1ed31d2871f325254c0423bc0c4c7cd1c1e4734a2e"}, +] +sphinxcontrib-htmlhelp = [ + {file = "sphinxcontrib-htmlhelp-2.0.0.tar.gz", hash = "sha256:f5f8bb2d0d629f398bf47d0d69c07bc13b65f75a81ad9e2f71a63d4b7a2f6db2"}, + {file = "sphinxcontrib_htmlhelp-2.0.0-py2.py3-none-any.whl", hash = "sha256:d412243dfb797ae3ec2b59eca0e52dac12e75a241bf0e4eb861e450d06c6ed07"}, +] +sphinxcontrib-jsmath = [ + {file = "sphinxcontrib-jsmath-1.0.1.tar.gz", hash = "sha256:a9925e4a4587247ed2191a22df5f6970656cb8ca2bd6284309578f2153e0c4b8"}, + {file = "sphinxcontrib_jsmath-1.0.1-py2.py3-none-any.whl", hash = "sha256:2ec2eaebfb78f3f2078e73666b1415417a116cc848b72e5172e596c871103178"}, +] +sphinxcontrib-qthelp = [ + {file = "sphinxcontrib-qthelp-1.0.3.tar.gz", hash = "sha256:4c33767ee058b70dba89a6fc5c1892c0d57a54be67ddd3e7875a18d14cba5a72"}, + {file = "sphinxcontrib_qthelp-1.0.3-py2.py3-none-any.whl", hash = "sha256:bd9fc24bcb748a8d51fd4ecaade681350aa63009a347a8c14e637895444dfab6"}, +] +sphinxcontrib-serializinghtml = [ + {file = "sphinxcontrib-serializinghtml-1.1.5.tar.gz", hash = "sha256:aa5f6de5dfdf809ef505c4895e51ef5c9eac17d0f287933eb49ec495280b6952"}, + {file = "sphinxcontrib_serializinghtml-1.1.5-py2.py3-none-any.whl", hash = "sha256:352a9a00ae864471d3a7ead8d7d79f5fc0b57e8b3f95e9867eb9eb28999b92fd"}, +] tomli = [ {file = "tomli-1.2.1-py3-none-any.whl", hash = "sha256:8dd0e9524d6f386271a36b41dbf6c57d8e32fd96fd22b6584679dc569d20899f"}, {file = "tomli-1.2.1.tar.gz", hash = "sha256:a5b75cb6f3968abb47af1b40c1819dc519ea82bcc065776a866e8d74c5ca9442"}, diff --git a/pyproject.toml b/pyproject.toml index fc270b11..bfcdf612 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -28,6 +28,9 @@ pdbpp = "^0.10.3" black = "^21.9b0" isort = "^5.9.3" ipython = "^7.28.0" +Sphinx = "^4.2.0" +sphinx-rtd-theme = "^1.0.0" +sphinxcontrib-bibtex = "^2.4.1" [tool.poetry.scripts] rr = "runcardsrunner:run" From 6134dcba5fb3d05de3c03188274f9d4f96f1ef68 Mon Sep 17 00:00:00 2001 From: Felix Hekhorn Date: Fri, 1 Oct 2021 12:55:07 +0200 Subject: [PATCH 37/63] Start doc --- runcardsrunner/tools.py | 178 ++++++++++++++++++++++++++++++---------- 1 file changed, 135 insertions(+), 43 deletions(-) diff --git a/runcardsrunner/tools.py b/runcardsrunner/tools.py index 9e1de2cb..e4ca2204 100644 --- a/runcardsrunner/tools.py +++ b/runcardsrunner/tools.py @@ -1,8 +1,10 @@ import datetime import itertools + +# import re +# import readline import subprocess import time -from difflib import SequenceMatcher import InquirerPy import lz4.frame @@ -11,64 +13,85 @@ from . import paths +# from difflib import SequenceMatcher -def similar(a, b): - """ - Compare strings - - .. todo:: - use to suggest dataset in prompt - """ - return SequenceMatcher(None, a, b).ratio() +# def similar(a, b): +# """ +# Compare strings +# .. todo:: -import re -import readline +# use to suggest dataset in prompt +# """ +# return SequenceMatcher(None, a, b).ratio() -COMMANDS = ["extra", "extension", "stuff", "errors", "email", "foobar", "foo"] +# COMMANDS = ["extra", "extension", "stuff", "errors", "email", "foobar", "foo"] -re_space = re.compile(".*\s+$", re.M) +# re_space = re.compile(".*\s+$", re.M) def is_dis(name): + """ + Is this a DIS dataset, i.e. is yadism needed to run? + + The decision is based on the existance of the `observable.yaml` file. + + Parameters + ---------- + name : str + dataset name + """ return (paths.runcards / name / "observable.yaml").exists() -class Completer: - def __init__(self, tokens): - self.tokens = tokens - - def complete(self, text, state): - "Generic readline completion entry point." - buffer = readline.get_line_buffer() - line = readline.get_line_buffer().split() - # show all commands - if not line: - return [c + " " for c in self.tokens][state] - # account for last argument ending in a space - if re_space.match(buffer): - line.append("") - # resolve command to the implementation function - token = line[-1].strip() - results = [c + " " for c in self.tokens if c.startswith(token)] + [None] - return results[state] - - -def select_datasets(datasets_list): - comp = Completer(datasets_list) - # we want to treat '/' as part of a word, so override the delimiters - readline.set_completer_delims(" \t\n;") - readline.parse_and_bind("tab: complete") - readline.set_completer(comp.complete) - rich.print("[i magenta]Enter dataset name:") - ans = input("> ") - readline.set_completer() - return ans.split() +# class Completer: +# def __init__(self, tokens): +# self.tokens = tokens + +# def complete(self, text, state): +# "Generic readline completion entry point." +# buffer = readline.get_line_buffer() +# line = readline.get_line_buffer().split() +# # show all commands +# if not line: +# return [c + " " for c in self.tokens][state] +# # account for last argument ending in a space +# if re_space.match(buffer): +# line.append("") +# # resolve command to the implementation function +# token = line[-1].strip() +# results = [c + " " for c in self.tokens if c.startswith(token)] + [None] +# return results[state] + + +# def select_datasets(datasets_list): +# comp = Completer(datasets_list) +# # we want to treat '/' as part of a word, so override the delimiters +# readline.set_completer_delims(" \t\n;") +# readline.parse_and_bind("tab: complete") +# readline.set_completer(comp.complete) +# rich.print("[i magenta]Enter dataset name:") +# ans = input("> ") +# readline.set_completer() +# return ans.split() def avoid_recompute(name): + """ + Ask the user whether he really wants to recompute the dataset. + + Parameters + ---------- + name : str + dataset name + + Returns + ------- + bool : + do NOT recompute? + """ for p in paths.root.iterdir(): if p.is_dir() and name in p.name: rich.print( @@ -87,12 +110,35 @@ def avoid_recompute(name): def create_folder(name): + """ + Create output folder. + + Parameters + ---------- + name : str + dataset name + + Returns + ------- + pathlib.Path : + path to output folder + """ target = paths.root / (name + datetime.datetime.now().strftime("-%Y%m%d%H%M%S")) target.mkdir(exist_ok=True) return target def print_time(t0, what=None): + """ + Report completion together with timing to the user. + + Parameters + ---------- + t0 : int + start time + what : str + subject that is completed + """ dt = time.perf_counter() - t0 if what is None: @@ -105,6 +151,19 @@ def print_time(t0, what=None): def compress(path): + """ + Compress a file into lz4. + + Parameters + ---------- + path : pathlib.Path + input path + + Returns + ------- + pathlib.Path + path to compressed file + """ with open(path, "rb") as f: data = f.read() @@ -116,6 +175,19 @@ def compress(path): def decompress(path): + """ + Decompress a file from lz4. + + Parameters + ---------- + path : pathlib.Path + path to compressed file + + Returns + ------- + pathlib.Path + path to raw file + """ with lz4.frame.open(path, "r") as f: data = f.read() @@ -133,6 +205,18 @@ def decompress(path): def git_pull(repo, remote_name="origin", branch="master"): + """ + Pull a remote repository. + + Parameters + ---------- + repo : pygit2.Repository + repository + remote_name : str + remote name + branch : str + branch to get + """ for remote in repo.remotes: if remote.name == remote_name: remote.fetch() @@ -154,6 +238,14 @@ def git_pull(repo, remote_name="origin", branch="master"): def run_subprocess(*args, dest): + """ + Wrapper to :class:`subprocess.Popen` to print the output to screen and capture it. + + Returns + ------- + str : + output + """ p = subprocess.Popen( *args, stdout=subprocess.PIPE, stderr=subprocess.STDOUT, cwd=dest ) From 2806795787027269519f341406b6741544967923 Mon Sep 17 00:00:00 2001 From: Alessandro Candido Date: Fri, 1 Oct 2021 12:55:50 +0200 Subject: [PATCH 38/63] Late import lhapdf_management --- runcardsrunner/run.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/runcardsrunner/run.py b/runcardsrunner/run.py index f57c0235..c405bb81 100644 --- a/runcardsrunner/run.py +++ b/runcardsrunner/run.py @@ -2,7 +2,6 @@ import time import click -import lhapdf_management import rich from . import install, table, tools @@ -26,17 +25,21 @@ def run(dataset, pdf): rich.print(f"Computing [blue]{dataset}[/]...") runner = mg5.Mg5(dataset, pdf) - install_reqs(runner) - lhapdf_management.pdf_install(pdf) + install_reqs(runner, pdf) run_dataset(runner, dataset, pdf) -def install_reqs(runner): +def install_reqs(runner, pdf): + # lhapdf_management determine paths at import time, so it is important to + # late import it, in particular after `.path` module has been imported + import lhapdf_management + t0 = time.perf_counter() install.update_environ() runner.install() install.pineappl() + lhapdf_management.pdf_install(pdf) tools.print_time(t0, "Installation") From cde2383f8c0d5240080e7ff0fa6ad7b3ba181742 Mon Sep 17 00:00:00 2001 From: Alessandro Candido Date: Fri, 1 Oct 2021 13:05:21 +0200 Subject: [PATCH 39/63] Add pre-commit installation to install command --- rr | 1 + 1 file changed, 1 insertion(+) diff --git a/rr b/rr index a0f23622..7dacbf92 100755 --- a/rr +++ b/rr @@ -82,3 +82,4 @@ if __name__ == "__main__": repo_management(pipx, user) subprocess.run("poetry install".split()) + subprocess.run("pre-commit install".split()) From 7215f150226cf7ff5d0895ab7eedff8d34f4ddd0 Mon Sep 17 00:00:00 2001 From: Felix Hekhorn Date: Fri, 1 Oct 2021 14:46:14 +0200 Subject: [PATCH 40/63] Add table docs --- doc/source/conf.py | 2 ++ runcardsrunner/table.py | 40 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+) diff --git a/doc/source/conf.py b/doc/source/conf.py index a127ce61..3bf45c3c 100644 --- a/doc/source/conf.py +++ b/doc/source/conf.py @@ -115,6 +115,8 @@ "python": ("https://docs.python.org/3/", None), "scipy": ("https://docs.scipy.org/doc/scipy/reference", None), "numpy": ("https://numpy.org/doc/stable", None), + "pygit2": ("https://www.pygit2.org/", None), + "pandas": ("https://pandas.pydata.org/docs/", None), } # -- Options for todo extension ---------------------------------------------- diff --git a/runcardsrunner/table.py b/runcardsrunner/table.py index e65d595c..03a7ba29 100644 --- a/runcardsrunner/table.py +++ b/runcardsrunner/table.py @@ -6,6 +6,21 @@ def compute_data(grid, pdf_name): + """ + Call `convolute` via PineAPPL CLI. + + Parameters + ---------- + grid : str + grid path + pdf_name : str + PDF name + + Returns + ------- + list(str) : + (essential) output splitted by line + """ pineappl_results = subprocess.run( f"pineappl convolute {grid} {pdf_name} --scales 9 --absolute --integrated".split(), capture_output=True, @@ -14,6 +29,19 @@ def compute_data(grid, pdf_name): def parse_pineappl_table(output): + """ + Parse PineAPPL CLI output to :class:`~pandas.DataFrame`. + + Parameters + ---------- + output : list(str) + output + + Returns + ------- + pandas.DataFrame : + parsed data + """ header = output[0].split() header = [ header[0], @@ -33,6 +61,18 @@ def parse_pineappl_table(output): def print_table(pineappl_results, external_results, dest): + """ + Print comparison table to screen. + + Parameters + ---------- + pineappl_results : pandas.DataFrame + results from the generated grid + external_results : pandas.DataFrame + results from the external program + dest : pathlib.Path + path to output file + """ comparison = pd.DataFrame() # bare results From 2643dea06c4c24208d949098815055808fedfe86 Mon Sep 17 00:00:00 2001 From: Felix Hekhorn Date: Fri, 1 Oct 2021 15:06:55 +0200 Subject: [PATCH 41/63] Add run and install doc --- runcardsrunner/install.py | 40 +++++++++++++++++++++++++++++++++++++++ runcardsrunner/run.py | 34 ++++++++++++++++++++++++++++++--- 2 files changed, 71 insertions(+), 3 deletions(-) diff --git a/runcardsrunner/install.py b/runcardsrunner/install.py index 632edb9d..61ab70a4 100644 --- a/runcardsrunner/install.py +++ b/runcardsrunner/install.py @@ -25,6 +25,19 @@ def confirm(name): + """ + Ask for the confirmation to install a given program. + + Parameters + ---------- + name : str + program name + + Returns + ------- + bool : + install the program? + """ print(f"{name} not found") questions = [ { @@ -39,6 +52,14 @@ def confirm(name): def mg5amc(): + """ + Initialize `MadGraph5_aMC@NLO `_. + + Returns + ------- + callable : + condition to check whether the main executable exists. + """ # define availability condition condition = lambda: paths.mg5_exe.exists() and os.access(paths.mg5_exe, os.X_OK) @@ -61,6 +82,14 @@ def mg5amc(): def cargo(): + """ + Initialize `Rust `_. + + Returns + ------- + str : + path to `cargo` + """ # look for existing cargo cargo_exe = shutil.which("cargo") @@ -86,6 +115,14 @@ def cargo(): def pineappl(): + """ + Initialize `PineAPPL `_. + + Returns + ------- + callable : + condition to check whether `pineappl` and `pineappl_capi` are available. + """ # define availability condition condition = lambda: shutil.which("pineappl") is not None and pkgconfig.exists( "pineappl_capi" @@ -126,11 +163,14 @@ def pineappl(): def lhapdf(): + """Initialize `LHAPDF `_.""" paths.lhapdf_data.mkdir(parents=True, exist_ok=True) shutil.copy2(paths.lhapdf_conf, paths.lhapdf_data) def update_environ(): + """Adjust necessary environment files.""" + def prepend(name, value): os.environ[name] = str(value) + os.pathsep + os.environ[name] diff --git a/runcardsrunner/run.py b/runcardsrunner/run.py index c405bb81..7263f2c5 100644 --- a/runcardsrunner/run.py +++ b/runcardsrunner/run.py @@ -12,6 +12,16 @@ @click.argument("dataset") @click.option("--pdf", default="NNPDF31_nlo_as_0118_luxqed") def run(dataset, pdf): + """ + Compute a dataset and compare using a given PDF. + + Parameters + ---------- + dataset : str + dataset name + pdf : str + pdf name + """ dataset = pathlib.Path(dataset).name rich.print(dataset) @@ -26,13 +36,23 @@ def run(dataset, pdf): runner = mg5.Mg5(dataset, pdf) install_reqs(runner, pdf) - run_dataset(runner, dataset, pdf) + run_dataset(runner) def install_reqs(runner, pdf): + """ + Execute runner and apply common post process. + + Parameters + ---------- + runner : interface.External + runner instance + pdf : str + pdf name + """ # lhapdf_management determine paths at import time, so it is important to # late import it, in particular after `.path` module has been imported - import lhapdf_management + import lhapdf_management # pylint: disable=import-outside-toplevel t0 = time.perf_counter() @@ -44,7 +64,15 @@ def install_reqs(runner, pdf): tools.print_time(t0, "Installation") -def run_dataset(runner, name, pdf): +def run_dataset(runner): + """ + Execute runner and apply common post process. + + Parameters + ---------- + runner : interface.External + runner instance + """ t0 = time.perf_counter() tools.print_time(t0, "Grid calculation") From 06d55a9df142d6d7a35a34bb35f1833efb4825d1 Mon Sep 17 00:00:00 2001 From: Felix Hekhorn Date: Fri, 1 Oct 2021 15:35:18 +0200 Subject: [PATCH 42/63] Add interface doc --- runcardsrunner/external/interface.py | 31 +++++++++++++++++++++------- 1 file changed, 23 insertions(+), 8 deletions(-) diff --git a/runcardsrunner/external/interface.py b/runcardsrunner/external/interface.py index cb269df9..b4a95a5b 100644 --- a/runcardsrunner/external/interface.py +++ b/runcardsrunner/external/interface.py @@ -3,12 +3,22 @@ import subprocess import pygit2 -from pkgconfig.pkgconfig import exists from .. import paths, tools class External(abc.ABC): + """ + Interface class for external providers. + + Parameters + ---------- + name : str + dataset name + pdf : str + PDF name + """ + def __init__(self, name, pdf): self.name = name self.pdf = pdf @@ -16,40 +26,45 @@ def __init__(self, name, pdf): @property def source(self): + """Runcard base directory.""" return paths.runcards / self.name @property def grid(self): + """Target PineAPPL grid name.""" return self.dest / f"{self.name}.pineappl" @property def gridtmp(self): + """Intermediate PineAPPL grid name.""" return self.dest / f"{self.name}.pineappl.tmp" def update_with_tmp(self): + """Move intermediate grid to final position.""" shutil.move(self.gridtmp, self.grid) @staticmethod def install(): - pass + """Install all needed programs.""" @abc.abstractmethod def run(self): - pass + """Execute the program.""" @abc.abstractproperty def results(self): - pass + """Results as computed by the program.""" - @abc.abstractproperty + @abc.abstractmethod def generate_pineappl(self): - pass + """Generate PineAPPL output.""" @abc.abstractmethod def collect_versions(self): - pass + """Collect necessary version informations.""" def annotate_versions(self): + """Add version informations as meta data.""" results_log = self.dest / "results.log" pineappl = paths.pineappl_exe() @@ -74,4 +89,4 @@ def annotate_versions(self): @abc.abstractmethod def postprocess(self): - pass + """Postprocess grid.""" From 2e8d43a2ba4e809b6682e733e946d17f46382dd3 Mon Sep 17 00:00:00 2001 From: Alessandro Candido Date: Fri, 1 Oct 2021 16:32:50 +0200 Subject: [PATCH 43/63] Allow for rerunning without regenerating --- .gitignore | 3 +++ runcardsrunner/external/interface.py | 11 +++++++++-- runcardsrunner/external/mg5.py | 5 +++++ runcardsrunner/external/yad.py | 16 ++++++---------- runcardsrunner/run.py | 21 +++++++++++++++++---- runcardsrunner/tools.py | 2 +- 6 files changed, 41 insertions(+), 17 deletions(-) diff --git a/.gitignore b/.gitignore index 47cf8ba4..8bbb55ba 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,9 @@ .prefix/ # ignore any folder like '-YYYYMMDDHHmmss' *-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]/ +# madgraph junk +py.py +additional_command ### Python # Byte-compiled / optimized / DLL files diff --git a/runcardsrunner/external/interface.py b/runcardsrunner/external/interface.py index cb269df9..48279f5f 100644 --- a/runcardsrunner/external/interface.py +++ b/runcardsrunner/external/interface.py @@ -9,10 +9,17 @@ class External(abc.ABC): - def __init__(self, name, pdf): + def __init__(self, name, pdf, timestamp=None): self.name = name self.pdf = pdf - self.dest = tools.create_folder(self.name) + self.timestamp = timestamp + + if timestamp is None: + self.dest = tools.create_folder(self.name) + else: + self.dest = paths.root / (self.name + "-" + self.timestamp) + if not self.grid.exists(): + tools.decompress(self.grid.with_suffix(".pineappl.lz4")) @property def source(self): diff --git a/runcardsrunner/external/mg5.py b/runcardsrunner/external/mg5.py index 926b99eb..8b7b09eb 100644 --- a/runcardsrunner/external/mg5.py +++ b/runcardsrunner/external/mg5.py @@ -153,6 +153,11 @@ def results(self): def generate_pineappl(self): pineappl = paths.pineappl_exe() + # if rerunning without regenerating, let's remove the already merged + # grid (it will be soon reobtained) + if self.timestamp is not None: + self.grid.unlink() + # merge the final bins mg5_grids = " ".join( sorted( diff --git a/runcardsrunner/external/yad.py b/runcardsrunner/external/yad.py index f2a37e0c..a9ec9dea 100644 --- a/runcardsrunner/external/yad.py +++ b/runcardsrunner/external/yad.py @@ -10,10 +10,6 @@ class Yadism(interface.External): - def __init__(self, *args): - super().__init__(*args) - self.out = None - @staticmethod def install(): install.lhapdf() @@ -28,16 +24,16 @@ def run(self): obs = yaml.safe_load(o) # run yadism - self.out = yadism.run_yadism(theory, obs) + out = yadism.run_yadism(theory, obs) # dump pineappl - self.out.dump_pineappl_to_file( - str(self.grid), next(iter(obs["observables"].keys())) - ) + out.dump_pineappl_to_file(str(self.grid), next(iter(obs["observables"].keys()))) + out.dump_yaml_to_file(self.grid.with_suffix(".yaml")) def results(self): pdf = lhapdf.mkPDF(self.pdf) - pdf_out = self.out.apply_pdf_alphas_alphaqed_xir_xif( + out = yadism.Output.load_yaml_from_file(self.grid.with_suffix(".yaml")) + pdf_out = out.apply_pdf_alphas_alphaqed_xir_xif( pdf, lambda muR: lhapdf.mkAlphaS(self.pdf).alphasQ(muR), lambda _muR: 0, @@ -48,7 +44,7 @@ def results(self): sv_pdf_out = [] for xiR, xiF in tools.nine_points: - sv_point = self.out.apply_pdf_alphas_alphaqed_xir_xif( + sv_point = out.apply_pdf_alphas_alphaqed_xir_xif( pdf, lambda muR: lhapdf.mkAlphaS(self.pdf).alphasQ(muR), lambda _muR: 0.0, diff --git a/runcardsrunner/run.py b/runcardsrunner/run.py index c405bb81..c594963c 100644 --- a/runcardsrunner/run.py +++ b/runcardsrunner/run.py @@ -13,17 +13,27 @@ @click.option("--pdf", default="NNPDF31_nlo_as_0118_luxqed") def run(dataset, pdf): dataset = pathlib.Path(dataset).name + timestamp = None + + if "-" in dataset: + try: + dataset, timestamp = dataset.split("-") + except: + raise ValueError( + f"'{dataset}' not valid. '-' is only allowed once," + " to separate dataset name from timestamp." + ) rich.print(dataset) - if tools.avoid_recompute(dataset): + if timestamp is None and tools.avoid_recompute(dataset): return if tools.is_dis(dataset): rich.print(f"Computing [red]{dataset}[/]...") - runner = yad.Yadism(dataset, pdf) + runner = yad.Yadism(dataset, pdf, timestamp=timestamp) else: rich.print(f"Computing [blue]{dataset}[/]...") - runner = mg5.Mg5(dataset, pdf) + runner = mg5.Mg5(dataset, pdf, timestamp=timestamp) install_reqs(runner, pdf) run_dataset(runner, dataset, pdf) @@ -39,6 +49,7 @@ def install_reqs(runner, pdf): install.update_environ() runner.install() install.pineappl() + lhapdf_management.pdf_update() lhapdf_management.pdf_install(pdf) tools.print_time(t0, "Installation") @@ -49,7 +60,9 @@ def run_dataset(runner, name, pdf): tools.print_time(t0, "Grid calculation") - runner.run() + # if output folder specified, do not rerun + if runner.timestamp is None: + runner.run() table.print_table( table.parse_pineappl_table(runner.generate_pineappl()), runner.results(), diff --git a/runcardsrunner/tools.py b/runcardsrunner/tools.py index e4ca2204..2d3041fb 100644 --- a/runcardsrunner/tools.py +++ b/runcardsrunner/tools.py @@ -167,7 +167,7 @@ def compress(path): with open(path, "rb") as f: data = f.read() - compressed_path = path.parent / (path.name + ".lz4") + compressed_path = path.with_suffix(".pineappl.lz4") with lz4.frame.open(compressed_path, "wb") as f: f.write(data) From a163c798287b4072e57e5ce6eb4efb7b2eeb7d0c Mon Sep 17 00:00:00 2001 From: Alessandro Candido Date: Fri, 1 Oct 2021 18:12:21 +0200 Subject: [PATCH 44/63] Replace pineappl set usage with python interface --- runcardsrunner/external/interface.py | 22 +++++++++++++-------- runcardsrunner/table.py | 22 +++++++++++++++++---- runcardsrunner/tools.py | 29 ++++++++++++++++++++++++++++ 3 files changed, 61 insertions(+), 12 deletions(-) diff --git a/runcardsrunner/external/interface.py b/runcardsrunner/external/interface.py index ebd20995..2b741811 100644 --- a/runcardsrunner/external/interface.py +++ b/runcardsrunner/external/interface.py @@ -86,14 +86,20 @@ def annotate_versions(self): show_commit_oid_as_fallback=True, ) - entries = [] - for name, version in versions.items(): - entries += ["--entry", name, version] - entries += ["--entry", "lumi_id_types", "pdg_mc_ids"] - subprocess.run( - f"{pineappl} set {self.grid} {self.gridtmp}".split() - + f"--entry_from_file results {results_log}".split() - + entries + # entries = [] + # for name, version in versions.items(): + # entries += ["--entry", name, version] + # entries += ["--entry", "lumi_id_types", "pdg_mc_ids"] + # subprocess.run( + # f"{pineappl} set {self.grid} {self.gridtmp}".split() + # + f"--entry_from_file results {results_log}".split() + # + entries + # ) + entries = {} + entries.update(versions) + entries["lumi_id_types"] = "pdg_mc_ids" + tools.set_grid_metadata( + self.grid, self.gridtmp, entries, {"results": results_log} ) self.update_with_tmp() diff --git a/runcardsrunner/table.py b/runcardsrunner/table.py index 03a7ba29..f5a4c151 100644 --- a/runcardsrunner/table.py +++ b/runcardsrunner/table.py @@ -2,7 +2,9 @@ import itertools import subprocess +import lhapdf import pandas as pd +import pineappl def compute_data(grid, pdf_name): @@ -21,11 +23,23 @@ def compute_data(grid, pdf_name): list(str) : (essential) output splitted by line """ - pineappl_results = subprocess.run( - f"pineappl convolute {grid} {pdf_name} --scales 9 --absolute --integrated".split(), - capture_output=True, + pdf = lhapdf.mkPDF(pdf_name) + # TODO: is_dis and scale variations still missing + # grid_loaded = pineappl.grid.Grid.read(str(grid)) + # if True: # is dis + # projectile_pdf = lambda pid, x, Q2: 1.0 + # else: + # projectile_pdf = pdf.xfxQ2 + # pineappl_results = grid_loaded.convolute(pdf.xfxQ2, projectile_pdf, pdf.alphasQ2) + pineappl_results = ( + subprocess.run( + f"pineappl convolute {grid} {pdf_name} --scales 9 --absolute --integrated".split(), + capture_output=True, + ) + .stdout.decode() + .splitlines()[2:-2] ) - return pineappl_results.stdout.decode().splitlines()[2:-2] + return pineappl_results def parse_pineappl_table(output): diff --git a/runcardsrunner/tools.py b/runcardsrunner/tools.py index 2d3041fb..27917e8f 100644 --- a/runcardsrunner/tools.py +++ b/runcardsrunner/tools.py @@ -8,6 +8,7 @@ import InquirerPy import lz4.frame +import pineappl import pygit2 import rich @@ -261,3 +262,31 @@ def run_subprocess(*args, dest): output.append(line) return "\n".join(output) + + +def set_grid_metadata(input_file, output_file, entries, entries_from_file): + """ + Set metadata on a pineappl grid stored in a file, and save in a new one. + + Parameters + ---------- + input_file : path-like + file storing input grid + output_file : path-like + file to store the result + entries : dict + mapping of key-value to store in the grid + entries_from_file : dict + mapping of key-value pairs, whose value are file paths of which + storing the content + """ + grid = pineappl.grid.Grid.read(str(input_file)) + + for k, v in entries.items(): + grid.set_key_value(k, v) + + for k, v in entries_from_file.items(): + with open(v) as fd: + grid.set_key_value(k, fd.read()) + + grid.write(str(output_file)) From 03665f8389e4da1e0f52e00e5873c5cdd85a309e Mon Sep 17 00:00:00 2001 From: Alessandro Candido Date: Fri, 1 Oct 2021 19:21:40 +0200 Subject: [PATCH 45/63] Add update subcommand --- pyproject.toml | 2 +- runcardsrunner/__init__.py | 12 ++++++++++++ runcardsrunner/__main__.py | 3 +++ runcardsrunner/run.py | 10 +--------- runcardsrunner/tools.py | 6 +++++- runcardsrunner/update.py | 36 ++++++++++++++++++++++++++++++++++++ update_metadata.sh | 28 ++++++++++++++-------------- 7 files changed, 72 insertions(+), 25 deletions(-) create mode 100644 runcardsrunner/__main__.py create mode 100644 runcardsrunner/update.py diff --git a/pyproject.toml b/pyproject.toml index bfcdf612..d7c0bf43 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -33,7 +33,7 @@ sphinx-rtd-theme = "^1.0.0" sphinxcontrib-bibtex = "^2.4.1" [tool.poetry.scripts] -rr = "runcardsrunner:run" +rr = "runcardsrunner:cli" [build-system] requires = ["poetry-core>=1.0.0"] diff --git a/runcardsrunner/__init__.py b/runcardsrunner/__init__.py index ca27042b..7572c49b 100644 --- a/runcardsrunner/__init__.py +++ b/runcardsrunner/__init__.py @@ -1,3 +1,15 @@ __version__ = "0.0.0" +import click + from .run import run +from .update import update + + +@click.group() +def cli(): + pass + + +cli.add_command(run) +cli.add_command(update) diff --git a/runcardsrunner/__main__.py b/runcardsrunner/__main__.py new file mode 100644 index 00000000..bae58a86 --- /dev/null +++ b/runcardsrunner/__main__.py @@ -0,0 +1,3 @@ +from . import cli + +cli() diff --git a/runcardsrunner/run.py b/runcardsrunner/run.py index b6edbf99..f42edd6f 100644 --- a/runcardsrunner/run.py +++ b/runcardsrunner/run.py @@ -12,16 +12,8 @@ @click.argument("dataset") @click.option("--pdf", default="NNPDF31_nlo_as_0118_luxqed") def run(dataset, pdf): - """ - Compute a dataset and compare using a given PDF. + """Compute a dataset and compare using a given PDF.""" - Parameters - ---------- - dataset : str - dataset name - pdf : str - pdf name - """ dataset = pathlib.Path(dataset).name timestamp = None diff --git a/runcardsrunner/tools.py b/runcardsrunner/tools.py index 27917e8f..1fc25e56 100644 --- a/runcardsrunner/tools.py +++ b/runcardsrunner/tools.py @@ -264,7 +264,7 @@ def run_subprocess(*args, dest): return "\n".join(output) -def set_grid_metadata(input_file, output_file, entries, entries_from_file): +def set_grid_metadata(input_file, output_file, entries=None, entries_from_file=None): """ Set metadata on a pineappl grid stored in a file, and save in a new one. @@ -280,6 +280,10 @@ def set_grid_metadata(input_file, output_file, entries, entries_from_file): mapping of key-value pairs, whose value are file paths of which storing the content """ + if entries is None: + entries = {} + if entries_from_file is None: + entries_from_file = {} grid = pineappl.grid.Grid.read(str(input_file)) for k, v in entries.items(): diff --git a/runcardsrunner/update.py b/runcardsrunner/update.py new file mode 100644 index 00000000..cc784f3c --- /dev/null +++ b/runcardsrunner/update.py @@ -0,0 +1,36 @@ +import pathlib +import shutil + +import click +import rich + +from . import paths, tools + + +@click.command() +@click.argument("datasets", nargs=-1) +def update(datasets): + """Update datasets metadata""" + + for path in datasets: + path = pathlib.Path(path) + dataset = path.stem + # remove doble suffix + if "pineappl" in dataset: + dataset = pathlib.Path(dataset).stem + + metadata = paths.runcards / dataset / "metadata.txt" + + entries = {} + with open(metadata) as fd: + for line in fd.readlines(): + k, v = line.split("=") + entries[k] = v + + dest = path.parent / (path.name + ".tmp") + tools.set_grid_metadata(path, dest, entries) + compressed = tools.compress(dest) + dest.unlink() + shutil.move(compressed, path) + + rich.print(f"'{path}'\n\tgrid metadata updated") diff --git a/update_metadata.sh b/update_metadata.sh index 2250ef96..d5ede81d 100755 --- a/update_metadata.sh +++ b/update_metadata.sh @@ -10,22 +10,22 @@ set -o nounset set -o pipefail for i in $(find "$@" -name '*.pineappl.lz4'); do - dataset=$(basename $i) - dataset=${dataset%.pineappl.lz4} + dataset=$(basename $i) + dataset=${dataset%.pineappl.lz4} - export grid=${i} - export metadata=nnpdf31_proc/${dataset}/metadata.txt + export grid=${i} + export metadata=nnpdf31_proc/${dataset}/metadata.txt - if [[ ! -f ${metadata} ]]; then - echo "Skipping ${i#./}, couldn't find metadata (is the git repository on the right branch?)" - continue - else - echo "Updating ${i#./}" - fi + if [[ ! -f ${metadata} ]]; then + echo "Skipping ${i#./}, couldn't find metadata (is the git repository on the right branch?)" + continue + else + echo "Updating ${i#./}" + fi - eval $(awk -F= "BEGIN { printf \"pineappl set ${grid} ${grid}.tmp \" } { printf \"--entry %s '%s' \", \$1, \$2 }" ${metadata}) + eval $(awk -F= "BEGIN { printf \"pineappl set ${grid} ${grid}.tmp \" } { printf \"--entry %s '%s' \", \$1, \$2 }" ${metadata}) - lz4 -9 ${i}.tmp 2>/dev/null - rm ${i}.tmp - mv ${i}.tmp.lz4 ${i} + lz4 -9 ${i}.tmp 2>/dev/null + rm ${i}.tmp + mv ${i}.tmp.lz4 ${i} done From 9a2a98d3fb2c8f3501e7553a1cf850d4659725c7 Mon Sep 17 00:00:00 2001 From: Alessandro Candido Date: Fri, 1 Oct 2021 19:22:35 +0200 Subject: [PATCH 46/63] Revert original update script change --- update_metadata.sh | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-) diff --git a/update_metadata.sh b/update_metadata.sh index d5ede81d..2250ef96 100755 --- a/update_metadata.sh +++ b/update_metadata.sh @@ -10,22 +10,22 @@ set -o nounset set -o pipefail for i in $(find "$@" -name '*.pineappl.lz4'); do - dataset=$(basename $i) - dataset=${dataset%.pineappl.lz4} + dataset=$(basename $i) + dataset=${dataset%.pineappl.lz4} - export grid=${i} - export metadata=nnpdf31_proc/${dataset}/metadata.txt + export grid=${i} + export metadata=nnpdf31_proc/${dataset}/metadata.txt - if [[ ! -f ${metadata} ]]; then - echo "Skipping ${i#./}, couldn't find metadata (is the git repository on the right branch?)" - continue - else - echo "Updating ${i#./}" - fi + if [[ ! -f ${metadata} ]]; then + echo "Skipping ${i#./}, couldn't find metadata (is the git repository on the right branch?)" + continue + else + echo "Updating ${i#./}" + fi - eval $(awk -F= "BEGIN { printf \"pineappl set ${grid} ${grid}.tmp \" } { printf \"--entry %s '%s' \", \$1, \$2 }" ${metadata}) + eval $(awk -F= "BEGIN { printf \"pineappl set ${grid} ${grid}.tmp \" } { printf \"--entry %s '%s' \", \$1, \$2 }" ${metadata}) - lz4 -9 ${i}.tmp 2>/dev/null - rm ${i}.tmp - mv ${i}.tmp.lz4 ${i} + lz4 -9 ${i}.tmp 2>/dev/null + rm ${i}.tmp + mv ${i}.tmp.lz4 ${i} done From 97a2d271fb7aafe51507d2aa7ff1936fa43badee Mon Sep 17 00:00:00 2001 From: Alessandro Candido Date: Fri, 1 Oct 2021 19:26:25 +0200 Subject: [PATCH 47/63] Detect if pipx available during install --- rr | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/rr b/rr index 7dacbf92..aca04064 100755 --- a/rr +++ b/rr @@ -4,6 +4,7 @@ Zero-dependency bootstrap script """ import argparse import pathlib +import shutil import subprocess import sys @@ -75,7 +76,10 @@ if __name__ == "__main__": question = load_options(args.yes, args.no, args.default) - pipx_answer = question("Do you want to install with pipx?", False) + if shutil.which("pipx") is not None: + pipx_answer = question("Do you want to install with pipx?", False) + else: + pipx_answer = "no" pipx = pipx_answer.lower() in ["y", "yes"] user = " --user" if args.user else "" From e0ad22179e0e7f67bf1be7664768f9be1e6beaf9 Mon Sep 17 00:00:00 2001 From: Alessandro Candido Date: Sat, 2 Oct 2021 12:35:04 +0200 Subject: [PATCH 48/63] Provide (untested) merge subcommand --- runcardsrunner/__init__.py | 2 ++ runcardsrunner/merge.py | 69 ++++++++++++++++++++++++++++++++++++++ runcardsrunner/tools.py | 49 +++++++++++++++++++++++++++ 3 files changed, 120 insertions(+) create mode 100644 runcardsrunner/merge.py diff --git a/runcardsrunner/__init__.py b/runcardsrunner/__init__.py index 7572c49b..58903acf 100644 --- a/runcardsrunner/__init__.py +++ b/runcardsrunner/__init__.py @@ -2,6 +2,7 @@ import click +from .merge import merge from .run import run from .update import update @@ -11,5 +12,6 @@ def cli(): pass +cli.add_command(merge) cli.add_command(run) cli.add_command(update) diff --git a/runcardsrunner/merge.py b/runcardsrunner/merge.py new file mode 100644 index 00000000..6409ee66 --- /dev/null +++ b/runcardsrunner/merge.py @@ -0,0 +1,69 @@ +import itertools +import pathlib +import re + +import click +import pineappl +import rich + +from . import tools + + +@click.command() +@click.argument("grids", nargs=-1) +def merge(grids): + """ """ + if len(grids) < 2: + raise ValueError("At least 2 grids needed for a merge.") + + grids = [pathlib.Path(grid) for grid in grids] + common = tools.common_substring(*(grid.name for grid in grids)).strip("_") + + raise NotImplementedError("Missing 'merge()' in pineappl_py") + # merge grids + mgrid = pathlib.Path(common).with_suffix(".pineappl") + pineappl.grid.merge(mgrid, *grids) + + raise NotImplementedError("Missing 'Grid.keys()' in pineappl_py") + # get all keys, possibly ones that are exclusive to a single grid + keys = set(itertools.chain(grid.keys() for grid in grids)) + + # concatenate results + tmpresults = [] + data_row = re.compile(" \d.*") + empty_row = " 0.000000e+00 0.000000e+00 0.000 0.000 0.0000 0.0000 0.0000" + + # extract the header from the first grid + for line in grids[0].get("results").splitlines(): + results_header_rows = [] + if not data_row.fullmatch(line): + results_header_rows.append(line) + tmpresults.append("\n".join(results_header_rows)) + + # extract the results from each grid + for grid in grids: + results_rows = [] + for line in grid.get("results").splitlines(): + if data_row.fullmatch(line) and line != empty_row: + results_rows.append(line) + tmpresults.append("\n".join(results_rows)) + + # set the results metadata in the new grid + mgridtmp = mgrid.parent / (mgrid.name + ".tmp") + tools.set_grid_metadata( + mgrid, mgridtmp, entries_from_file={"results": "\n".join(tmpresults)} + ) + shutil.move(mgridtmp, mgrid) + + for key in keys: + if key == "results": + continue + + mvalue = mgrid.get(key) + for grid in grids: + if mvalue != grid.get(key): + # TODO: what do we do in this case? + rich.print(f"'{key}' differs [gray]for '{grid}'[/]") + + tools.compress(mgrid) + mgrid.unlink() diff --git a/runcardsrunner/tools.py b/runcardsrunner/tools.py index 1fc25e56..bc712a57 100644 --- a/runcardsrunner/tools.py +++ b/runcardsrunner/tools.py @@ -294,3 +294,52 @@ def set_grid_metadata(input_file, output_file, entries=None, entries_from_file=N grid.set_key_value(k, fd.read()) grid.write(str(output_file)) + + +def common_substring(s1, s2, *sn): + """ + Return the longest common part of two iterables, starting from the begininng + + Parameters + ---------- + s1 : sequence + s2 : sequence + + Returns + ------- + sequence + longest common subsequence + + Examples + -------- + + >>> common_substring("test test", "test toast") + "test t" + >>> common_substring("test test", "test test test") + "test test" + >>> common_substring("test test", "") + "" + >>> common_substring("test test", "test test test", "test") + "test" + >>> common_substring("test test", "test test test", "test toast") + "test t" + + """ + try: + # since it is common to all, we can take the matching chunk from the first + return s1[ + # stop at first non-matching element + : next( + n + # iterate over all elements + for n, (c1, c2, *cn) in enumerate(zip(s1, s2, *sn)) + # if they are all equal keep going + if len(set([c1, c2, *cn])) > 1 + ) + ] + except StopIteration: + # if they match up to the end of one of the inputs, return the shortest + ss = (s1, s2, *sn) + # sort by length and take the first + shortest = min(enumerate(len(s) for s in ss), key=lambda el: el[1])[0] + return ss[shortest] From 0437b9fbb551ff647ff61f4f786cf2eb376c92bb Mon Sep 17 00:00:00 2001 From: Felix Hekhorn Date: Tue, 5 Oct 2021 17:24:52 +0200 Subject: [PATCH 49/63] Delete some old comment --- runcardsrunner/external/interface.py | 9 --------- 1 file changed, 9 deletions(-) diff --git a/runcardsrunner/external/interface.py b/runcardsrunner/external/interface.py index 2b741811..e4dec7ac 100644 --- a/runcardsrunner/external/interface.py +++ b/runcardsrunner/external/interface.py @@ -86,15 +86,6 @@ def annotate_versions(self): show_commit_oid_as_fallback=True, ) - # entries = [] - # for name, version in versions.items(): - # entries += ["--entry", name, version] - # entries += ["--entry", "lumi_id_types", "pdg_mc_ids"] - # subprocess.run( - # f"{pineappl} set {self.grid} {self.gridtmp}".split() - # + f"--entry_from_file results {results_log}".split() - # + entries - # ) entries = {} entries.update(versions) entries["lumi_id_types"] = "pdg_mc_ids" From a3f86322127f71162c7fb6d662367313833ff55a Mon Sep 17 00:00:00 2001 From: Alessandro Candido Date: Wed, 6 Oct 2021 10:20:15 +0200 Subject: [PATCH 50/63] Extend prepend to unset variables --- runcardsrunner/install.py | 2 ++ 1 file changed, 2 insertions(+) diff --git a/runcardsrunner/install.py b/runcardsrunner/install.py index 61ab70a4..30070a42 100644 --- a/runcardsrunner/install.py +++ b/runcardsrunner/install.py @@ -172,6 +172,8 @@ def update_environ(): """Adjust necessary environment files.""" def prepend(name, value): + if name not in os.environ: + os.environ[name] = "" os.environ[name] = str(value) + os.pathsep + os.environ[name] pyver = ".".join(sys.version.split(".")[:2]) From 847c7db6a26399a0737c859575905539571f4c2c Mon Sep 17 00:00:00 2001 From: Alessandro Candido Date: Thu, 7 Oct 2021 15:14:49 +0200 Subject: [PATCH 51/63] Remove original grid after compression --- runcardsrunner/external/mg5.py | 8 ++------ runcardsrunner/tools.py | 9 ++++----- 2 files changed, 6 insertions(+), 11 deletions(-) diff --git a/runcardsrunner/external/mg5.py b/runcardsrunner/external/mg5.py index 8b7b09eb..1869d943 100644 --- a/runcardsrunner/external/mg5.py +++ b/runcardsrunner/external/mg5.py @@ -232,12 +232,8 @@ def postprocess(self): os.environ["GRID"] = str(self.grid) subprocess.run("./postrun.sh", cwd=self.dest) - with lz4.frame.open( - self.grid.with_suffix(self.grid.suffix + ".lz4"), - "wb", - compression_level=lz4.frame.COMPRESSIONLEVEL_MAX, - ) as fd: - fd.write(self.grid.read_bytes()) + tools.compress(self.grid) + self.grid.unlink() def find_marker_position(insertion_marker, contents): diff --git a/runcardsrunner/tools.py b/runcardsrunner/tools.py index bc712a57..ec1163a9 100644 --- a/runcardsrunner/tools.py +++ b/runcardsrunner/tools.py @@ -165,12 +165,11 @@ def compress(path): pathlib.Path path to compressed file """ - with open(path, "rb") as f: - data = f.read() - compressed_path = path.with_suffix(".pineappl.lz4") - with lz4.frame.open(compressed_path, "wb") as f: - f.write(data) + with lz4.frame.open( + compressed_path, "wb", compression_level=lz4.frame.COMPRESSIONLEVEL_MAX + ) as fd: + fd.write(path.read_bytes()) return compressed_path From 7cca817124b743b45ea3c61fd20c126185dd3e10 Mon Sep 17 00:00:00 2001 From: Alessandro Candido Date: Thu, 7 Oct 2021 15:18:38 +0200 Subject: [PATCH 52/63] Remove avoid recomputing prompt --- runcardsrunner/run.py | 2 -- runcardsrunner/tools.py | 32 -------------------------------- 2 files changed, 34 deletions(-) diff --git a/runcardsrunner/run.py b/runcardsrunner/run.py index f42edd6f..13c52711 100644 --- a/runcardsrunner/run.py +++ b/runcardsrunner/run.py @@ -27,8 +27,6 @@ def run(dataset, pdf): ) rich.print(dataset) - if timestamp is None and tools.avoid_recompute(dataset): - return if tools.is_dis(dataset): rich.print(f"Computing [red]{dataset}[/]...") diff --git a/runcardsrunner/tools.py b/runcardsrunner/tools.py index ec1163a9..88e92a88 100644 --- a/runcardsrunner/tools.py +++ b/runcardsrunner/tools.py @@ -6,7 +6,6 @@ import subprocess import time -import InquirerPy import lz4.frame import pineappl import pygit2 @@ -79,37 +78,6 @@ def is_dis(name): # return ans.split() -def avoid_recompute(name): - """ - Ask the user whether he really wants to recompute the dataset. - - Parameters - ---------- - name : str - dataset name - - Returns - ------- - bool : - do NOT recompute? - """ - for p in paths.root.iterdir(): - if p.is_dir() and name in p.name: - rich.print( - f"[i grey50]dataset already in '[/][yellow]{p.name}[i grey50]'[/]" - ) - questions = [ - { - "type": "confirm", - "name": "recompute", - "message": f"Do you want to recompute '{name}'?\n", - } - ] - answers = InquirerPy.prompt(questions) - return not answers["recompute"] - return False - - def create_folder(name): """ Create output folder. From f1319b547f846dd93f78e3a1a3f7c323ea88b76c Mon Sep 17 00:00:00 2001 From: Alessandro Candido Date: Thu, 7 Oct 2021 17:10:52 +0200 Subject: [PATCH 53/63] Support prefix missing environments --- rr | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/rr b/rr index aca04064..86b3075c 100755 --- a/rr +++ b/rr @@ -3,8 +3,10 @@ Zero-dependency bootstrap script """ import argparse +import os import pathlib import shutil +import site import subprocess import sys @@ -85,5 +87,12 @@ if __name__ == "__main__": user = " --user" if args.user else "" repo_management(pipx, user) + scripts_base_dir = ( + site.getuserbase() + "/bin" + if not sys.platform.startswith("win") + else r"\Scripts" + ) + os.environ["PATH"] += os.pathsep + str(scripts_base_dir) + subprocess.run("poetry install".split()) subprocess.run("pre-commit install".split()) From 286f423c73237b0e7c3dec28eeaba53a0b361153 Mon Sep 17 00:00:00 2001 From: Felix Hekhorn Date: Thu, 7 Oct 2021 17:46:41 +0200 Subject: [PATCH 54/63] Add pylint and pass theory explicitly --- .pylintrc | 504 +++++++++++++++++++++++++++ poetry.lock | 108 +++++- pyproject.toml | 1 + runcardsrunner/__init__.py | 2 +- runcardsrunner/external/interface.py | 5 +- runcardsrunner/external/mg5.py | 1 + runcardsrunner/external/yad.py | 4 +- runcardsrunner/run.py | 45 ++- runcardsrunner/theory.yaml | 43 --- theories/theory_200.yaml | 45 +++ theories/theory_213.yaml | 45 +++ 11 files changed, 747 insertions(+), 56 deletions(-) create mode 100644 .pylintrc delete mode 100644 runcardsrunner/theory.yaml create mode 100644 theories/theory_200.yaml create mode 100644 theories/theory_213.yaml diff --git a/.pylintrc b/.pylintrc new file mode 100644 index 00000000..84c26059 --- /dev/null +++ b/.pylintrc @@ -0,0 +1,504 @@ +[MASTER] + +# A comma-separated list of package or module names from where C extensions may +# be loaded. Extensions are loading into the active Python interpreter and may +# run arbitrary code +extension-pkg-whitelist=numpy,lhapdf,numba,pineappl,lhapdf_management + +# Add files or directories to the blacklist. They should be base names, not +# paths. +ignore=CVS + +# Add files or directories matching the regex patterns to the blacklist. The +# regex matches against base names, not paths. +ignore-patterns= + +# Python code to execute, usually for sys.path manipulation such as +# pygtk.require(). +#init-hook= + +# Use multiple processes to speed up Pylint. +jobs=1 # has to be 1 as pylint is NOT threadsafe + +# List of plugins (as comma separated values of python modules names) to load, +# usually to register additional checkers. +#load-plugins=pylint.extensions.mccabe +#max-complexity=20 + +# Pickle collected data for later comparisons. +persistent=yes + +# Specify a configuration file. +#rcfile= + +# Allow loading of arbitrary C extensions. Extensions are imported into the +# active Python interpreter and may run arbitrary code. +unsafe-load-any-extension=no + + +[MESSAGES CONTROL] + +# Only show warnings with the listed confidence levels. Leave empty to show +# all. Valid levels: HIGH, INFERENCE, INFERENCE_FAILURE, UNDEFINED +confidence= + +# Disable the message, report, category or checker with the given id(s). You +# can either give multiple identifiers separated by comma (,) or put this +# option multiple times (only on the command line, not in the configuration +# file where it should appear only once).You can also use "--disable=all" to +# disable everything first and then reenable specific checks. For example, if +# you want to run only the similarities checker, you can use "--disable=all +# --enable=similarities". If you want to run only the classes checker, but have +# no Warning level messages displayed, use"--disable=all --enable=classes +# --disable=W" +disable= + print-statement, + parameter-unpacking, + unpacking-in-except, + old-raise-syntax, + backtick, + long-suffix, + old-ne-operator, + old-octal-literal, + import-star-module-level, + raw-checker-failed, + bad-inline-option, + locally-disabled, + locally-enabled, + file-ignored, + suppressed-message, + useless-suppression, + deprecated-pragma, + apply-builtin, + basestring-builtin, + buffer-builtin, + cmp-builtin, + coerce-builtin, + execfile-builtin, + file-builtin, + long-builtin, + raw_input-builtin, + reduce-builtin, + standarderror-builtin, + unicode-builtin, + xrange-builtin, + coerce-method, + delslice-method, + getslice-method, + setslice-method, + no-absolute-import, + old-division, + dict-iter-method, + dict-view-method, + next-method-called, + metaclass-assignment, + indexing-exception, + raising-string, + reload-builtin, + oct-method, + hex-method, + nonzero-method, + cmp-method, + input-builtin, + round-builtin, + intern-builtin, + unichr-builtin, + map-builtin-not-iterating, + zip-builtin-not-iterating, + range-builtin-not-iterating, + filter-builtin-not-iterating, + using-cmp-argument, + eq-without-hash, + div-method, + idiv-method, + rdiv-method, + exception-message-attribute, + invalid-str-codec, + sys-max-int, + bad-python3-import, + deprecated-string-function, + deprecated-str-translate-call, + invalid-name, + too-few-public-methods, + too-many-arguments, + bad-continuation, + redefined-outer-name, + missing-docstring, + bad-whitespace, + no-self-use, + no-else-return, + global-statement, + too-many-public-method, + too-many-ancestors + +# Enable the message, report, category or checker with the given id(s). You can +# either give multiple identifier separated by comma (,) or put this option +# multiple time (only on the command line, not in the configuration file where +# it should appear only once). See also the "--disable" option for examples. +enable= + + +[REPORTS] + +# Python expression which should return a note less than 10 (10 is the highest +# note). You have access to the variables errors warning, statement which +# respectively contain the number of errors / warnings messages and the total +# number of statements analyzed. This is used by the global evaluation report +# (RP0004). +evaluation=10.0 - ((float(5 * error + warning + refactor + convention) / statement) * 10) + +# Template used to display messages. This is a python new-style format string +# used to format the message information. See doc for all details +#msg-template= + +# Set the output format. Available formats are text, parseable, colorized, json +# and msvs (visual studio).You can also give a reporter class, eg +# mypackage.mymodule.MyReporterClass. +output-format=text + +# Tells whether to display a full report or only the messages +reports=no + +# Activate the evaluation score. +score=yes + + +[REFACTORING] + +# Maximum number of nested blocks for function / method body +max-nested-blocks=5 + + +[MISCELLANEOUS] + +# List of note tags to take in consideration, separated by a comma. +notes=FIXME,XXX,TODO + + +[SIMILARITIES] + +# Ignore comments when computing similarities. +ignore-comments=yes + +# Ignore docstrings when computing similarities. +ignore-docstrings=yes + +# Ignore imports when computing similarities. +ignore-imports=no + +# Minimum lines number of a similarity. +min-similarity-lines=4 + + +[BASIC] + +# Naming hint for argument names +argument-name-hint=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$ + +# Regular expression matching correct argument names +argument-rgx=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$ + +# Naming hint for attribute names +attr-name-hint=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$ + +# Regular expression matching correct attribute names +attr-rgx=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$ + +# Bad variable names which should always be refused, separated by a comma +bad-names=foo,bar,baz,toto,tutu,tata + +# Naming hint for class attribute names +class-attribute-name-hint=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$ + +# Regular expression matching correct class attribute names +class-attribute-rgx=([A-Za-z_][A-Za-z0-9_]{2,30}|(__.*__))$ + +# Naming hint for class names +class-name-hint=[A-Z_][a-zA-Z0-9]+$ + +# Regular expression matching correct class names +class-rgx=[A-Z_][a-zA-Z0-9]+$ + +# Naming hint for constant names +const-name-hint=(([A-Z_][A-Z0-9_]*)|(__.*__))$ + +# Regular expression matching correct constant names +const-rgx=(([A-Z_][A-Z0-9_]*)|(__.*__))$ + +# Minimum line length for functions/classes that require docstrings, shorter +# ones are exempt. +docstring-min-length=-1 + +# Naming hint for function names +function-name-hint=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$ + +# Regular expression matching correct function names +function-rgx=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$ + +# Good variable names which should always be accepted, separated by a comma +good-names=i,j,k,ex,Run,_ + +# Include a hint for the correct naming format with invalid-name +include-naming-hint=no + +# Naming hint for inline iteration names +inlinevar-name-hint=[A-Za-z_][A-Za-z0-9_]*$ + +# Regular expression matching correct inline iteration names +inlinevar-rgx=[A-Za-z_][A-Za-z0-9_]*$ + +# Naming hint for method names +method-name-hint=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$ + +# Regular expression matching correct method names +method-rgx=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$ + +# Naming hint for module names +module-name-hint=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$ + +# Regular expression matching correct module names +module-rgx=(([a-z_][a-z0-9_]*)|([A-Z][a-zA-Z0-9]+))$ + +# Colon-delimited sets of names that determine each other's naming style when +# the name regexes allow several styles. +name-group= + +# Regular expression which should only match function or class names that do +# not require a docstring. +no-docstring-rgx=^_ + +# List of decorators that produce properties, such as abc.abstractproperty. Add +# to this list to register other decorators that produce valid properties. +property-classes=abc.abstractproperty + +# Naming hint for variable names +variable-name-hint=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$ + +# Regular expression matching correct variable names +variable-rgx=(([a-z][a-z0-9_]{2,30})|(_[a-z0-9_]*))$ + + +[VARIABLES] + +# List of additional names supposed to be defined in builtins. Remember that +# you should avoid to define new builtins when possible. +additional-builtins= + +# Tells whether unused global variables should be treated as a violation. +allow-global-unused-variables=yes + +# List of strings which can identify a callback function by name. A callback +# name must start or end with one of those strings. +callbacks=cb_,_cb + +# A regular expression matching the name of dummy variables (i.e. expectedly +# not used). +dummy-variables-rgx=_+$|(_[a-zA-Z0-9_]*[a-zA-Z0-9]+?$)|dummy|^ignored_|^unused_ + +# Argument names that match this expression will be ignored. Default to name +# with leading underscore +ignored-argument-names=_.*|^ignored_|^unused_ + +# Tells whether we should check for unused import in __init__ files. +init-import=no + +# List of qualified module names which can have objects that can redefine +# builtins. +redefining-builtins-modules=six.moves,future.builtins + + +[FORMAT] + +# Expected format of line ending, e.g. empty (any line ending), LF or CRLF. +expected-line-ending-format= + +# Regexp for a line that is allowed to be longer than the limit. +ignore-long-lines=^.*(# )??.*$ + +# Number of spaces of indent required inside a hanging or continued line. +indent-after-paren=4 + +# String used as indentation unit. This is usually " " (4 spaces) or "\t" (1 +# tab). +indent-string=' ' + +# Maximum number of characters on a single line. +max-line-length=100 + +# Maximum number of lines in a module +max-module-lines=1000 + +# List of optional constructs for which whitespace checking is disabled. `dict- +# separator` is used to allow tabulation in dicts, etc.: {1 : 1,\n222: 2}. +# `trailing-comma` allows a space between comma and closing bracket: (a, ). +# `empty-line` allows space-only lines. +no-space-check=trailing-comma,dict-separator + +# Allow the body of a class to be on the same line as the declaration if body +# contains single statement. +single-line-class-stmt=no + +# Allow the body of an if to be on the same line as the test if there is no +# else. +single-line-if-stmt=no + + +[SPELLING] + +# Spelling dictionary name. Available dictionaries: none. To make it working +# install python-enchant package. +spelling-dict= + +# List of comma separated words that should not be checked. +spelling-ignore-words= + +# A path to a file that contains private dictionary; one word per line. +spelling-private-dict-file= + +# Tells whether to store unknown words to indicated private dictionary in +# --spelling-private-dict-file option instead of raising a message. +spelling-store-unknown-words=no + + +[TYPECHECK] + +# List of decorators that produce context managers, such as +# contextlib.contextmanager. Add to this list to register other decorators that +# produce valid context managers. +contextmanager-decorators=contextlib.contextmanager + +# List of members which are set dynamically and missed by pylint inference +# system, and so shouldn't trigger E1101 when accessed. Python regular +# expressions are accepted. +generated-members= + +# Tells whether missing members accessed in mixin class should be ignored. A +# mixin class is detected if its name ends with "mixin" (case insensitive). +ignore-mixin-members=yes + +# This flag controls whether pylint should warn about no-member and similar +# checks whenever an opaque object is returned when inferring. The inference +# can return multiple potential results while evaluating a Python object, but +# some branches might not be evaluated, which results in partial inference. In +# that case, it might be useful to still emit no-member and other checks for +# the rest of the inferred objects. +ignore-on-opaque-inference=yes + +# List of class names for which member attributes should not be checked (useful +# for classes with dynamically set attributes). This supports the use of +# qualified names. +ignored-classes=optparse.Values,thread._local,_thread._local + +# List of module names for which member attributes should not be checked +# (useful for modules/projects where namespaces are manipulated during runtime +# and thus existing member attributes cannot be deduced by static analysis. It +# supports qualified module names, as well as Unix pattern matching. +ignored-modules=matplotlib.cm,numba + +# Show a hint with possible names when a member name was not found. The aspect +# of finding the hint is based on edit distance. +missing-member-hint=yes + +# The minimum edit distance a name should have in order to be considered a +# similar match for a missing member name. +missing-member-hint-distance=1 + +# The total number of similar names that should be taken in consideration when +# showing a hint for a missing member. +missing-member-max-choices=1 + + +[LOGGING] + +# Logging modules to check that the string format arguments are in logging +# function parameter format +logging-modules=logging + + +[DESIGN] + +# Maximum number of arguments for function / method +max-args=5 + +# Maximum number of attributes for a class (see R0902). +max-attributes=7 + +# Maximum number of boolean expressions in a if statement +max-bool-expr=5 + +# Maximum number of branch for function / method body +max-branches=12 + +# Maximum number of locals for function / method body +max-locals=22 + +# Maximum number of parents for a class (see R0901). +max-parents=7 + +# Maximum number of public methods for a class (see R0904). +max-public-methods=20 + +# Maximum number of return / yield for function / method body +max-returns=6 + +# Maximum number of statements in function / method body +max-statements=50 + +# Minimum number of public methods for a class (see R0903). +min-public-methods=2 + + +[CLASSES] + +# List of method names used to declare (i.e. assign) instance attributes. +defining-attr-methods=__init__,__new__,setUp + +# List of member names, which should be excluded from the protected access +# warning. +exclude-protected=_asdict,_fields,_replace,_source,_make + +# List of valid names for the first argument in a class method. +valid-classmethod-first-arg=cls + +# List of valid names for the first argument in a metaclass class method. +valid-metaclass-classmethod-first-arg=mcs + + +[IMPORTS] + +# Allow wildcard imports from modules that define __all__. +allow-wildcard-with-all=no + +# Analyse import fallback blocks. This can be used to support both Python 2 and +# 3 compatible code, which means that the block might have code that exists +# only in one or another interpreter, leading to false positives when analysed. +analyse-fallback-blocks=no + +# Deprecated modules which should not be used, separated by a comma +deprecated-modules=optparse,tkinter.tix + +# Create a graph of external dependencies in the given file (report RP0402 must +# not be disabled) +ext-import-graph= + +# Create a graph of every (i.e. internal and external) dependencies in the +# given file (report RP0402 must not be disabled) +import-graph= + +# Create a graph of internal dependencies in the given file (report RP0402 must +# not be disabled) +int-import-graph= + +# Force import order to recognize a module as part of the standard +# compatibility libraries. +known-standard-library= + +# Force import order to recognize a module as part of a third party library. +known-third-party=enchant + + +[EXCEPTIONS] + +# Exceptions that will emit a warning when being caught. Defaults to +# "Exception" +overgeneral-exceptions=Exception diff --git a/poetry.lock b/poetry.lock index 9958dccc..3e019673 100644 --- a/poetry.lock +++ b/poetry.lock @@ -22,6 +22,20 @@ category = "dev" optional = false python-versions = "*" +[[package]] +name = "astroid" +version = "2.8.2" +description = "An abstract syntax tree for Python with inference support." +category = "dev" +optional = false +python-versions = "~=3.6" + +[package.dependencies] +lazy-object-proxy = ">=1.4.0" +typed-ast = {version = ">=1.4.0,<1.5", markers = "implementation_name == \"cpython\" and python_version < \"3.8\""} +typing-extensions = {version = ">=3.10", markers = "python_version < \"3.10\""} +wrapt = ">=1.11,<1.13" + [[package]] name = "atomicwrites" version = "1.4.0" @@ -371,6 +385,14 @@ python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*" [package.dependencies] six = ">=1.4.1" +[[package]] +name = "lazy-object-proxy" +version = "1.6.0" +description = "A fast and thorough lazy object proxy." +category = "dev" +optional = false +python-versions = ">=2.7, !=3.0.*, !=3.1.*, !=3.2.*, !=3.3.*, !=3.4.*, !=3.5.*" + [[package]] name = "lhapdf-management" version = "0.1rc1" @@ -423,6 +445,14 @@ python-versions = ">=3.5" [package.dependencies] traitlets = "*" +[[package]] +name = "mccabe" +version = "0.6.1" +description = "McCabe checker, plugin for flake8" +category = "dev" +optional = false +python-versions = "*" + [[package]] name = "more-itertools" version = "8.10.0" @@ -677,6 +707,23 @@ category = "main" optional = false python-versions = ">=3.5" +[[package]] +name = "pylint" +version = "2.11.1" +description = "python code static checker" +category = "dev" +optional = false +python-versions = "~=3.6" + +[package.dependencies] +astroid = ">=2.8.0,<2.9" +colorama = {version = "*", markers = "sys_platform == \"win32\""} +isort = ">=4.2.5,<6" +mccabe = ">=0.6,<0.7" +platformdirs = ">=2.2.0" +toml = ">=0.7.1" +typing-extensions = {version = ">=3.10.0", markers = "python_version < \"3.10\""} + [[package]] name = "pyparsing" version = "2.4.7" @@ -952,6 +999,14 @@ python-versions = ">=3.5" lint = ["flake8", "mypy", "docutils-stubs"] test = ["pytest"] +[[package]] +name = "toml" +version = "0.10.2" +description = "Python Library for Tom's Obvious, Minimal Language" +category = "dev" +optional = false +python-versions = ">=2.6, !=3.0.*, !=3.1.*, !=3.2.*" + [[package]] name = "tomli" version = "1.2.1" @@ -1032,6 +1087,14 @@ category = "dev" optional = false python-versions = "*" +[[package]] +name = "wrapt" +version = "1.12.1" +description = "Module for decorators, wrappers and monkey patching." +category = "dev" +optional = false +python-versions = "*" + [[package]] name = "yadism" version = "0.7.0" @@ -1063,7 +1126,7 @@ testing = ["pytest (>=4.6)", "pytest-checkdocs (>=2.4)", "pytest-flake8", "pytes [metadata] lock-version = "1.1" python-versions = ">=3.7.1,<3.10" -content-hash = "e2232d8b6e7f48d08980c6ec117d301de03e4814f902e2f6562604a893188274" +content-hash = "7e04dd3a905cbbd95e4a298451e060d4f117476848f7ff88eb4b92cf842c0579" [metadata.files] a3b2bbc3ced97675ac3a71df45f55ba = [ @@ -1083,6 +1146,10 @@ appnope = [ {file = "appnope-0.1.2-py2.py3-none-any.whl", hash = "sha256:93aa393e9d6c54c5cd570ccadd8edad61ea0c4b9ea7a01409020c9aa019eb442"}, {file = "appnope-0.1.2.tar.gz", hash = "sha256:dd83cd4b5b460958838f6eb3000c660b1f9caf2a5b1de4264e941512f603258a"}, ] +astroid = [ + {file = "astroid-2.8.2-py3-none-any.whl", hash = "sha256:9eaeaf92b3e21b70bec1a262e7eb118d2e96294892a5de595c92a12adc80dfc2"}, + {file = "astroid-2.8.2.tar.gz", hash = "sha256:304e99c129794f2cfda584a12b71fde85205da950e2f330f4be09150525ae949"}, +] atomicwrites = [ {file = "atomicwrites-1.4.0-py2.py3-none-any.whl", hash = "sha256:6d1784dea7c0c8d4a5172b6c620f40b6e4cbfdf96d783691f2e1302a7b88e197"}, {file = "atomicwrites-1.4.0.tar.gz", hash = "sha256:ae70396ad1a434f9c7046fd2dd196fc04b12f9e91ffb859164193be8b6168a7a"}, @@ -1247,6 +1314,30 @@ latexcodec = [ {file = "latexcodec-2.0.1-py2.py3-none-any.whl", hash = "sha256:c277a193638dc7683c4c30f6684e3db728a06efb0dc9cf346db8bd0aa6c5d271"}, {file = "latexcodec-2.0.1.tar.gz", hash = "sha256:2aa2551c373261cefe2ad3a8953a6d6533e68238d180eb4bb91d7964adb3fe9a"}, ] +lazy-object-proxy = [ + {file = "lazy-object-proxy-1.6.0.tar.gz", hash = "sha256:489000d368377571c6f982fba6497f2aa13c6d1facc40660963da62f5c379726"}, + {file = "lazy_object_proxy-1.6.0-cp27-cp27m-macosx_10_14_x86_64.whl", hash = "sha256:c6938967f8528b3668622a9ed3b31d145fab161a32f5891ea7b84f6b790be05b"}, + {file = "lazy_object_proxy-1.6.0-cp27-cp27m-win32.whl", hash = "sha256:ebfd274dcd5133e0afae738e6d9da4323c3eb021b3e13052d8cbd0e457b1256e"}, + {file = "lazy_object_proxy-1.6.0-cp27-cp27m-win_amd64.whl", hash = "sha256:ed361bb83436f117f9917d282a456f9e5009ea12fd6de8742d1a4752c3017e93"}, + {file = "lazy_object_proxy-1.6.0-cp27-cp27mu-manylinux1_x86_64.whl", hash = "sha256:d900d949b707778696fdf01036f58c9876a0d8bfe116e8d220cfd4b15f14e741"}, + {file = "lazy_object_proxy-1.6.0-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:5743a5ab42ae40caa8421b320ebf3a998f89c85cdc8376d6b2e00bd12bd1b587"}, + {file = "lazy_object_proxy-1.6.0-cp36-cp36m-manylinux2014_aarch64.whl", hash = "sha256:bf34e368e8dd976423396555078def5cfc3039ebc6fc06d1ae2c5a65eebbcde4"}, + {file = "lazy_object_proxy-1.6.0-cp36-cp36m-win32.whl", hash = "sha256:b579f8acbf2bdd9ea200b1d5dea36abd93cabf56cf626ab9c744a432e15c815f"}, + {file = "lazy_object_proxy-1.6.0-cp36-cp36m-win_amd64.whl", hash = "sha256:4f60460e9f1eb632584c9685bccea152f4ac2130e299784dbaf9fae9f49891b3"}, + {file = "lazy_object_proxy-1.6.0-cp37-cp37m-manylinux1_x86_64.whl", hash = "sha256:d7124f52f3bd259f510651450e18e0fd081ed82f3c08541dffc7b94b883aa981"}, + {file = "lazy_object_proxy-1.6.0-cp37-cp37m-manylinux2014_aarch64.whl", hash = "sha256:22ddd618cefe54305df49e4c069fa65715be4ad0e78e8d252a33debf00f6ede2"}, + {file = "lazy_object_proxy-1.6.0-cp37-cp37m-win32.whl", hash = "sha256:9d397bf41caad3f489e10774667310d73cb9c4258e9aed94b9ec734b34b495fd"}, + {file = "lazy_object_proxy-1.6.0-cp37-cp37m-win_amd64.whl", hash = "sha256:24a5045889cc2729033b3e604d496c2b6f588c754f7a62027ad4437a7ecc4837"}, + {file = "lazy_object_proxy-1.6.0-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:17e0967ba374fc24141738c69736da90e94419338fd4c7c7bef01ee26b339653"}, + {file = "lazy_object_proxy-1.6.0-cp38-cp38-manylinux2014_aarch64.whl", hash = "sha256:410283732af311b51b837894fa2f24f2c0039aa7f220135192b38fcc42bd43d3"}, + {file = "lazy_object_proxy-1.6.0-cp38-cp38-win32.whl", hash = "sha256:85fb7608121fd5621cc4377a8961d0b32ccf84a7285b4f1d21988b2eae2868e8"}, + {file = "lazy_object_proxy-1.6.0-cp38-cp38-win_amd64.whl", hash = "sha256:d1c2676e3d840852a2de7c7d5d76407c772927addff8d742b9808fe0afccebdf"}, + {file = "lazy_object_proxy-1.6.0-cp39-cp39-macosx_10_14_x86_64.whl", hash = "sha256:b865b01a2e7f96db0c5d12cfea590f98d8c5ba64ad222300d93ce6ff9138bcad"}, + {file = "lazy_object_proxy-1.6.0-cp39-cp39-manylinux1_x86_64.whl", hash = "sha256:4732c765372bd78a2d6b2150a6e99d00a78ec963375f236979c0626b97ed8e43"}, + {file = "lazy_object_proxy-1.6.0-cp39-cp39-manylinux2014_aarch64.whl", hash = "sha256:9698110e36e2df951c7c36b6729e96429c9c32b3331989ef19976592c5f3c77a"}, + {file = "lazy_object_proxy-1.6.0-cp39-cp39-win32.whl", hash = "sha256:1fee665d2638491f4d6e55bd483e15ef21f6c8c2095f235fef72601021e64f61"}, + {file = "lazy_object_proxy-1.6.0-cp39-cp39-win_amd64.whl", hash = "sha256:f5144c75445ae3ca2057faac03fda5a902eff196702b0a24daf1d6ce0650514b"}, +] lhapdf-management = [ {file = "lhapdf_management-0.1rc1-1-py3-none-any.whl", hash = "sha256:271ab7002aba5b7089562eb6c6ff1d941d209099e3cecfcb0cde0c89e86a07aa"}, ] @@ -1366,6 +1457,10 @@ matplotlib-inline = [ {file = "matplotlib-inline-0.1.3.tar.gz", hash = "sha256:a04bfba22e0d1395479f866853ec1ee28eea1485c1d69a6faf00dc3e24ff34ee"}, {file = "matplotlib_inline-0.1.3-py3-none-any.whl", hash = "sha256:aed605ba3b72462d64d475a21a9296f400a19c4f74a31b59103d2a99ffd5aa5c"}, ] +mccabe = [ + {file = "mccabe-0.6.1-py2.py3-none-any.whl", hash = "sha256:ab8a6258860da4b6677da4bd2fe5dc2c659cff31b3ee4f7f5d64e79735b80d42"}, + {file = "mccabe-0.6.1.tar.gz", hash = "sha256:dd8d182285a0fe56bace7f45b5e7d1a6ebcbf524e8f3bd87eb0f125271b8831f"}, +] more-itertools = [ {file = "more-itertools-8.10.0.tar.gz", hash = "sha256:1debcabeb1df793814859d64a81ad7cb10504c24349368ccf214c664c474f41f"}, {file = "more_itertools-8.10.0-py3-none-any.whl", hash = "sha256:56ddac45541718ba332db05f464bebfb0768110111affd27f66e0051f276fa43"}, @@ -1561,6 +1656,10 @@ pygments = [ {file = "Pygments-2.10.0-py3-none-any.whl", hash = "sha256:b8e67fe6af78f492b3c4b3e2970c0624cbf08beb1e493b2c99b9fa1b67a20380"}, {file = "Pygments-2.10.0.tar.gz", hash = "sha256:f398865f7eb6874156579fdf36bc840a03cab64d1cde9e93d68f46a425ec52c6"}, ] +pylint = [ + {file = "pylint-2.11.1-py3-none-any.whl", hash = "sha256:0f358e221c45cbd4dad2a1e4b883e75d28acdcccd29d40c76eb72b307269b126"}, + {file = "pylint-2.11.1.tar.gz", hash = "sha256:2c9843fff1a88ca0ad98a256806c82c5a8f86086e7ccbdb93297d86c3f90c436"}, +] pyparsing = [ {file = "pyparsing-2.4.7-py2.py3-none-any.whl", hash = "sha256:ef9d7589ef3c200abe66653d3f1ab1033c3c419ae9b9bdb1240a85b024efc88b"}, {file = "pyparsing-2.4.7.tar.gz", hash = "sha256:c203ec8783bf771a155b207279b9bccb8dea02d8f0c9e5f8ead507bc3246ecc1"}, @@ -1732,6 +1831,10 @@ sphinxcontrib-serializinghtml = [ {file = "sphinxcontrib-serializinghtml-1.1.5.tar.gz", hash = "sha256:aa5f6de5dfdf809ef505c4895e51ef5c9eac17d0f287933eb49ec495280b6952"}, {file = "sphinxcontrib_serializinghtml-1.1.5-py2.py3-none-any.whl", hash = "sha256:352a9a00ae864471d3a7ead8d7d79f5fc0b57e8b3f95e9867eb9eb28999b92fd"}, ] +toml = [ + {file = "toml-0.10.2-py2.py3-none-any.whl", hash = "sha256:806143ae5bfb6a3c6e736a764057db0e6a0e05e338b5630894a5f779cabb4f9b"}, + {file = "toml-0.10.2.tar.gz", hash = "sha256:b3bda1d108d5dd99f4a20d24d9c348e91c4db7ab1b749200bded2f839ccbe68f"}, +] tomli = [ {file = "tomli-1.2.1-py3-none-any.whl", hash = "sha256:8dd0e9524d6f386271a36b41dbf6c57d8e32fd96fd22b6584679dc569d20899f"}, {file = "tomli-1.2.1.tar.gz", hash = "sha256:a5b75cb6f3968abb47af1b40c1819dc519ea82bcc065776a866e8d74c5ca9442"}, @@ -1792,6 +1895,9 @@ wcwidth = [ wmctrl = [ {file = "wmctrl-0.4.tar.gz", hash = "sha256:66cbff72b0ca06a22ec3883ac3a4d7c41078bdae4fb7310f52951769b10e14e0"}, ] +wrapt = [ + {file = "wrapt-1.12.1.tar.gz", hash = "sha256:b62ffa81fb85f4332a4f609cab4ac40709470da05643a082ec1eb88e6d9b97d7"}, +] yadism = [ {file = "yadism-0.7.0-py3-none-any.whl", hash = "sha256:5da4afecfd52796318b572e399807537a7784c8398df298e947fa330e71f62fc"}, ] diff --git a/pyproject.toml b/pyproject.toml index d7c0bf43..054aa821 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -31,6 +31,7 @@ ipython = "^7.28.0" Sphinx = "^4.2.0" sphinx-rtd-theme = "^1.0.0" sphinxcontrib-bibtex = "^2.4.1" +pylint = "^2.11.1" [tool.poetry.scripts] rr = "runcardsrunner:cli" diff --git a/runcardsrunner/__init__.py b/runcardsrunner/__init__.py index 58903acf..634f72c9 100644 --- a/runcardsrunner/__init__.py +++ b/runcardsrunner/__init__.py @@ -3,7 +3,7 @@ import click from .merge import merge -from .run import run +from .run import subcommand as run from .update import update diff --git a/runcardsrunner/external/interface.py b/runcardsrunner/external/interface.py index e4dec7ac..82a4c64f 100644 --- a/runcardsrunner/external/interface.py +++ b/runcardsrunner/external/interface.py @@ -15,6 +15,8 @@ class External(abc.ABC): ---------- name : str dataset name + theory : dict + theory dictionary pdf : str PDF name timestamp : str @@ -22,8 +24,9 @@ class External(abc.ABC): """ - def __init__(self, name, pdf, timestamp=None): + def __init__(self, name, theory, pdf, timestamp=None): self.name = name + self.theory = theory self.pdf = pdf self.timestamp = timestamp diff --git a/runcardsrunner/external/mg5.py b/runcardsrunner/external/mg5.py index 1869d943..c8396bea 100644 --- a/runcardsrunner/external/mg5.py +++ b/runcardsrunner/external/mg5.py @@ -58,6 +58,7 @@ def run(self): # TODO: write a list with variables that should be replaced in the launch file; for the time # being we create the file here, but in the future it should be read from the theory database + # EDIT: now available in self.theory variables = json.loads((paths.pkg / "variables.json").read_text()) # replace the variables with their values diff --git a/runcardsrunner/external/yad.py b/runcardsrunner/external/yad.py index a9ec9dea..3aa4dd7f 100644 --- a/runcardsrunner/external/yad.py +++ b/runcardsrunner/external/yad.py @@ -18,13 +18,11 @@ def run(self): print("Running yadism...") # load runcards - with open(paths.pkg / "theory.yaml") as t: - theory = yaml.safe_load(t) with open(paths.runcards / self.name / "observable.yaml") as o: obs = yaml.safe_load(o) # run yadism - out = yadism.run_yadism(theory, obs) + out = yadism.run_yadism(self.theory, obs) # dump pineappl out.dump_pineappl_to_file(str(self.grid), next(iter(obs["observables"].keys()))) diff --git a/runcardsrunner/run.py b/runcardsrunner/run.py index 13c52711..4e8b6367 100644 --- a/runcardsrunner/run.py +++ b/runcardsrunner/run.py @@ -3,17 +3,48 @@ import click import rich +import yaml from . import install, table, tools from .external import mg5, yad -@click.command() +@click.command("run") @click.argument("dataset") +@click.argument("theory_path", type=click.Path(exists=True)) @click.option("--pdf", default="NNPDF31_nlo_as_0118_luxqed") -def run(dataset, pdf): - """Compute a dataset and compare using a given PDF.""" +def subcommand(dataset, theory_path, pdf): + """ + Compute a dataset and compare using a given PDF. + + Parameters + ---------- + dataset : str + dataset name + theory_path : str + path to theory runcard + pdf : str + pdf name + """ + # read theory card from file + with open(theory_path) as f: + theory_card = yaml.safe_load(f) + run(dataset, theory_card, pdf) + +def run(dataset, theory, pdf): + """ + Compute a dataset and compare using a given PDF. + + Parameters + ---------- + dataset : str + dataset name + theory : dict + theory dictionary + pdf : str + pdf name + """ dataset = pathlib.Path(dataset).name timestamp = None @@ -30,10 +61,10 @@ def run(dataset, pdf): if tools.is_dis(dataset): rich.print(f"Computing [red]{dataset}[/]...") - runner = yad.Yadism(dataset, pdf, timestamp=timestamp) + runner = yad.Yadism(dataset, theory, pdf, timestamp=timestamp) else: rich.print(f"Computing [blue]{dataset}[/]...") - runner = mg5.Mg5(dataset, pdf, timestamp=timestamp) + runner = mg5.Mg5(dataset, theory, pdf, timestamp=timestamp) install_reqs(runner, pdf) run_dataset(runner) @@ -41,7 +72,7 @@ def run(dataset, pdf): def install_reqs(runner, pdf): """ - Execute runner and apply common post process. + Install requirements. Parameters ---------- @@ -52,7 +83,7 @@ def install_reqs(runner, pdf): """ # lhapdf_management determine paths at import time, so it is important to # late import it, in particular after `.path` module has been imported - import lhapdf_management # pylint: disable=import-outside-toplevel + import lhapdf_management # pylint: disable=import-error,import-outside-toplevel t0 = time.perf_counter() diff --git a/runcardsrunner/theory.yaml b/runcardsrunner/theory.yaml deleted file mode 100644 index 2abf778d..00000000 --- a/runcardsrunner/theory.yaml +++ /dev/null @@ -1,43 +0,0 @@ -CKM: "0.97428 0.22530 0.003470 0.22520 0.97345 0.041000 0.00862 0.04030 0.999152" -Comments: "LO baseline for small-x res" -DAMP: 0 -EScaleVar: 1 -FNS: ZM-VFNS -GF: 1.1663787e-05 -HQ: POLE -IC: 0 -ID: 0 -MP: 0.938 -MW: 80.398 -MZ: 91.1876 -MaxNfAs: 6 -MaxNfPdf: 6 -ModEv: EXA -NfFF: 3 -PTO: 1 -Q0: 1.0 -QED: 0 -Qedref: 1.777 -Qmb: 4.5 -Qmc: 2.0 -Qmt: 173.07 -Qref: 91.2 -SIN2TW: 0.23126 -SxOrd: LL -SxRes: 0 -TMC: 0 -XIF: 1.0 -XIR: 1.0 -alphaqed: 0.007496251999999999 -alphas: 0.11800000000000001 -fact_to_ren_scale_ratio: 1.0 -global_nx: 0 -kDISbThr: 1.0 -kDIScThr: 1.0 -kDIStThr: 1.0 -kbThr: 1.0 -kcThr: 1.0 -ktThr: 1.0 -mb: 4.5 -mc: 2.0 -mt: 173.07 diff --git a/theories/theory_200.yaml b/theories/theory_200.yaml new file mode 100644 index 00000000..525351db --- /dev/null +++ b/theories/theory_200.yaml @@ -0,0 +1,45 @@ +CKM: 0.97428 0.22530 0.003470 0.22520 0.97345 0.041000 0.00862 0.04030 0.999152 +Comments: NNPDF4.0 NNLO alphas=0.118 +DAMP: 0 +EScaleVar: 1 +FNS: FONLL-C +GF: 1.1663787e-05 +HQ: POLE +IC: 1 +IB: 0 +ID: 200 +MP: 0.938 +MW: 80.398 +MZ: 91.1876 +MaxNfAs: 5 +MaxNfPdf: 5 +ModEv: TRN +NfFF: 5 +PTO: 2 +Q0: 1.65 +QED: 0 +Qedref: 1.777 +Qmb: 4.92 +Qmc: 1.51 +Qmt: 172.5 +Qref: 91.2 +SIN2TW: 0.23126 +SxOrd: LL +SxRes: 0 +TMC: 1 +XIF: 1.0 +XIR: 1.0 +alphaqed: 0.007496252 +alphas: 0.118 +global_nx: 0 +kbThr: 1.0 +kcThr: 1.0 +ktThr: 1.0 +mb: 4.92 +mc: 1.51 +mt: 172.5 +nfref: null +fact_to_ren_scale_ratio: 1.0 +kDISbThr: 1.0 +kDIScThr: 1.0 +kDIStThr: 1.0 diff --git a/theories/theory_213.yaml b/theories/theory_213.yaml new file mode 100644 index 00000000..9335a79d --- /dev/null +++ b/theories/theory_213.yaml @@ -0,0 +1,45 @@ +CKM: 0.97428 0.22530 0.003470 0.22520 0.97345 0.041000 0.00862 0.04030 0.999152 +Comments: NNPDF4.0 LO fitted charm, alphas=0.118 +DAMP: 0 +EScaleVar: 1 +FNS: ZM-VFNS +GF: 1.1663787e-05 +HQ: POLE +IC: 1 +IB: 0 +ID: 213 +MP: 0.938 +MW: 80.398 +MZ: 91.1876 +MaxNfAs: 5 +MaxNfPdf: 5 +ModEv: TRN +NfFF: 5 +PTO: 0 +Q0: 1.65 +QED: 0 +Qedref: 1.777 +Qmb: 4.92 +Qmc: 1.51 +Qmt: 172.5 +Qref: 91.2 +SIN2TW: 0.23126 +SxOrd: LL +SxRes: 0 +TMC: 1 +XIF: 1.0 +XIR: 1.0 +alphaqed: 0.007496252 +alphas: 0.118 +global_nx: 0 +kbThr: 1.0 +kcThr: 1.0 +ktThr: 1.0 +mb: 4.92 +mc: 1.51 +mt: 172.5 +nfref: null +fact_to_ren_scale_ratio: 1.0 +kDISbThr: 1.0 +kDIScThr: 1.0 +kDIStThr: 1.0 From 287ca0d7c274fe7df43df75c5558bd6129c92557 Mon Sep 17 00:00:00 2001 From: Alessandro Candido Date: Thu, 7 Oct 2021 17:50:36 +0200 Subject: [PATCH 55/63] Add explicit cached_property installation for python less than 3.7 --- rr | 32 +++++++++++++++++++++++++------- 1 file changed, 25 insertions(+), 7 deletions(-) diff --git a/rr b/rr index 86b3075c..2471b000 100755 --- a/rr +++ b/rr @@ -69,7 +69,24 @@ def repo_management(pipx, user): subprocess.run(f"pip install{user} pre-commit".split()) +def update_path(): + """ + Since in some environments the User Scripts Directory (PEP-370) is not part + of the path, let's include it to make user to be able to run `poetry`. + + (for `pre-commit` the user will have to do on its own, since it's not run by + this script) + """ + scripts_base_dir = ( + site.getuserbase() + "/bin" + if not sys.platform.startswith("win") + else r"\Scripts" + ) + os.environ["PATH"] += os.pathsep + str(scripts_base_dir) + + if __name__ == "__main__": + update_path() if sys.argv[1] != "install": subprocess.run("poetry run rr".split() + sys.argv[1:]) else: @@ -87,12 +104,13 @@ if __name__ == "__main__": user = " --user" if args.user else "" repo_management(pipx, user) - scripts_base_dir = ( - site.getuserbase() + "/bin" - if not sys.platform.startswith("win") - else r"\Scripts" - ) - os.environ["PATH"] += os.pathsep + str(scripts_base_dir) - subprocess.run("poetry install".split()) + if sys.version_info < (3, 8): + env_path = ( + subprocess.run("poetry env info -p".split(), capture_output=True) + .stdout.decode() + .strip() + ) + python_exe = pathlib.Path(env_path).absolute() / "bin" / "python" + subprocess.run(f"{python_exe} -m pip install cached_property".split()) subprocess.run("pre-commit install".split()) From 8c979a28f66707c71685209b20713bcfdc2c93af Mon Sep 17 00:00:00 2001 From: Felix Hekhorn Date: Thu, 7 Oct 2021 18:00:09 +0200 Subject: [PATCH 56/63] Resolve some name clash --- runcardsrunner/__init__.py | 4 ++-- runcardsrunner/run.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/runcardsrunner/__init__.py b/runcardsrunner/__init__.py index 634f72c9..b84f6683 100644 --- a/runcardsrunner/__init__.py +++ b/runcardsrunner/__init__.py @@ -3,7 +3,7 @@ import click from .merge import merge -from .run import subcommand as run +from .run import subcommand as sc_run from .update import update @@ -13,5 +13,5 @@ def cli(): cli.add_command(merge) -cli.add_command(run) +cli.add_command(sc_run) cli.add_command(update) diff --git a/runcardsrunner/run.py b/runcardsrunner/run.py index 4e8b6367..5cee75f1 100644 --- a/runcardsrunner/run.py +++ b/runcardsrunner/run.py @@ -29,10 +29,10 @@ def subcommand(dataset, theory_path, pdf): # read theory card from file with open(theory_path) as f: theory_card = yaml.safe_load(f) - run(dataset, theory_card, pdf) + main(dataset, theory_card, pdf) -def run(dataset, theory, pdf): +def main(dataset, theory, pdf): """ Compute a dataset and compare using a given PDF. From 15f33fc9f7d99638f5b73765f5e793ea2fbef1b4 Mon Sep 17 00:00:00 2001 From: Christopher Schwan Date: Thu, 7 Oct 2021 18:06:32 +0200 Subject: [PATCH 57/63] Fix finding the Python interpreter --- rr | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/rr b/rr index 2471b000..0454baa6 100755 --- a/rr +++ b/rr @@ -106,11 +106,6 @@ if __name__ == "__main__": subprocess.run("poetry install".split()) if sys.version_info < (3, 8): - env_path = ( - subprocess.run("poetry env info -p".split(), capture_output=True) - .stdout.decode() - .strip() - ) - python_exe = pathlib.Path(env_path).absolute() / "bin" / "python" + python_exe = sys.executable subprocess.run(f"{python_exe} -m pip install cached_property".split()) subprocess.run("pre-commit install".split()) From c0e0d83eaa94b5a50f5af1567eb4d7df745a4f8a Mon Sep 17 00:00:00 2001 From: Felix Hekhorn Date: Thu, 7 Oct 2021 18:09:48 +0200 Subject: [PATCH 58/63] Try again on name clash --- runcardsrunner/__init__.py | 2 +- runcardsrunner/{run.py => runm.py} | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename runcardsrunner/{run.py => runm.py} (100%) diff --git a/runcardsrunner/__init__.py b/runcardsrunner/__init__.py index b84f6683..912e6263 100644 --- a/runcardsrunner/__init__.py +++ b/runcardsrunner/__init__.py @@ -3,7 +3,7 @@ import click from .merge import merge -from .run import subcommand as sc_run +from .runm import subcommand as sc_run from .update import update diff --git a/runcardsrunner/run.py b/runcardsrunner/runm.py similarity index 100% rename from runcardsrunner/run.py rename to runcardsrunner/runm.py From f7c0cd77efce10db913d2052cccc74df57741a31 Mon Sep 17 00:00:00 2001 From: Alessandro Candido Date: Thu, 7 Oct 2021 19:52:34 +0200 Subject: [PATCH 59/63] Revert "Fix finding the Python interpreter" This reverts commit 15f33fc9f7d99638f5b73765f5e793ea2fbef1b4. --- rr | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/rr b/rr index 0454baa6..2471b000 100755 --- a/rr +++ b/rr @@ -106,6 +106,11 @@ if __name__ == "__main__": subprocess.run("poetry install".split()) if sys.version_info < (3, 8): - python_exe = sys.executable + env_path = ( + subprocess.run("poetry env info -p".split(), capture_output=True) + .stdout.decode() + .strip() + ) + python_exe = pathlib.Path(env_path).absolute() / "bin" / "python" subprocess.run(f"{python_exe} -m pip install cached_property".split()) subprocess.run("pre-commit install".split()) From a1971007a4f714045fd35197393022ad2c050d72 Mon Sep 17 00:00:00 2001 From: Alessandro Candido Date: Thu, 7 Oct 2021 20:00:17 +0200 Subject: [PATCH 60/63] Remove interactivity from installation --- poetry.lock | 41 +++------------------------------------ pyproject.toml | 1 - runcardsrunner/install.py | 32 ------------------------------ 3 files changed, 3 insertions(+), 71 deletions(-) diff --git a/poetry.lock b/poetry.lock index 3e019673..dde519de 100644 --- a/poetry.lock +++ b/poetry.lock @@ -288,17 +288,6 @@ docs = ["sphinx", "jaraco.packaging (>=8.2)", "rst.linker (>=1.9)"] perf = ["ipython"] testing = ["pytest (>=4.6)", "pytest-checkdocs (>=2.4)", "pytest-flake8", "pytest-cov", "pytest-enabler (>=1.0.1)", "packaging", "pep517", "pyfakefs", "flufl.flake8", "pytest-perf (>=0.9.2)", "pytest-black (>=0.3.7)", "pytest-mypy", "importlib-resources (>=1.3)"] -[[package]] -name = "inquirerpy" -version = "0.2.4" -description = "Python port of Inquirer.js (A collection of common interactive command-line user interfaces)" -category = "main" -optional = false -python-versions = ">=3.7,<4.0" - -[package.dependencies] -prompt-toolkit = ">=3.0.1,<4.0.0" - [[package]] name = "ipython" version = "7.28.0" @@ -629,7 +618,7 @@ dev = ["pre-commit", "tox"] name = "prompt-toolkit" version = "3.0.20" description = "Library for building powerful interactive command lines in Python" -category = "main" +category = "dev" optional = false python-versions = ">=3.6.2" @@ -1075,7 +1064,7 @@ socks = ["PySocks (>=1.5.6,!=1.5.7,<2.0)"] name = "wcwidth" version = "0.2.5" description = "Measures the displayed width of unicode strings in a terminal" -category = "main" +category = "dev" optional = false python-versions = "*" @@ -1126,7 +1115,7 @@ testing = ["pytest (>=4.6)", "pytest-checkdocs (>=2.4)", "pytest-flake8", "pytes [metadata] lock-version = "1.1" python-versions = ">=3.7.1,<3.10" -content-hash = "7e04dd3a905cbbd95e4a298451e060d4f117476848f7ff88eb4b92cf842c0579" +content-hash = "e8e2f7c9ea980e882989c02b23f04571dc8476e005bdf2310c16d004b0322962" [metadata.files] a3b2bbc3ced97675ac3a71df45f55ba = [ @@ -1290,10 +1279,6 @@ importlib-metadata = [ {file = "importlib_metadata-4.8.1-py3-none-any.whl", hash = "sha256:b618b6d2d5ffa2f16add5697cf57a46c76a56229b0ed1c438322e4e95645bd15"}, {file = "importlib_metadata-4.8.1.tar.gz", hash = "sha256:f284b3e11256ad1e5d03ab86bb2ccd6f5339688ff17a4d797a0fe7df326f23b1"}, ] -inquirerpy = [ - {file = "InquirerPy-0.2.4-py3-none-any.whl", hash = "sha256:051ec6a5f9f7f93f6db6a1bb87a07a5d876cc6cb818b8816f9ba2ae52d43c56b"}, - {file = "InquirerPy-0.2.4.tar.gz", hash = "sha256:22d50a9d7361377b8eb334964b1d52922a7fc8680864139e35fd64a73e71bb65"}, -] ipython = [ {file = "ipython-7.28.0-py3-none-any.whl", hash = "sha256:f16148f9163e1e526f1008d7c8d966d9c15600ca20d1a754287cf96d00ba6f1d"}, {file = "ipython-7.28.0.tar.gz", hash = "sha256:2097be5c814d1b974aea57673176a924c4c8c9583890e7a5f082f547b9975b11"}, @@ -1398,22 +1383,12 @@ lz4 = [ {file = "lz4-3.1.3.tar.gz", hash = "sha256:081ef0a3b5941cb03127f314229a1c78bd70c9c220bb3f4dd80033e707feaa18"}, ] markupsafe = [ - {file = "MarkupSafe-2.0.1-cp310-cp310-macosx_10_9_universal2.whl", hash = "sha256:d8446c54dc28c01e5a2dbac5a25f071f6653e6e40f3a8818e8b45d790fe6ef53"}, - {file = "MarkupSafe-2.0.1-cp310-cp310-macosx_10_9_x86_64.whl", hash = "sha256:36bc903cbb393720fad60fc28c10de6acf10dc6cc883f3e24ee4012371399a38"}, - {file = "MarkupSafe-2.0.1-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:2d7d807855b419fc2ed3e631034685db6079889a1f01d5d9dac950f764da3dad"}, - {file = "MarkupSafe-2.0.1-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:add36cb2dbb8b736611303cd3bfcee00afd96471b09cda130da3581cbdc56a6d"}, - {file = "MarkupSafe-2.0.1-cp310-cp310-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:168cd0a3642de83558a5153c8bd34f175a9a6e7f6dc6384b9655d2697312a646"}, - {file = "MarkupSafe-2.0.1-cp310-cp310-win32.whl", hash = "sha256:99df47edb6bda1249d3e80fdabb1dab8c08ef3975f69aed437cb69d0a5de1e28"}, - {file = "MarkupSafe-2.0.1-cp310-cp310-win_amd64.whl", hash = "sha256:e0f138900af21926a02425cf736db95be9f4af72ba1bb21453432a07f6082134"}, {file = "MarkupSafe-2.0.1-cp36-cp36m-macosx_10_9_x86_64.whl", hash = "sha256:f9081981fe268bd86831e5c75f7de206ef275defcb82bc70740ae6dc507aee51"}, {file = "MarkupSafe-2.0.1-cp36-cp36m-manylinux1_i686.whl", hash = "sha256:0955295dd5eec6cb6cc2fe1698f4c6d84af2e92de33fbcac4111913cd100a6ff"}, {file = "MarkupSafe-2.0.1-cp36-cp36m-manylinux1_x86_64.whl", hash = "sha256:0446679737af14f45767963a1a9ef7620189912317d095f2d9ffa183a4d25d2b"}, {file = "MarkupSafe-2.0.1-cp36-cp36m-manylinux2010_i686.whl", hash = "sha256:f826e31d18b516f653fe296d967d700fddad5901ae07c622bb3705955e1faa94"}, {file = "MarkupSafe-2.0.1-cp36-cp36m-manylinux2010_x86_64.whl", hash = "sha256:fa130dd50c57d53368c9d59395cb5526eda596d3ffe36666cd81a44d56e48872"}, {file = "MarkupSafe-2.0.1-cp36-cp36m-manylinux2014_aarch64.whl", hash = "sha256:905fec760bd2fa1388bb5b489ee8ee5f7291d692638ea5f67982d968366bef9f"}, - {file = "MarkupSafe-2.0.1-cp36-cp36m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:bf5d821ffabf0ef3533c39c518f3357b171a1651c1ff6827325e4489b0e46c3c"}, - {file = "MarkupSafe-2.0.1-cp36-cp36m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:0d4b31cc67ab36e3392bbf3862cfbadac3db12bdd8b02a2731f509ed5b829724"}, - {file = "MarkupSafe-2.0.1-cp36-cp36m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:baa1a4e8f868845af802979fcdbf0bb11f94f1cb7ced4c4b8a351bb60d108145"}, {file = "MarkupSafe-2.0.1-cp36-cp36m-win32.whl", hash = "sha256:6c4ca60fa24e85fe25b912b01e62cb969d69a23a5d5867682dd3e80b5b02581d"}, {file = "MarkupSafe-2.0.1-cp36-cp36m-win_amd64.whl", hash = "sha256:b2f4bf27480f5e5e8ce285a8c8fd176c0b03e93dcc6646477d4630e83440c6a9"}, {file = "MarkupSafe-2.0.1-cp37-cp37m-macosx_10_9_x86_64.whl", hash = "sha256:0717a7390a68be14b8c793ba258e075c6f4ca819f15edfc2a3a027c823718567"}, @@ -1422,21 +1397,14 @@ markupsafe = [ {file = "MarkupSafe-2.0.1-cp37-cp37m-manylinux2010_i686.whl", hash = "sha256:d7f9850398e85aba693bb640262d3611788b1f29a79f0c93c565694658f4071f"}, {file = "MarkupSafe-2.0.1-cp37-cp37m-manylinux2010_x86_64.whl", hash = "sha256:6a7fae0dd14cf60ad5ff42baa2e95727c3d81ded453457771d02b7d2b3f9c0c2"}, {file = "MarkupSafe-2.0.1-cp37-cp37m-manylinux2014_aarch64.whl", hash = "sha256:b7f2d075102dc8c794cbde1947378051c4e5180d52d276987b8d28a3bd58c17d"}, - {file = "MarkupSafe-2.0.1-cp37-cp37m-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:e9936f0b261d4df76ad22f8fee3ae83b60d7c3e871292cd42f40b81b70afae85"}, - {file = "MarkupSafe-2.0.1-cp37-cp37m-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:2a7d351cbd8cfeb19ca00de495e224dea7e7d919659c2841bbb7f420ad03e2d6"}, - {file = "MarkupSafe-2.0.1-cp37-cp37m-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:60bf42e36abfaf9aff1f50f52644b336d4f0a3fd6d8a60ca0d054ac9f713a864"}, {file = "MarkupSafe-2.0.1-cp37-cp37m-win32.whl", hash = "sha256:a30e67a65b53ea0a5e62fe23682cfe22712e01f453b95233b25502f7c61cb415"}, {file = "MarkupSafe-2.0.1-cp37-cp37m-win_amd64.whl", hash = "sha256:611d1ad9a4288cf3e3c16014564df047fe08410e628f89805e475368bd304914"}, - {file = "MarkupSafe-2.0.1-cp38-cp38-macosx_10_9_universal2.whl", hash = "sha256:5bb28c636d87e840583ee3adeb78172efc47c8b26127267f54a9c0ec251d41a9"}, {file = "MarkupSafe-2.0.1-cp38-cp38-macosx_10_9_x86_64.whl", hash = "sha256:be98f628055368795d818ebf93da628541e10b75b41c559fdf36d104c5787066"}, {file = "MarkupSafe-2.0.1-cp38-cp38-manylinux1_i686.whl", hash = "sha256:1d609f577dc6e1aa17d746f8bd3c31aa4d258f4070d61b2aa5c4166c1539de35"}, {file = "MarkupSafe-2.0.1-cp38-cp38-manylinux1_x86_64.whl", hash = "sha256:7d91275b0245b1da4d4cfa07e0faedd5b0812efc15b702576d103293e252af1b"}, {file = "MarkupSafe-2.0.1-cp38-cp38-manylinux2010_i686.whl", hash = "sha256:01a9b8ea66f1658938f65b93a85ebe8bc016e6769611be228d797c9d998dd298"}, {file = "MarkupSafe-2.0.1-cp38-cp38-manylinux2010_x86_64.whl", hash = "sha256:47ab1e7b91c098ab893b828deafa1203de86d0bc6ab587b160f78fe6c4011f75"}, {file = "MarkupSafe-2.0.1-cp38-cp38-manylinux2014_aarch64.whl", hash = "sha256:97383d78eb34da7e1fa37dd273c20ad4320929af65d156e35a5e2d89566d9dfb"}, - {file = "MarkupSafe-2.0.1-cp38-cp38-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:6fcf051089389abe060c9cd7caa212c707e58153afa2c649f00346ce6d260f1b"}, - {file = "MarkupSafe-2.0.1-cp38-cp38-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:5855f8438a7d1d458206a2466bf82b0f104a3724bf96a1c781ab731e4201731a"}, - {file = "MarkupSafe-2.0.1-cp38-cp38-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:3dd007d54ee88b46be476e293f48c85048603f5f516008bee124ddd891398ed6"}, {file = "MarkupSafe-2.0.1-cp38-cp38-win32.whl", hash = "sha256:023cb26ec21ece8dc3907c0e8320058b2e0cb3c55cf9564da612bc325bed5e64"}, {file = "MarkupSafe-2.0.1-cp38-cp38-win_amd64.whl", hash = "sha256:984d76483eb32f1bcb536dc27e4ad56bba4baa70be32fa87152832cdd9db0833"}, {file = "MarkupSafe-2.0.1-cp39-cp39-macosx_10_9_universal2.whl", hash = "sha256:2ef54abee730b502252bcdf31b10dacb0a416229b72c18b19e24a4509f273d26"}, @@ -1446,9 +1414,6 @@ markupsafe = [ {file = "MarkupSafe-2.0.1-cp39-cp39-manylinux2010_i686.whl", hash = "sha256:4efca8f86c54b22348a5467704e3fec767b2db12fc39c6d963168ab1d3fc9135"}, {file = "MarkupSafe-2.0.1-cp39-cp39-manylinux2010_x86_64.whl", hash = "sha256:ab3ef638ace319fa26553db0624c4699e31a28bb2a835c5faca8f8acf6a5a902"}, {file = "MarkupSafe-2.0.1-cp39-cp39-manylinux2014_aarch64.whl", hash = "sha256:f8ba0e8349a38d3001fae7eadded3f6606f0da5d748ee53cc1dab1d6527b9509"}, - {file = "MarkupSafe-2.0.1-cp39-cp39-manylinux_2_17_aarch64.manylinux2014_aarch64.whl", hash = "sha256:c47adbc92fc1bb2b3274c4b3a43ae0e4573d9fbff4f54cd484555edbf030baf1"}, - {file = "MarkupSafe-2.0.1-cp39-cp39-manylinux_2_5_i686.manylinux1_i686.manylinux_2_12_i686.manylinux2010_i686.whl", hash = "sha256:37205cac2a79194e3750b0af2a5720d95f786a55ce7df90c3af697bfa100eaac"}, - {file = "MarkupSafe-2.0.1-cp39-cp39-manylinux_2_5_x86_64.manylinux1_x86_64.manylinux_2_12_x86_64.manylinux2010_x86_64.whl", hash = "sha256:1f2ade76b9903f39aa442b4aadd2177decb66525062db244b35d71d0ee8599b6"}, {file = "MarkupSafe-2.0.1-cp39-cp39-win32.whl", hash = "sha256:10f82115e21dc0dfec9ab5c0223652f7197feb168c940f3ef61563fc2d6beb74"}, {file = "MarkupSafe-2.0.1-cp39-cp39-win_amd64.whl", hash = "sha256:693ce3f9e70a6cf7d2fb9e6c9d8b204b6b39897a2c4a1aa65728d5ac97dcc1d8"}, {file = "MarkupSafe-2.0.1.tar.gz", hash = "sha256:594c67807fb16238b30c44bdf74f36c02cdf22d1c8cda91ef8a0ed8dabf5620a"}, diff --git a/pyproject.toml b/pyproject.toml index 054aa821..9e9cbcfd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -18,7 +18,6 @@ pkgconfig = "^1.5.5" pygit2 = "^1.6.1" requests = "^2.26.0" a3b2bbc3ced97675ac3a71df45f55ba = "^6.4.0" -inquirerpy = "^0.2.4" lhapdf-management = "^0.1rc1" pineappl = {version = "0.5.0_beta.1", allow-prereleases = true} diff --git a/runcardsrunner/install.py b/runcardsrunner/install.py index 30070a42..55ed3204 100644 --- a/runcardsrunner/install.py +++ b/runcardsrunner/install.py @@ -3,7 +3,6 @@ import subprocess import sys -import InquirerPy import pkgconfig import pygit2 import requests @@ -24,33 +23,6 @@ pineappl_repo = "https://github.com/N3PDF/pineappl.git" -def confirm(name): - """ - Ask for the confirmation to install a given program. - - Parameters - ---------- - name : str - program name - - Returns - ------- - bool : - install the program? - """ - print(f"{name} not found") - questions = [ - { - "type": "confirm", - "name": "install", - "message": "Do you want to install it?", - } - ] - answers = InquirerPy.prompt(questions) - - return answers["install"] - - def mg5amc(): """ Initialize `MadGraph5_aMC@NLO `_. @@ -66,8 +38,6 @@ def mg5amc(): if condition(): print("✓ Found mg5amc") return True - if not confirm("mg5amc"): - return False print("Installing...") @@ -131,8 +101,6 @@ def pineappl(): if condition(): print("✓ Found pineappl") return True - if not confirm("pineappl"): - return False print("Installing...") From 14a263e0a0dc422b88bac04532ca2bc08ca01ee7 Mon Sep 17 00:00:00 2001 From: Alessandro Candido Date: Thu, 7 Oct 2021 20:45:27 +0200 Subject: [PATCH 61/63] Provide LHAPDF installation --- runcardsrunner/external/yad.py | 2 +- runcardsrunner/install.py | 31 ++++++++++++++++++++++++++++++- runcardsrunner/paths.py | 3 ++- 3 files changed, 33 insertions(+), 3 deletions(-) diff --git a/runcardsrunner/external/yad.py b/runcardsrunner/external/yad.py index 3aa4dd7f..369bfb3b 100644 --- a/runcardsrunner/external/yad.py +++ b/runcardsrunner/external/yad.py @@ -12,7 +12,7 @@ class Yadism(interface.External): @staticmethod def install(): - install.lhapdf() + install.lhapdf_conf() def run(self): print("Running yadism...") diff --git a/runcardsrunner/install.py b/runcardsrunner/install.py index 55ed3204..eeb22487 100644 --- a/runcardsrunner/install.py +++ b/runcardsrunner/install.py @@ -2,6 +2,7 @@ import shutil import subprocess import sys +import tarfile import pkgconfig import pygit2 @@ -104,6 +105,9 @@ def pineappl(): print("Installing...") + if not pkgconfig.exists("lhapdf"): + lhapdf() + try: repo = pygit2.Repository(paths.pineappl) tools.git_pull(repo) @@ -130,12 +134,37 @@ def pineappl(): return condition() -def lhapdf(): +def lhapdf_conf(): """Initialize `LHAPDF `_.""" paths.lhapdf_data.mkdir(parents=True, exist_ok=True) shutil.copy2(paths.lhapdf_conf, paths.lhapdf_data) +def lhapdf(): + """Install `LHAPDF `_ C++ library.""" + version = "LHAPDF-6.4.0" + lhapdf_tar = paths.lhapdf_dir / (version + ".tar.gz") + lhapdf_code = paths.lhapdf_dir / version + + paths.lhapdf_dir.mkdir(exist_ok=True) + with requests.get( + f"https://lhapdf.hepforge.org/downloads/?f={lhapdf_tar.name}" + ) as r: + with open(lhapdf_tar, "wb") as f: + f.write(r.content) + + with tarfile.open(lhapdf_tar, "r:gz") as tar: + tar.extractall(paths.lhapdf_dir) + + env = os.environ.copy() + env["PYTHON"] = sys.executable + subprocess.run( + f"./configure --prefix={paths.prefix}".split(), env=env, cwd=lhapdf_code + ) + subprocess.run("make", cwd=lhapdf_code) + subprocess.run("make install".split(), cwd=lhapdf_code) + + def update_environ(): """Adjust necessary environment files.""" diff --git a/runcardsrunner/paths.py b/runcardsrunner/paths.py index 63183b5b..c8735bf2 100644 --- a/runcardsrunner/paths.py +++ b/runcardsrunner/paths.py @@ -23,11 +23,12 @@ mg5_exe = mg5amc / "bin" / "mg5_aMC" pineappl = prefix / "pineappl" cargo = prefix / "cargo" +lhapdf_dir = prefix / "lhapdf" pineappl_exe = lambda: pathlib.Path(shutil.which("pineappl")) # tmp rust_init = pathlib.Path("/tmp/rustup-init") -# lhapdf +# lhapdf data lhapdf_data = prefix / "share" / "LHAPDF" lhapdf.pathsPrepend(str(lhapdf_data)) From 896b38cb2ce718b7fc67735154abc5b620617acc Mon Sep 17 00:00:00 2001 From: Alessandro Candido Date: Fri, 8 Oct 2021 09:47:24 +0200 Subject: [PATCH 62/63] Install poetry with install script --- rr | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/rr b/rr index 2471b000..d79a6208 100755 --- a/rr +++ b/rr @@ -64,9 +64,15 @@ def repo_management(pipx, user): subprocess.run("pipx install pre-commit".split()) else: print("installing management dependecies with pip...") - subprocess.run(f"pip install{user} poetry".split()) - subprocess.run(f"pip install{user} poetry-dynamic-versioning".split()) - subprocess.run(f"pip install{user} pre-commit".split()) + install_poetry_url = "https://raw.githubusercontent.com/python-poetry/poetry/master/install-poetry.py" + pip = f"{sys.executable} -m pip" + + proc = subprocess.run( + f"curl -sSL {install_poetry_url}".split(), capture_output=True + ) + subprocess.run(f"{sys.executable} -".split(), input=proc.stdout) + subprocess.run(f"{pip} install{user} poetry-dynamic-versioning".split()) + subprocess.run(f"{pip} install{user} pre-commit".split()) def update_path(): From d56bd8632996b03da26edc78d2c364022b19b81d Mon Sep 17 00:00:00 2001 From: Christopher Schwan Date: Fri, 8 Oct 2021 11:05:09 +0200 Subject: [PATCH 63/63] Switch Madgraph5 from 3.2.0 to 3.1.2 --- runcardsrunner/install.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/runcardsrunner/install.py b/runcardsrunner/install.py index eeb22487..96ff8385 100644 --- a/runcardsrunner/install.py +++ b/runcardsrunner/install.py @@ -14,7 +14,7 @@ paths.bin.mkdir(exist_ok=True) paths.lib.mkdir(exist_ok=True) -mg5_repo = "lp:~maddevelopers/mg5amcnlo/3.2.0" +mg5_repo = "lp:~maddevelopers/mg5amcnlo/3.1.2" mg5_convert = """ set auto_convert_model True import model loop_qcd_qed_sm_Gmu