Skip to content

Commit e272ccc

Browse files
committed
blackify pulled changes
1 parent 77d6fa1 commit e272ccc

File tree

2 files changed

+28
-20
lines changed

2 files changed

+28
-20
lines changed

datajoint/autopopulate.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -233,7 +233,9 @@ def handler(signum, frame):
233233
# spawn multiple processes
234234
self.connection.close() # disconnect parent process from MySQL server
235235
del self.connection._conn.ctx # SSLContext is not pickleable
236-
with mp.Pool(processes, _initialize_populate, (self, jobs, populate_kwargs)) as pool:
236+
with mp.Pool(
237+
processes, _initialize_populate, (self, jobs, populate_kwargs)
238+
) as pool:
237239
if display_progress:
238240
with tqdm(desc="Processes: ", total=nkeys) as pbar:
239241
for error in pool.imap(_call_populate1, keys, chunksize=1):

datajoint/declare.py

Lines changed: 25 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -11,25 +11,31 @@
1111

1212
UUID_DATA_TYPE = "binary(16)"
1313
MAX_TABLE_NAME_LENGTH = 64
14-
CONSTANT_LITERALS = {'CURRENT_TIMESTAMP', 'NULL'} # SQL literals to be used without quotes (case insensitive)
15-
EXTERNAL_TABLE_ROOT = '~external'
16-
17-
TYPE_PATTERN = {k: re.compile(v, re.I) for k, v in dict(
18-
INTEGER=r'((tiny|small|medium|big|)int|integer)(\s*\(.+\))?(\s+unsigned)?(\s+auto_increment)?|serial$',
19-
DECIMAL=r'(decimal|numeric)(\s*\(.+\))?(\s+unsigned)?$',
20-
FLOAT=r'(double|float|real)(\s*\(.+\))?(\s+unsigned)?$',
21-
STRING=r'(var)?char\s*\(.+\)$',
22-
ENUM=r'enum\s*\(.+\)$',
23-
BOOL=r'bool(ean)?$', # aliased to tinyint(1)
24-
TEMPORAL=r'(date|datetime|time|timestamp|year)(\s*\(.+\))?$',
25-
INTERNAL_BLOB=r'(tiny|small|medium|long|)blob$',
26-
EXTERNAL_BLOB=r'blob@(?P<store>[a-z][\-\w]*)$',
27-
INTERNAL_ATTACH=r'attach$',
28-
EXTERNAL_ATTACH=r'attach@(?P<store>[a-z][\-\w]*)$',
29-
FILEPATH=r'filepath@(?P<store>[a-z][\-\w]*)$',
30-
UUID=r'uuid$',
31-
ADAPTED=r'<.+>$'
32-
).items()}
14+
CONSTANT_LITERALS = {
15+
"CURRENT_TIMESTAMP",
16+
"NULL",
17+
} # SQL literals to be used without quotes (case insensitive)
18+
EXTERNAL_TABLE_ROOT = "~external"
19+
20+
TYPE_PATTERN = {
21+
k: re.compile(v, re.I)
22+
for k, v in dict(
23+
INTEGER=r"((tiny|small|medium|big|)int|integer)(\s*\(.+\))?(\s+unsigned)?(\s+auto_increment)?|serial$",
24+
DECIMAL=r"(decimal|numeric)(\s*\(.+\))?(\s+unsigned)?$",
25+
FLOAT=r"(double|float|real)(\s*\(.+\))?(\s+unsigned)?$",
26+
STRING=r"(var)?char\s*\(.+\)$",
27+
ENUM=r"enum\s*\(.+\)$",
28+
BOOL=r"bool(ean)?$", # aliased to tinyint(1)
29+
TEMPORAL=r"(date|datetime|time|timestamp|year)(\s*\(.+\))?$",
30+
INTERNAL_BLOB=r"(tiny|small|medium|long|)blob$",
31+
EXTERNAL_BLOB=r"blob@(?P<store>[a-z][\-\w]*)$",
32+
INTERNAL_ATTACH=r"attach$",
33+
EXTERNAL_ATTACH=r"attach@(?P<store>[a-z][\-\w]*)$",
34+
FILEPATH=r"filepath@(?P<store>[a-z][\-\w]*)$",
35+
UUID=r"uuid$",
36+
ADAPTED=r"<.+>$",
37+
).items()
38+
}
3339

3440
# custom types are stored in attribute comment
3541
SPECIAL_TYPES = {

0 commit comments

Comments
 (0)