@@ -16,36 +16,36 @@ class TTest(dj.Lookup):
1616 """
1717
1818 definition = """
19- key : int # key
19+ key : int32 # key
2020 ---
21- value : int # value
21+ value : int32 # value
2222 """
2323 contents = [(k , 2 * k ) for k in range (10 )]
2424
2525
2626class TTest2 (dj .Manual ):
2727 definition = """
28- key : int # key
28+ key : int32 # key
2929 ---
30- value : int # value
30+ value : int32 # value
3131 """
3232
3333
3434class TTest3 (dj .Manual ):
3535 definition = """
36- key : int
36+ key : int32
3737 ---
3838 value : varchar(300)
3939 """
4040
4141
4242class NullableNumbers (dj .Manual ):
4343 definition = """
44- key : int
44+ key : int32
4545 ---
46- fvalue = null : float
47- dvalue = null : double
48- ivalue = null : int
46+ fvalue = null : float32
47+ dvalue = null : float64
48+ ivalue = null : int32
4949 """
5050
5151
@@ -54,7 +54,7 @@ class TTestExtra(dj.Manual):
5454 clone of Test but with an extra field
5555 """
5656
57- definition = TTest .definition + "\n extra : int # extra int\n "
57+ definition = TTest .definition + "\n extra : int32 # extra int\n "
5858
5959
6060class TTestNoExtra (dj .Manual ):
@@ -67,14 +67,11 @@ class TTestNoExtra(dj.Manual):
6767
6868class Auto (dj .Lookup ):
6969 definition = """
70- id :int auto_increment
70+ id : uint8
7171 ---
7272 name :varchar(12)
7373 """
74-
75- def fill (self ):
76- if not self :
77- self .insert ([dict (name = "Godel" ), dict (name = "Escher" ), dict (name = "Bach" )])
74+ contents = [(1 , "Godel" ), (2 , "Escher" ), (3 , "Bach" )]
7875
7976
8077class User (dj .Lookup ):
@@ -94,7 +91,7 @@ class User(dj.Lookup):
9491
9592class Subject (dj .Lookup ):
9693 definition = """ # Basic information about animal subjects used in experiments
97- subject_id :int # unique subject id
94+ subject_id :int32 # unique subject id
9895 ---
9996 real_id :varchar(40) # real-world name. Omit if the same as subject_id
10097 species = "mouse" :enum('mouse', 'monkey', 'human')
@@ -131,13 +128,13 @@ class Language(dj.Lookup):
131128class Experiment (dj .Imported ):
132129 definition = """ # information about experiments
133130 -> Subject
134- experiment_id :smallint # experiment number for this subject
131+ experiment_id :int16 # experiment number for this subject
135132 ---
136133 experiment_date :date # date when experiment was started
137134 -> [nullable] User
138135 data_path="" :varchar(255) # file path to recorded data
139136 notes="" :varchar(2048) # e.g. purpose of experiment
140- entry_time=CURRENT_TIMESTAMP :timestamp # automatic timestamp
137+ entry_time=CURRENT_TIMESTAMP :datetime # automatic timestamp
141138 """
142139
143140 fake_experiments_per_subject = 5
@@ -164,17 +161,17 @@ def make(self, key):
164161class Trial (dj .Imported ):
165162 definition = """ # a trial within an experiment
166163 -> Experiment.proj(animal='subject_id')
167- trial_id :smallint # trial number
164+ trial_id :int16 # trial number
168165 ---
169- start_time :double # (s)
166+ start_time :float64 # (s)
170167 """
171168
172169 class Condition (dj .Part ):
173170 definition = """ # trial conditions
174171 -> Trial
175- cond_idx : smallint # condition number
172+ cond_idx : int16 # condition number
176173 ----
177- orientation : float # degrees
174+ orientation : float32 # degrees
178175 """
179176
180177 def make (self , key ):
@@ -191,14 +188,14 @@ class Ephys(dj.Imported):
191188 definition = """ # some kind of electrophysiological recording
192189 -> Trial
193190 ----
194- sampling_frequency :double # (Hz)
191+ sampling_frequency :float64 # (Hz)
195192 duration :decimal(7,3) # (s)
196193 """
197194
198195 class Channel (dj .Part ):
199196 definition = """ # subtable containing individual channels
200197 -> master
201- channel :tinyint unsigned # channel number within Ephys
198+ channel :uint8 # channel number within Ephys
202199 ----
203200 voltage : <blob>
204201 current = null : <blob> # optional current to test null handling
@@ -226,15 +223,15 @@ def _make_tuples(self, key):
226223class Image (dj .Manual ):
227224 definition = """
228225 # table for testing blob inserts
229- id : int # image identifier
226+ id : int32 # image identifier
230227 ---
231228 img : <blob> # image
232229 """
233230
234231
235232class UberTrash (dj .Lookup ):
236233 definition = """
237- id : int
234+ id : int32
238235 ---
239236 """
240237 contents = [(1 ,)]
@@ -243,15 +240,15 @@ class UberTrash(dj.Lookup):
243240class UnterTrash (dj .Lookup ):
244241 definition = """
245242 -> UberTrash
246- my_id : int
243+ my_id : int32
247244 ---
248245 """
249246 contents = [(1 , 1 ), (1 , 2 )]
250247
251248
252249class SimpleSource (dj .Lookup ):
253250 definition = """
254- id : int # id
251+ id : int32 # id
255252 """
256253 contents = [(x ,) for x in range (10 )]
257254
@@ -311,24 +308,24 @@ class IndexRich(dj.Manual):
311308 ---
312309 -> [unique, nullable] User.proj(first="username")
313310 first_date : date
314- value : int
311+ value : int32
315312 index (first_date, value)
316313 """
317314
318315
319316# Schema for issue 656
320317class ThingA (dj .Manual ):
321318 definition = """
322- a: int
319+ a: int32
323320 """
324321
325322
326323class ThingB (dj .Manual ):
327324 definition = """
328- b1: int
329- b2: int
325+ b1: int32
326+ b2: int32
330327 ---
331- b3: int
328+ b3: int32
332329 """
333330
334331
@@ -343,7 +340,7 @@ class ThingC(dj.Manual):
343340# Additional tables for #1159
344341class ThingD (dj .Manual ):
345342 definition = """
346- d: int
343+ d: int32
347344 ---
348345 -> ThingC
349346 """
@@ -357,7 +354,7 @@ class ThingE(dj.Manual):
357354
358355class Parent (dj .Lookup ):
359356 definition = """
360- parent_id: int
357+ parent_id: int32
361358 ---
362359 name: varchar(30)
363360 """
@@ -367,7 +364,7 @@ class Parent(dj.Lookup):
367364class Child (dj .Lookup ):
368365 definition = """
369366 -> Parent
370- child_id: int
367+ child_id: int32
371368 ---
372369 name: varchar(30)
373370 """
@@ -376,12 +373,12 @@ class Child(dj.Lookup):
376373
377374# Related to issue #886 (8), #883 (5)
378375class ComplexParent (dj .Lookup ):
379- definition = "\n " .join (["parent_id_{}: int " .format (i + 1 ) for i in range (8 )])
376+ definition = "\n " .join (["parent_id_{}: int32 " .format (i + 1 ) for i in range (8 )])
380377 contents = [tuple (i for i in range (8 ))]
381378
382379
383380class ComplexChild (dj .Lookup ):
384- definition = "\n " .join (["-> ComplexParent" ] + ["child_id_{}: int " .format (i + 1 ) for i in range (1 )])
381+ definition = "\n " .join (["-> ComplexParent" ] + ["child_id_{}: int32 " .format (i + 1 ) for i in range (1 )])
385382 contents = [tuple (i for i in range (9 ))]
386383
387384
@@ -443,16 +440,16 @@ class SessionDateA(dj.Lookup):
443440
444441class Stimulus (dj .Lookup ):
445442 definition = """
446- id: int
443+ id: int32
447444 ---
448- contrast: int
449- brightness: int
445+ contrast: int32
446+ brightness: int32
450447 """
451448
452449
453450class Longblob (dj .Manual ):
454451 definition = """
455- id: int
452+ id: int32
456453 ---
457454 data: <blob>
458455 """
0 commit comments