-
Notifications
You must be signed in to change notification settings - Fork 383
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Enable testing for resource estimates #828
Changes from all commits
18a3269
ea79a15
c1a50d1
0192f7c
242e4c8
ba7aff6
aaca9a8
e18c047
8cb92ee
02f8ada
ef90ee7
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -89,3 +89,5 @@ ENV/ | |
|
||
# no .dat files | ||
*.dat | ||
|
||
*tmp* |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
[pytest] | ||
markers = | ||
slow: marks tests as slow (deselect with '-m "not slow"') |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
pyscf | ||
jax | ||
jaxlib |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,218 @@ | ||
# | ||
# This file is autogenerated by pip-compile with Python 3.10 | ||
# by the following command: | ||
# | ||
# pip-compile --output-file=resource_estimates.env.txt deps/resource_estimates.txt pytest.env.txt | ||
# | ||
attrs==23.1.0 | ||
# via | ||
# -r pytest.env.txt | ||
# jsonschema | ||
certifi==2023.5.7 | ||
# via | ||
# -r pytest.env.txt | ||
# requests | ||
charset-normalizer==3.1.0 | ||
# via | ||
# -r pytest.env.txt | ||
# requests | ||
cirq-core==1.1.0 | ||
# via -r pytest.env.txt | ||
contourpy==1.0.7 | ||
# via | ||
# -r pytest.env.txt | ||
# matplotlib | ||
coverage[toml]==7.2.5 | ||
# via | ||
# -r pytest.env.txt | ||
# pytest-cov | ||
cycler==0.11.0 | ||
# via | ||
# -r pytest.env.txt | ||
# matplotlib | ||
deprecation==2.1.0 | ||
# via -r pytest.env.txt | ||
duet==0.2.8 | ||
# via | ||
# -r pytest.env.txt | ||
# cirq-core | ||
exceptiongroup==1.1.1 | ||
# via | ||
# -r pytest.env.txt | ||
# pytest | ||
execnet==1.9.0 | ||
# via | ||
# -r pytest.env.txt | ||
# pytest-xdist | ||
fastjsonschema==2.17.1 | ||
# via | ||
# -r pytest.env.txt | ||
# nbformat | ||
fonttools==4.39.4 | ||
# via | ||
# -r pytest.env.txt | ||
# matplotlib | ||
h5py==3.8.0 | ||
# via | ||
# -r pytest.env.txt | ||
# pyscf | ||
idna==3.4 | ||
# via | ||
# -r pytest.env.txt | ||
# requests | ||
iniconfig==2.0.0 | ||
# via | ||
# -r pytest.env.txt | ||
# pytest | ||
jax==0.4.14 | ||
# via -r deps/resource_estimates.txt | ||
jaxlib==0.4.14 | ||
# via -r deps/resource_estimates.txt | ||
jsonschema==4.17.3 | ||
# via | ||
# -r pytest.env.txt | ||
# nbformat | ||
jupyter-core==5.3.0 | ||
# via | ||
# -r pytest.env.txt | ||
# nbformat | ||
kiwisolver==1.4.4 | ||
# via | ||
# -r pytest.env.txt | ||
# matplotlib | ||
matplotlib==3.7.1 | ||
# via | ||
# -r pytest.env.txt | ||
# cirq-core | ||
ml-dtypes==0.2.0 | ||
# via | ||
# jax | ||
# jaxlib | ||
mpmath==1.3.0 | ||
# via | ||
# -r pytest.env.txt | ||
# sympy | ||
nbformat==5.8.0 | ||
# via -r pytest.env.txt | ||
networkx==2.8.8 | ||
# via | ||
# -r pytest.env.txt | ||
# cirq-core | ||
numpy==1.23.5 | ||
# via | ||
# -r pytest.env.txt | ||
# cirq-core | ||
# contourpy | ||
# h5py | ||
# jax | ||
# jaxlib | ||
# matplotlib | ||
# ml-dtypes | ||
# opt-einsum | ||
# pandas | ||
# pyscf | ||
# scipy | ||
opt-einsum==3.3.0 | ||
# via jax | ||
packaging==23.1 | ||
# via | ||
# -r pytest.env.txt | ||
# deprecation | ||
# matplotlib | ||
# pytest | ||
pandas==2.0.1 | ||
# via | ||
# -r pytest.env.txt | ||
# cirq-core | ||
pillow==9.5.0 | ||
# via | ||
# -r pytest.env.txt | ||
# matplotlib | ||
platformdirs==3.5.1 | ||
# via | ||
# -r pytest.env.txt | ||
# jupyter-core | ||
pluggy==1.0.0 | ||
# via | ||
# -r pytest.env.txt | ||
# pytest | ||
pubchempy==1.0.4 | ||
# via -r pytest.env.txt | ||
pyparsing==3.0.9 | ||
# via | ||
# -r pytest.env.txt | ||
# matplotlib | ||
pyrsistent==0.19.3 | ||
# via | ||
# -r pytest.env.txt | ||
# jsonschema | ||
pyscf==2.3.0 | ||
# via -r deps/resource_estimates.txt | ||
pytest==7.3.1 | ||
# via | ||
# -r pytest.env.txt | ||
# pytest-asyncio | ||
# pytest-cov | ||
# pytest-xdist | ||
pytest-asyncio==0.21.0 | ||
# via -r pytest.env.txt | ||
pytest-cov==4.0.0 | ||
# via -r pytest.env.txt | ||
pytest-xdist==3.3.1 | ||
# via -r pytest.env.txt | ||
python-dateutil==2.8.2 | ||
# via | ||
# -r pytest.env.txt | ||
# matplotlib | ||
# pandas | ||
pytz==2023.3 | ||
# via | ||
# -r pytest.env.txt | ||
# pandas | ||
requests==2.31.0 | ||
# via -r pytest.env.txt | ||
scipy==1.9.3 | ||
# via | ||
# -r pytest.env.txt | ||
# cirq-core | ||
# jax | ||
# jaxlib | ||
# pyscf | ||
six==1.16.0 | ||
# via | ||
# -r pytest.env.txt | ||
# python-dateutil | ||
sortedcontainers==2.4.0 | ||
# via | ||
# -r pytest.env.txt | ||
# cirq-core | ||
sympy==1.12 | ||
# via | ||
# -r pytest.env.txt | ||
# cirq-core | ||
tomli==2.0.1 | ||
# via | ||
# -r pytest.env.txt | ||
# coverage | ||
# pytest | ||
tqdm==4.65.0 | ||
# via | ||
# -r pytest.env.txt | ||
# cirq-core | ||
traitlets==5.9.0 | ||
# via | ||
# -r pytest.env.txt | ||
# jupyter-core | ||
# nbformat | ||
typing-extensions==4.6.0 | ||
# via | ||
# -r pytest.env.txt | ||
# cirq-core | ||
tzdata==2023.3 | ||
# via | ||
# -r pytest.env.txt | ||
# pandas | ||
urllib3==2.0.2 | ||
# via | ||
# -r pytest.env.txt | ||
# requests |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
#coverage:ignore | ||
# coverage:ignore | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
|
@@ -10,10 +10,10 @@ | |
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
#coverage: ignore | ||
import pytest | ||
|
||
try: | ||
import jax | ||
import pyscf | ||
except ImportError: | ||
pytest.skip('Need pyscf for resource estimates', allow_module_level=True) | ||
HAVE_DEPS_FOR_RESOURCE_ESTIMATES = True | ||
except ModuleNotFoundError: | ||
fdmalone marked this conversation as resolved.
Show resolved
Hide resolved
|
||
HAVE_DEPS_FOR_RESOURCE_ESTIMATES = False | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. should we re-raise the exception with a helpful error message? presumably if these imports fail something else will give a weird error message when you actually go and try to use any of the functionality There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I don't think so, wouldn't this cause an import error (pytest will error rather than skip the tests) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why is this changed? are you sure?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
$@ splits quoted args on whitespace so the option
-m "not slow"
gets converted to '-m' 'not' 'slow', rather than '-m' 'not slow'. At least I couldn't figure out how to pass in quoted args otherwise. Happy to be schooled on bash though