Skip to content

Commit

Permalink
Test strict (#149)
Browse files Browse the repository at this point in the history
* Test strict

Fix escape

add master poetry lock

* Allow lhapdf from system

* Fix smpl_io grep

* Proper pytest in pypropject.toml
  • Loading branch information
APN-Pucky authored Oct 16, 2023
1 parent 699949d commit b999040
Show file tree
Hide file tree
Showing 10 changed files with 1,439 additions and 1,658 deletions.
1 change: 0 additions & 1 deletion .github/workflows/devel.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,3 @@ jobs:
with:
test: true
doc: true
ci: true
1 change: 0 additions & 1 deletion .github/workflows/stable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@ jobs:
with:
test: true
doc: true
ci: true
coveralls: true
codacy-api-token: ${{ secrets.CODACY_API_TOKEN }}
# pypi-token: ${{ secrets.pypi_token }}
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ jobs:
with:
test: true
doc: true
ci: true
coveralls: true
codacy-api-token: ${{ secrets.CODACY_API_TOKEN }}
pypi-token: ${{ secrets.pypi_token }}
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/unstable.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ jobs:
with:
test: true
doc: true
ci: true
coveralls: true
codacy-api-token: ${{ secrets.CODACY_API_TOKEN }}
# test-pypi-token: ${{ secrets.test_pypi_token }}
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -24,3 +24,5 @@ docs/source/examples/output
coverage.xml
*.zip
.ipynb_checkpoints
test.json
test.csv
5 changes: 2 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -4,13 +4,12 @@ livehtml:
html:
poetry run $(MAKE) -C docs html

ci:
poetry config virtualenvs.create false

doc: html

install:
poetry install --with docs --with test
# Make lhapdf available in the virtualenv
sed -i 's/include-system-site-packages\s*=.*/include-system-site-packages = true/g' $(shell poetry env info -p)/pyvenv.cfg
python3 -m pip install --user .

build:
Expand Down
4 changes: 2 additions & 2 deletions hepi/output.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,8 @@ def write_csv(dict_list: list, filename: str):
>>> dl = hepi.load(urllib.request.urlopen(
... "https://raw.githubusercontent.com/fuenfundachtzig/xsec/master/json/pp13_hinosplit_N2N1_NLO%2BNLL.json"
... ),dimensions=2)
>>> hepi.write_csv(dl, open("test.csv", 'w'))
>>> with open("test.csv", 'w') as f:
... hepi.write_csv(dl, f)
>>> with open('test.csv', 'r') as f:
... print(f.read())
order,energy,energyhalf,particle1,particle2,slha,pdf_lo,pdfset_lo,pdf_nlo,pdfset_nlo,pdf_lo_id,pdf_nlo_id,mu_f,mu_r,precision,max_iters,invariant_mass,pt,result,id,model,mu,runner,N2,N1,NLO_PLUS_NLL_NOERR,NLO_PLUS_NLL_COMBINED
Expand Down Expand Up @@ -453,7 +454,6 @@ def write_json(
),
}
elif error_sym:

# COMBINED and NOERR are the same mean for sym errors
td = {
"xsec_pb": float(unv(dict_list[so + "_NOERR"].iloc[j])),
Expand Down
3,065 changes: 1,420 additions & 1,645 deletions poetry.lock

Large diffs are not rendered by default.

14 changes: 13 additions & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ smpl = ">=0.0.152"
validators = "*"


lhapdf = {version = "^6", optional = true}
# does not exist on pypi for recent pythons
#lhapdf = {version = "^6", optional = true}


[tool.poetry.scripts]
Expand Down Expand Up @@ -79,3 +80,14 @@ dirty = true
pattern = '(?x)(?# ignore whitespace)^((?P<epoch>\d+)!)?(?P<base>\d+(\.\d+)*)(?# v1.2.3 or v1!2000.1.2)([-._]?((?P<stage>[a-zA-Z]+)[-._]?(?P<revision>\d+)?))?(?# b0)(\+(?P<tagged_metadata>.+))?$(?# +linux)'
strict = true
format-jinja = "{% if distance == 0 %}{{ base }}{% else %}{{ base }}.{{ distance }}{% endif %}"

[tool.pytest.ini_options]
minversion = "6.0"
addopts = [
"-v","--cov=hepi","--cov-config=.coveragerc","--cov-append","--cov-report=term","--cov-report=xml","--doctest-modules","--ignore=docs/source/examples/output/"
]
filterwarnings = [
'error',
'ignore:PDF set .* not installed?:UserWarning',
'ignore: pkg_resources is deprecated as an API:DeprecationWarning',
]
3 changes: 0 additions & 3 deletions pytest.ini

This file was deleted.

0 comments on commit b999040

Please sign in to comment.