Skip to content

Commit 1cbfa45

Browse files
committed
Format with black
1 parent a9470b5 commit 1cbfa45

File tree

4 files changed

+11
-5
lines changed

4 files changed

+11
-5
lines changed

datajoint/table.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -102,8 +102,8 @@ def declare(self, context=None):
102102
raise DataJointError(
103103
"Table with class name `{name}` contains an underscore. ".format(
104104
name=self.class_name
105-
) +
106-
"Classes defining tables should be formatted in strict CamelCase."
105+
)
106+
+ "Classes defining tables should be formatted in strict CamelCase."
107107
)
108108
sql, external_stores = declare(self.full_table_name, self.definition, context)
109109
sql = sql.format(database=self.database)

datajoint/utils.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,9 @@ def is_camel_case(s):
7777
>>> is_camel_case("table_name") # returns False
7878
"""
7979
# return re.match(r"^[A-Z][a-z0-9]+(?:[A-Z][a-z0-9]+)*$", s) is not None
80-
return re.match(r"[A-Z][a-zA-Z0-9]*", s) is not None and not contains_non_ascii_char(s)
80+
return re.match(
81+
r"[A-Z][a-zA-Z0-9]*", s
82+
) is not None and not contains_non_ascii_char(s)
8183

8284

8385
def to_camel_case(s):

tests/test_declare.py

-1
Original file line numberDiff line numberDiff line change
@@ -358,4 +358,3 @@ class Table_With_Underscores(dj.Manual):
358358
schema_any(TableNoUnderscores)
359359
with pytest.raises(dj.DataJointError, match="strict CamelCase") as e:
360360
schema_any(Table_With_Underscores)
361-

tests/test_utils.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,12 @@
33
"""
44

55
from datajoint import DataJointError
6-
from datajoint.utils import from_camel_case, to_camel_case, is_camel_case, contains_non_ascii_char
6+
from datajoint.utils import (
7+
from_camel_case,
8+
to_camel_case,
9+
is_camel_case,
10+
contains_non_ascii_char,
11+
)
712
import pytest
813

914

0 commit comments

Comments
 (0)