Skip to content

Commit

Permalink
Fix CI. (#816)
Browse files Browse the repository at this point in the history
* Update scipy version requirements.

v1.10.0 of scipy introduces a bug in the linalg.sqrtm function for
complex valued matrices QuarticFermionicSimulationGate. Restrict maximum
scipy version until this is resolved.

* Change two_body.dtype comparison from numpy.float to numpy.float64.

numpy.float was deprecated in v1.24.0.

* Update ci to use ubuntu-latest.

18.04 was deprecated in April 2023.

See actions/runner-images#6002.
  • Loading branch information
fdmalone committed Apr 20, 2023
1 parent de0290e commit 4ece322
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 15 deletions.
28 changes: 16 additions & 12 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,38 +5,40 @@ on: [pull_request]
jobs:
format:
name: Format check
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-python@v1
with:
python-version: '3.6'
python-version: '3.8'
architecture: 'x64'
- name: Install yapf
run: cat dev_tools/conf/pip-list-dev-tools.txt | grep yapf | xargs pip install
- name: Format
run: check/format-incremental
mypy:
name: Type check
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
- uses: actions/setup-python@v1
with:
python-version: '3.6'
python-version: '3.8'
architecture: 'x64'
- name: Install mypy
run: cat dev_tools/conf/pip-list-dev-tools.txt | grep mypy | xargs pip install
- name: Type check
run: check/mypy
lint:
name: Lint check
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
- uses: actions/setup-python@v1
with:
python-version: '3.6'
python-version: '3.8'
architecture: 'x64'
- name: Install pylint
run: cat dev_tools/conf/pip-list-dev-tools.txt | grep "pylint\|astroid" | grep -v "#" | xargs pip install
Expand Down Expand Up @@ -71,9 +73,11 @@ jobs:
shell: bash
coverage:
name: Coverage check
runs-on: ubuntu-18.04
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-python@v1
with:
python-version: '3.8'
Expand All @@ -85,4 +89,4 @@ jobs:
pip install -r dev_tools/conf/pip-list-dev-tools.txt
git config --global user.name ${GITHUB_ACTOR}
- name: Coverage check
run: check/pytest-and-incremental-coverage --actually-quiet
run: check/pytest-and-incremental-coverage
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ networkx
numpy>=1.11.0
pubchempy
requests>=2.18
scipy>=1.1.0
scipy>=1.1.0,<1.10.0
sympy
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ class DiagonalCoulombHamiltonian:
"""

def __init__(self, one_body, two_body, constant=0.):
if two_body.dtype != numpy.float:
if two_body.dtype != numpy.float64:
raise ValueError('Two-body tensor has invalid dtype. Expected {} '
'but was {}'.format(numpy.float, two_body.dtype))
'but was {}'.format(numpy.float64, two_body.dtype))
if not numpy.allclose(two_body, two_body.T):
raise ValueError('Two-body tensor must be symmetric.')
if not numpy.allclose(one_body, one_body.T.conj()):
Expand Down

0 comments on commit 4ece322

Please sign in to comment.