Skip to content
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

Support numpy >= 1.24 (backport #1281) #1284

Merged
merged 4 commits into from
Jan 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions gnocchi/carbonara.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,8 +196,8 @@ def quantile(self, q):
ordered = numpy.lexsort((self._ts['values'], self.indexes))
min_pos = numpy.cumsum(self.counts) - self.counts
real_pos = min_pos + (self.counts - 1) * (q / 100)
floor_pos = numpy.floor(real_pos).astype(numpy.int, copy=False)
ceil_pos = numpy.ceil(real_pos).astype(numpy.int, copy=False)
floor_pos = numpy.floor(real_pos).astype(numpy.integer, copy=False)
ceil_pos = numpy.ceil(real_pos).astype(numpy.integer, copy=False)
values = (
self._ts['values'][ordered][floor_pos] * (ceil_pos - real_pos) +
self._ts['values'][ordered][ceil_pos] * (real_pos - floor_pos))
Expand Down Expand Up @@ -772,7 +772,7 @@ def serialize(self, start, compressed=True):
first = self.first # NOTE(jd) needed because faster
e_offset = int((self.last - first) / offset_div) + 1

locs = numpy.zeros(self.timestamps.size, dtype=numpy.int)
locs = numpy.zeros(self.timestamps.size, dtype=numpy.integer)
locs[1:] = numpy.cumsum(numpy.diff(self.timestamps)) / offset_div

# Fill everything with zero and set
Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ packages =
include_package_data = true

install_requires =
numpy>=1.9.0,<1.24
numpy>=1.9.0
iso8601
oslo.config>=3.22.0
oslo.policy>=1.7.0
Expand Down
12 changes: 6 additions & 6 deletions tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ deps =
.[test,redis,prometheus,amqp1,{env:GNOCCHI_STORAGE_DEPS:},{env:GNOCCHI_INDEXER_DEPS:}]
{env:GNOCCHI_TEST_TARBALLS:}
# TODO(tobias-urdin): Remove this pin and use pifpaf directly instead when this is
# merged and released https://github.com/jd/pifpaf/pull/152
git+https://github.com/tobias-urdin/pifpaf@d29957e0a2f0ff80d4c9eac1605002176bd9b67e
# merged and released
git+https://github.com/jd/pifpaf@d5103d4bcf80aa6f74e31e92e4a7eb92997d4c73
cliff!=2.9.0
gnocchiclient>=2.8.0,!=7.0.7
commands =
Expand All @@ -63,8 +63,8 @@ setenv =
GNOCCHI_VARIANT=test,postgresql,file
deps =
# TODO(tobias-urdin): Remove this pin and use pifpaf directly instead when this is
# merged and released https://github.com/jd/pifpaf/pull/152
git+https://github.com/tobias-urdin/pifpaf@d29957e0a2f0ff80d4c9eac1605002176bd9b67e
# merged and released
git+https://github.com/jd/pifpaf@d5103d4bcf80aa6f74e31e92e4a7eb92997d4c73
gnocchiclient>=2.8.0,!=7.0.7
xattr!=0.9.4
commands = {toxinidir}/run-upgrade-tests.sh postgresql-file
Expand All @@ -78,8 +78,8 @@ setenv =
GNOCCHI_VARIANT=test,mysql,ceph,ceph_recommended_lib
deps =
# TODO(tobias-urdin): Remove this pin and use pifpaf directly instead when this is
# merged and released https://github.com/jd/pifpaf/pull/152
git+https://github.com/tobias-urdin/pifpaf@d29957e0a2f0ff80d4c9eac1605002176bd9b67e
# merged and released
git+https://github.com/jd/pifpaf@d5103d4bcf80aa6f74e31e92e4a7eb92997d4c73
gnocchiclient>=2.8.0,!=7.0.7
xattr!=0.9.4
commands = {toxinidir}/run-upgrade-tests.sh mysql-ceph
Expand Down