Skip to content

Commit

Permalink
Upgrade to numpy 1.24
Browse files Browse the repository at this point in the history
  • Loading branch information
rafaelweingartner committed Dec 29, 2022
1 parent b1742b0 commit b08e790
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 7 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
.testrepository
.idea
.stestr
*.pyc
.tox
Expand Down
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
17 changes: 14 additions & 3 deletions run-upgrade-tests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,25 @@
set -e

if [ "$1" == "postgresql-file" ]; then
eval $(pifpaf --env-prefix INDEXER run postgresql)
echo "Deploying Postgresql with PifPaf."
eval $(pifpaf --debug --env-prefix INDEXER run postgresql)
elif [ "$1" == "mysql-ceph" ]; then
eval $(pifpaf --env-prefix INDEXER run mysql)
eval $(pifpaf --env-prefix STORAGE run ceph)
# Installing PifPaf from source due to the lack of a new version to handle
# Ceph global insecure claims. The patch was introduced in PifPaf via commit
# https://github.com/jd/pifpaf/commit/fb376a83a47d678952672a7f5d36a02101135fb2,
# but it has never been released. Therefore, we need to install it here from
# master/main branch in the upstream repository
pip install install git+https://github.com/jd/pifpaf.git@fb376a83a47d678952672a7f5d36a02101135fb2

echo "Deploying MySQL with PifPaf."
eval $(pifpaf --debug --env-prefix INDEXER run mysql)
echo "Deploying Ceph with PifPaf."
eval $(pifpaf --debug --env-prefix STORAGE run ceph)
else
echo "error: unsupported upgrade type"
exit 1
fi
echo "Finished deploying backend components with PifPaf."

export GNOCCHI_DATA=$(mktemp -d -t gnocchi.XXXX)

Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ packages =
include_package_data = true

install_requires =
numpy>=1.9.0
numpy>=1.19.5
iso8601
oslo.config>=3.22.0
oslo.policy>=3.5.0
Expand Down

0 comments on commit b08e790

Please sign in to comment.