Skip to content

Commit

Permalink
Merge pull request #5 from hugobuddel/hb/bugfix/numpydatatypes
Browse files Browse the repository at this point in the history
Fix numpy datatype bug. This fixes ScopeSIM
  • Loading branch information
hugobuddel committed Feb 15, 2023
2 parents e5ba44c + c50a626 commit 6aa783b
Show file tree
Hide file tree
Showing 5 changed files with 11 additions and 8 deletions.
8 changes: 4 additions & 4 deletions anisocado/pupil_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -224,8 +224,8 @@ def fillPolygon(x, y, i0, j0, scale, gap, N, index=0):
# Last triangle has a special treatment because it crosses the axis
# with theta=0=2pi
n = x.shape[0] # number of corners of polygon
indx, indy = (np.array([], dtype=np.int), np.array([], dtype=np.int))
distedge = np.array([], dtype=np.float)
indx, indy = (np.array([], dtype=np.int64), np.array([], dtype=np.int64))
distedge = np.array([], dtype=np.float64)
for i in range(n):
j = i + 1 # j=element next i except when i==n : then j=0 (cycling)
if j == n:
Expand Down Expand Up @@ -255,7 +255,7 @@ def fillPolygon(x, y, i0, j0, scale, gap, N, index=0):
a[indx, indy] = distedge
return a
else:
a = np.zeros((N, N), dtype=np.bool)
a = np.zeros((N, N), dtype=np.bool_)
a[indx, indy] = True # convention [x,y]

return a
Expand Down Expand Up @@ -296,7 +296,7 @@ def fillSpider(N, nspider, dspider, i0, j0, scale, rot):
:param float rot: rotation angle in radians
"""
a = np.ones((N, N), dtype=np.bool)
a = np.ones((N, N), dtype=np.bool_)
X = (np.arange(N) - i0) * scale
Y = (np.arange(N) - j0) * scale
X, Y = np.meshgrid(X, Y, indexing='ij') # convention d'appel [x,y]
Expand Down
4 changes: 2 additions & 2 deletions anisocado/version.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
version = '0.2.1'
date = '2021-10-21 14:15:00 GMT'
version = '0.2.2'
date = '2023-01-01 11:11:11 GMT'
2 changes: 1 addition & 1 deletion docs/codemeta.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
"downloadUrl": "https://pypi.org/project/anisocado/",
"issueTracker": "https://github.com/AstarVienna/AnisoCADO/issues",
"name": "AnisoCADO",
"version": "0.2",
"version": "0.2.2",
"description": "A python package created around Eric Gendron’s code for analytically (and quickly) generating field-varying SCAO PSFs for the ELT.",
"applicationCategory": "Astronomy",
"funding": "IS538004",
Expand Down
2 changes: 1 addition & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@
# built documents.
#
# The short X.Y version.
version = '0.1'
version = '0.2.2'
# The full version, including alpha/beta/rc tags.
release = 'dev'

Expand Down
3 changes: 3 additions & 0 deletions docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -160,6 +160,9 @@ The following packages are optional:
Change Log
----------

- 2023.02.01 :
- Fix bugs to support numpy 2.24
- Release 0.2.2
- 2021.10.21 :
- Upgraded Numpy dependency to v1.17 to use ``numpy.random.default_rng``
- Removed support for Python 2.7
Expand Down

0 comments on commit 6aa783b

Please sign in to comment.