Skip to content

Commit 8f5b916

Browse files
Merge branch 'master' into kwargs_in_populate
2 parents 2d62835 + e905dce commit 8f5b916

17 files changed

+44
-22
lines changed

CHANGELOG.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
## Release notes
22

33
### 0.13.3 -- TBD
4+
* Bugfix - Fix error in listing ancestors, descendants with part tables.
5+
* Bugfix - Fix Python 3.10 compatibility (#983) PR #972
6+
* Bugfix - Allow renaming non-conforming attributes in proj (#982) PR #972
47
* Add - Expose proxy feature for S3 external stores (#961) PR #962
58
* Bugfix - Dependencies not properly loaded on populate. (#902) PR #919
69
* Bugfix - Replace use of numpy aliases of built-in types with built-in type. (#938) PR #939

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.18
35+
image: datajoint/nginx:v0.0.19
3636
environment:
3737
- ADD_db_TYPE=DATABASE
3838
- ADD_db_ENDPOINT=db:3306

datajoint/declare.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
UUID_DATA_TYPE = 'binary(16)'
1313
MAX_TABLE_NAME_LENGTH = 64
14-
CONSTANT_LITERALS = {'CURRENT_TIMESTAMP'} # SQL literals to be used without quotes (case insensitive)
14+
CONSTANT_LITERALS = {'CURRENT_TIMESTAMP', 'NULL'} # SQL literals to be used without quotes (case insensitive)
1515
EXTERNAL_TABLE_ROOT = '~external'
1616

1717
TYPE_PATTERN = {k: re.compile(v, re.I) for k, v in dict(

datajoint/dependencies.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ def unite_master_parts(lst):
1818
"""
1919
for i in range(2, len(lst)):
2020
name = lst[i]
21-
match = re.match(r'(?P<master>`\w+`.`\w+)__\w+`', name)
21+
match = re.match(r'(?P<master>`\w+`.`#?\w+)__\w+`', name)
2222
if match: # name is a part table
2323
master = match.group('master')
2424
for j in range(i-1, -1, -1):

datajoint/diagram.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ def make_dot(self):
296296
node.set_style('filled')
297297

298298
for edge in dot.get_edges():
299-
# see http://www.graphviz.org/content/attrs
299+
# see https://graphviz.org/doc/info/attrs.html
300300
src = edge.get_source().strip('"')
301301
dest = edge.get_destination().strip('"')
302302
props = graph.get_edge_data(src, dest)

datajoint/expression.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
from .preview import preview, repr_html
1010
from .condition import AndList, Not, \
1111
make_condition, assert_join_compatibility, extract_column_names, PromiscuousOperand
12+
from .declare import CONSTANT_LITERALS
1213

1314
logger = logging.getLogger(__name__)
1415

@@ -313,9 +314,9 @@ def proj(self, *attributes, **named_attributes):
313314
Each attribute name can only be used once.
314315
"""
315316
# new attributes in parentheses are included again with the new name without removing original
316-
duplication_pattern = re.compile(r'\s*\(\s*(?P<name>[a-z][a-z_0-9]*)\s*\)\s*$')
317+
duplication_pattern = re.compile(fr'^\s*\(\s*(?!{"|".join(CONSTANT_LITERALS)})(?P<name>[a-zA-Z_]\w*)\s*\)\s*$')
317318
# attributes without parentheses renamed
318-
rename_pattern = re.compile(r'\s*(?P<name>[a-z][a-z_0-9]*)\s*$')
319+
rename_pattern = re.compile(fr'^\s*(?!{"|".join(CONSTANT_LITERALS)})(?P<name>[a-zA-Z_]\w*)\s*$')
319320
replicate_map = {k: m.group('name')
320321
for k, m in ((k, duplication_pattern.match(v)) for k, v in named_attributes.items()) if m}
321322
rename_map = {k: m.group('name')

datajoint/external.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
from pathlib import Path, PurePosixPath, PureWindowsPath
2-
from collections import Mapping
2+
from collections.abc import Mapping
33
from tqdm import tqdm
44
from .settings import config
55
from .errors import DataJointError, MissingExternalFile

datajoint/settings.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@
5858
}
5959

6060

61-
class Config(collections.MutableMapping):
61+
class Config(collections.abc.MutableMapping):
6262

6363
instance = None
6464

docs-parts/computation/01-autopopulate_lang1.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,6 @@
1313
def make(self, key):
1414
img = (test.Image & key).fetch1('image')
1515
key['filtered_image'] = myfilter(img)
16-
self.insert(key)
16+
self.insert1(key)
1717
1818
The ``make`` method receives one argument: the dict ``key`` containing the primary key value of an element of :ref:`key source <keysource>` to be worked on.
Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,21 @@
11

2-
To plot the ERD for an entire schema, an ERD object can be initialized with the schema object (which is normally used to decorate table objects)
2+
To plot the Diagram for an entire schema, an Diagram object can be initialized with the schema object (which is normally used to decorate table objects)
33

44
.. code-block:: python
55
66
import datajoint as dj
77
schema = dj.Schema('my_database')
8-
dj.ERD(schema).draw()
8+
dj.Diagram(schema).draw()
99
1010
or alternatively an object that has the schema object as an attribute, such as the module defining a schema:
1111

1212
.. code-block:: python
1313
1414
import datajoint as dj
1515
import seq # import the sequence module defining the seq database
16-
dj.ERD(seq).draw() # draw the ERD
16+
dj.Diagram(seq).draw() # draw the Diagram
1717
1818
Note that calling the ``.draw()`` method is not necessary when working in a Jupyter notebook.
19-
The preferred workflow is to simply let the object display itself, for example by writing ``dj.ERD(seq)``.
20-
The ERD will then render in the notebook using its ``_repr_html_`` method.
21-
An ERD displayed without ``.draw()`` will be rendered as an SVG, and hovering the mouse over a table will reveal a compact version of the output of the ``.describe()`` method.
19+
You can simply let the object display itself, for example by entering ``dj.Diagram(seq)`` in a notebook cell.
20+
The Diagram will automatically render in the notebook by calling its ``_repr_html_`` method.
21+
A Diagram displayed without ``.draw()`` will be rendered as an SVG, and hovering the mouse over a table will reveal a compact version of the output of the ``.describe()`` method.

0 commit comments

Comments
 (0)