Skip to content

Commit 5b81247

Browse files
Merge pull request #939 from rly/fix/np_deprecations
Replace use of numpy aliases of built-in types with built-in type
2 parents 39598f6 + b0acba5 commit 5b81247

File tree

6 files changed

+30
-28
lines changed

6 files changed

+30
-28
lines changed

CHANGELOG.md

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
## Release notes
22

3-
### 0.13.3 -- May 28, 2021
3+
### 0.13.3 -- TBD
44
* Bugfix - Dependencies not properly loaded on populate. (#902) PR #919
5+
* Bugfix - Replace use of numpy aliases of built-in types with built-in type. (#938) PR #939
56

67
### 0.13.2 -- May 7, 2021
78
* Update `setuptools_certificate` dependency to new name `otumat`
@@ -44,13 +45,13 @@
4445
* Fix display of part tables in `schema.save`. (#821) PR #833
4546
* Add `schema.list_tables`. (#838) PR #844
4647
* Fix minio new version regression. PR #847
47-
* Add more S3 logging for debugging. (#831) PR #832
48+
* Add more S3 logging for debugging. (#831) PR #832
4849
* Convert testing framework from TravisCI to GitHub Actions (#841) PR #840
49-
50+
5051
### 0.12.7 -- Oct 27, 2020
5152
* Fix case sensitivity issues to adapt to MySQL 8+. PR #819
5253
* Fix pymysql regression bug (#814) PR #816
53-
* Adapted attribute types now have dtype=object in all recarray results. PR #811
54+
* Adapted attribute types now have dtype=object in all recarray results. PR #811
5455

5556
### 0.12.6 -- May 15, 2020
5657
* Add `order_by` to `dj.kill` (#668, #779) PR #775, #783
@@ -142,9 +143,9 @@
142143
* Bugfix in restriction of the form (A & B) * B (#463)
143144
* Improved error messages (#466)
144145

145-
### 0.10.0 -- Jan 10, 2018
146+
### 0.10.0 -- Jan 10, 2018
146147
* Deletes are more efficient (#424)
147-
* ERD shows table definition on tooltip hover in Jupyter (#422)
148+
* ERD shows table definition on tooltip hover in Jupyter (#422)
148149
* S3 external storage
149150
* Garbage collection for external sorage
150151
* Most operators and methods of tables can be invoked as class methods rather than instance methods (#407)
@@ -158,7 +159,7 @@
158159
* Implement union operator +
159160
* Implement file-based external storage
160161

161-
### 0.8.0 -- Jul 26, 2017
162+
### 0.8.0 -- Jul 26, 2017
162163
Documentation and tutorials available at https://docs.datajoint.io and https://tutorials.datajoint.io
163164
* improved the ERD graphics and features using the graphviz libraries (#207, #333)
164165
* improved password handling logic (#322, #321)
@@ -177,11 +178,11 @@ Documentation and tutorials available at https://docs.datajoint.io and https://t
177178
* Added `dj.create_virtual_module`
178179

179180
### 0.4.10 (#286) -- Feb 6, 2017
180-
* Removed Vagrant and Readthedocs support
181+
* Removed Vagrant and Readthedocs support
181182
* Explicit saving of configuration (issue #284)
182183

183184
### 0.4.9 (#285) -- Feb 2, 2017
184-
* Fixed setup.py for pip install
185+
* Fixed setup.py for pip install
185186

186187
### 0.4.7 (#281) -- Jan 24, 2017
187188
* Fixed issues related to order of attributes in projection.
@@ -210,10 +211,10 @@ Documentation and tutorials available at https://docs.datajoint.io and https://t
210211

211212
### 0.3.8 -- Aug 2, 2016
212213
* added the `_update` method in `base_relation`. It allows updating values in existing tuples.
213-
* bugfix in reading values of type double. Previously it was cast as float32.
214+
* bugfix in reading values of type double. Previously it was cast as float32.
214215

215216
### 0.3.7 -- Jul 31, 2016
216-
* added parameter `ignore_extra_fields` in `insert`
217+
* added parameter `ignore_extra_fields` in `insert`
217218
* `insert(..., skip_duplicates=True)` now relies on `SELECT IGNORE`. Previously it explicitly checked if tuple already exists.
218219
* table previews now include blob attributes displaying the string <BLOB>
219220

LNX-docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ services:
3232
interval: 1s
3333
fakeservices.datajoint.io:
3434
<<: *net
35-
image: datajoint/nginx:v0.0.16
35+
image: datajoint/nginx:v0.0.17
3636
environment:
3737
- ADD_db_TYPE=DATABASE
3838
- ADD_db_ENDPOINT=db:3306

datajoint/blob.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,7 @@ def pack_blob(self, obj):
164164
return self.pack_recarray(np.array(obj))
165165
if isinstance(obj, np.number):
166166
return self.pack_array(np.array(obj))
167-
if isinstance(obj, (np.bool, np.bool_)):
167+
if isinstance(obj, (bool, np.bool_)):
168168
return self.pack_array(np.array(obj))
169169
if isinstance(obj, (datetime.datetime, datetime.date, datetime.time)):
170170
return self.pack_datetime(obj)
@@ -365,7 +365,7 @@ def read_struct(self):
365365
raw_data = [
366366
tuple(self.read_blob(n_bytes=int(self.read_value('uint64'))) for _ in range(n_fields))
367367
for __ in range(n_elem)]
368-
data = np.array(raw_data, dtype=list(zip(field_names, repeat(np.object))))
368+
data = np.array(raw_data, dtype=list(zip(field_names, repeat(object))))
369369
return self.squeeze(data.reshape(shape, order="F"), convert_to_scalar=False).view(MatStruct)
370370

371371
def pack_struct(self, array):

datajoint/table.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -586,7 +586,7 @@ def _update(self, attrname, value=None):
586586
value = blob.pack(value)
587587
placeholder = '%s'
588588
elif attr.numeric:
589-
if value is None or np.isnan(np.float(value)): # nans are turned into NULLs
589+
if value is None or np.isnan(float(value)): # nans are turned into NULLs
590590
placeholder = 'NULL'
591591
value = None
592592
else:
@@ -615,7 +615,7 @@ def __make_placeholder(self, name, value, ignore_extra_fields=False):
615615
attr = self.heading[name]
616616
if attr.adapter:
617617
value = attr.adapter.put(value)
618-
if value is None or (attr.numeric and (value == '' or np.isnan(np.float(value)))):
618+
if value is None or (attr.numeric and (value == '' or np.isnan(float(value)))):
619619
# set default value
620620
placeholder, value = 'DEFAULT', None
621621
else: # not NULL

docs-parts/intro/Releases_lang1.rst

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
0.13.3 -- May 28, 2021
1+
0.13.3 -- TBD
22
----------------------
33
* Bugfix - Dependencies not properly loaded on populate. (#902) PR #919
4+
* Bugfix - Replace use of numpy aliases of built-in types with built-in type. (#938) PR #939
45

56
0.13.2 -- May 7, 2021
67
----------------------
@@ -48,14 +49,14 @@
4849
* Fix display of part tables in `schema.save`. (#821) PR #833
4950
* Add `schema.list_tables`. (#838) PR #844
5051
* Fix minio new version regression. PR #847
51-
* Add more S3 logging for debugging. (#831) PR #832
52+
* Add more S3 logging for debugging. (#831) PR #832
5253
* Convert testing framework from TravisCI to GitHub Actions (#841) PR #840
5354

5455
0.12.7 -- Oct 27, 2020
5556
----------------------
5657
* Fix case sensitivity issues to adapt to MySQL 8+. PR #819
5758
* Fix pymysql regression bug (#814) PR #816
58-
* Adapted attribute types now have `dtype=object` in all recarray results. PR #811
59+
* Adapted attribute types now have `dtype=object` in all recarray results. PR #811
5960

6061
0.12.6 -- May 15, 2020
6162
----------------------
@@ -151,10 +152,10 @@
151152
* Bugfix in restriction of the form (A & B) * B (#463)
152153
* Improved error messages (#466)
153154

154-
0.10.0 -- Jan 10, 2018
155+
0.10.0 -- Jan 10, 2018
155156
----------------------
156157
* Deletes are more efficient (#424)
157-
* ERD shows table definition on tooltip hover in Jupyter (#422)
158+
* ERD shows table definition on tooltip hover in Jupyter (#422)
158159
* S3 external storage
159160
* Garbage collection for external sorage
160161
* Most operators and methods of tables can be invoked as class methods rather than instance methods (#407)
@@ -169,7 +170,7 @@
169170
* Implement union operator +
170171
* Implement file-based external storage
171172

172-
0.8.0 -- Jul 26, 2017
173+
0.8.0 -- Jul 26, 2017
173174
---------------------
174175
Documentation and tutorials available at https://docs.datajoint.io and https://tutorials.datajoint.io
175176
* improved the ERD graphics and features using the graphviz libraries (#207, #333)
@@ -191,12 +192,12 @@ Documentation and tutorials available at https://docs.datajoint.io and https://t
191192

192193
0.4.10 (#286) -- Feb 6, 2017
193194
----------------------------
194-
* Removed Vagrant and Readthedocs support
195+
* Removed Vagrant and Readthedocs support
195196
* Explicit saving of configuration (issue #284)
196197

197198
0.4.9 (#285) -- Feb 2, 2017
198199
---------------------------
199-
* Fixed setup.py for pip install
200+
* Fixed setup.py for pip install
200201

201202
0.4.7 (#281) -- Jan 24, 2017
202203
----------------------------
@@ -233,11 +234,11 @@ Documentation and tutorials available at https://docs.datajoint.io and https://t
233234
0.3.8 -- Aug 2, 2016
234235
---------------------
235236
* added the ``_update`` method in ``base_relation``. It allows updating values in existing tuples.
236-
* bugfix in reading values of type double. Previously it was cast as float32.
237+
* bugfix in reading values of type double. Previously it was cast as float32.
237238

238239
0.3.7 -- Jul 31, 2016
239240
----------------------
240-
* added parameter ``ignore_extra_fields`` in ``insert``
241+
* added parameter ``ignore_extra_fields`` in ``insert``
241242
* ``insert(..., skip_duplicates=True)`` now relies on ``SELECT IGNORE``. Previously it explicitly checked if tuple already exists.
242243
* table previews now include blob attributes displaying the string <BLOB>
243244

@@ -263,7 +264,7 @@ Documentation and tutorials available at https://docs.datajoint.io and https://t
263264
* ERD() no longer text the context argument.
264265
* ERD.draw() now takes an optional context argument. By default uses the caller's locals.
265266

266-
0.3.2
267+
0.3.2
267268
-----
268269
* Fixed issue #223: ``insert`` can insert relations without fetching.
269270
* ERD() now takes the ``context`` argument, which specifies in which context to look for classes. The default is taken from the argument (schema or relation).

local-docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ services:
3434
interval: 1s
3535
fakeservices.datajoint.io:
3636
<<: *net
37-
image: datajoint/nginx:v0.0.16
37+
image: datajoint/nginx:v0.0.17
3838
environment:
3939
- ADD_db_TYPE=DATABASE
4040
- ADD_db_ENDPOINT=db:3306

0 commit comments

Comments
 (0)