File tree Expand file tree Collapse file tree 4 files changed +10
-4
lines changed Expand file tree Collapse file tree 4 files changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,9 @@ Upcoming Release
34
34
* Require Numcodecs 0.6.4+ to use text handling functionality from it.
35
35
By :user: `John Kirkham <jakirkham> `; :issue: `497 `.
36
36
37
+ * Use ``math.ceil `` for scalars.
38
+ By :user: `John Kirkham <jakirkham> `; :issue: `500 `.
39
+
37
40
.. _release_2.3.2 :
38
41
39
42
2.3.2
Original file line number Diff line number Diff line change 2
2
import binascii
3
3
import hashlib
4
4
import itertools
5
+ import math
5
6
import operator
6
7
import re
7
8
from functools import reduce
@@ -355,7 +356,7 @@ def _cdata_shape(self):
355
356
if self ._shape == ():
356
357
return 1 ,
357
358
else :
358
- return tuple (int ( np .ceil (s / c ) )
359
+ return tuple (math .ceil (s / c )
359
360
for s , c in zip (self ._shape , self ._chunks ))
360
361
361
362
@property
@@ -2007,7 +2008,7 @@ def _resize_nosync(self, *args):
2007
2008
2008
2009
# determine the new number and arrangement of chunks
2009
2010
chunks = self ._chunks
2010
- new_cdata_shape = tuple (int ( np .ceil (s / c ) )
2011
+ new_cdata_shape = tuple (math .ceil (s / c )
2011
2012
for s , c in zip (new_shape , chunks ))
2012
2013
2013
2014
# remove any chunks not within range
Original file line number Diff line number Diff line change 1
1
# -*- coding: utf-8 -*-
2
2
import collections
3
3
import itertools
4
+ import math
4
5
import numbers
5
6
6
7
import numpy as np
@@ -91,7 +92,7 @@ def __iter__(self):
91
92
92
93
93
94
def ceildiv (a , b ):
94
- return int ( np .ceil (a / b ) )
95
+ return math .ceil (a / b )
95
96
96
97
97
98
class SliceDimIndexer (object ):
Original file line number Diff line number Diff line change 1
1
# -*- coding: utf-8 -*-
2
2
import inspect
3
3
import json
4
+ import math
4
5
import numbers
5
6
import uuid
6
7
from textwrap import TextWrapper , dedent
@@ -92,7 +93,7 @@ def guess_chunks(shape, typesize):
92
93
if np .product (chunks ) == 1 :
93
94
break # Element size larger than CHUNK_MAX
94
95
95
- chunks [idx % ndims ] = np .ceil (chunks [idx % ndims ] / 2.0 )
96
+ chunks [idx % ndims ] = math .ceil (chunks [idx % ndims ] / 2.0 )
96
97
idx += 1
97
98
98
99
return tuple (int (x ) for x in chunks )
You can’t perform that action at this time.
0 commit comments