Skip to content

Commit

Permalink
Depedencies: remove upper limit and allow numpy~=1.17 (#4378)
Browse files Browse the repository at this point in the history
The limit was introduced in `f5d6cba2baf0e7ca69b742f7e76d8a8bbcca85ae`
because of a broken pre-release. Now that a stable release is out, the
requirement is relax to allow newer versions as well. Note that we keep
the minimum requirement of `numpy==1.17` following AEP 003.

One change had to be applied in the code to make it compatible with newer
versions of `numpy`. In the legacy kpoints implementation, the entries
in `num_points` are of type `numpy.float64` for recent versions of
`numpy`, but need to be integers so they can be used for indexing in
`numpy.linspace()` calls.
  • Loading branch information
CasperWA authored Sep 19, 2020
1 parent c6bca06 commit 12be9ad
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 10 deletions.
4 changes: 1 addition & 3 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ jobs:
keys:
- cache-pip

- run: |
pip install numpy==1.17.4
pip install --user .[docs,tests]
- run: pip install --user .[docs,tests]

- save_cache:
key: cache-pip
Expand Down
4 changes: 1 addition & 3 deletions .github/workflows/ci-code.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,9 +136,7 @@ jobs:
python-version: 3.8

- name: Install python dependencies
run: |
pip install numpy==1.17.4
pip install -e .
run: pip install -e .

- name: Run verdi
run: |
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/ci-style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,6 @@ jobs:
- name: Install python dependencies
run: |
pip install numpy==1.17.4
pip install -e .[all]
pip freeze
Expand Down
1 change: 0 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ jobs:

- name: Install python dependencies
run: |
pip install numpy==1.17.4
pip install transifex-client sphinx-intl
pip install -e .[docs,tests]
Expand Down
4 changes: 4 additions & 0 deletions aiida/tools/data/array/kpoints/legacy.py
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,10 @@ def _num_points_from_coordinates(path, point_coordinates, kpoint_distance=None):
explicit_kpoints = [tuple(point_coordinates[path[0][0]])]
labels = [(0, path[0][0])]

assert all([_.is_integer() for _ in num_points if isinstance(_, (float, numpy.float64))]
), 'Could not determine number of points as a whole number. num_points={}'.format(num_points)
num_points = [int(_) for _ in num_points]

for count_piece, i in enumerate(path):
ini_label = i[0]
end_label = i[1]
Expand Down
2 changes: 1 addition & 1 deletion environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ dependencies:
- ipython~=7.0
- jinja2~=2.10
- kiwipy[rmq]~=0.5.5
- numpy<1.18,~=1.17
- numpy~=1.17
- paramiko~=2.7
- pika~=1.1
- plumpy~=0.15.0
Expand Down
2 changes: 1 addition & 1 deletion setup.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"ipython~=7.0",
"jinja2~=2.10",
"kiwipy[rmq]~=0.5.5",
"numpy~=1.17,<1.18",
"numpy~=1.17",
"paramiko~=2.7",
"pika~=1.1",
"plumpy~=0.15.0",
Expand Down

0 comments on commit 12be9ad

Please sign in to comment.