Skip to content

Commit c178d00

Browse files
fix regular expression for attribute names in .proj to catch those outside datajoint naming conventions
1 parent 7764467 commit c178d00

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

datajoint/expression.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -309,9 +309,9 @@ def proj(self, *attributes, **named_attributes):
309309
Each attribute name can only be used once.
310310
"""
311311
# new attributes in parentheses are included again with the new name without removing original
312-
duplication_pattern = re.compile(r'\s*\(\s*(?P<name>[a-z][a-z_0-9]*)\s*\)\s*$')
312+
duplication_pattern = re.compile(r'\s*\(\s*(?P<name>\w+)\s*\)\s*$')
313313
# attributes without parentheses renamed
314-
rename_pattern = re.compile(r'\s*(?P<name>[a-z][a-z_0-9]*)\s*$')
314+
rename_pattern = re.compile(r'\s*(?P<name>\w+)\s*$')
315315
replicate_map = {k: m.group('name')
316316
for k, m in ((k, duplication_pattern.match(v)) for k, v in named_attributes.items()) if m}
317317
rename_map = {k: m.group('name')

0 commit comments

Comments
 (0)