Skip to content

Commit e8652f7

Browse files
authored
Merge branch 'datajoint:master' into multi-processing-bug-fix
2 parents b34a02a + e2aa1ad commit e8652f7

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

57 files changed

+487
-286
lines changed

.github/workflows/development.yaml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,23 @@ on:
99
- '**' # every branch
1010
- '!stage*' # exclude branches beginning with stage
1111
jobs:
12+
build-docs:
13+
runs-on: ubuntu-latest
14+
env:
15+
DOCKER_CLIENT_TIMEOUT: "120"
16+
COMPOSE_HTTP_TIMEOUT: "120"
17+
steps:
18+
- uses: actions/checkout@v2
19+
- name: Compile docs static artifacts
20+
run: |
21+
export HOST_UID=$(id -u)
22+
docker-compose -f ./docs-api/docker-compose.yaml up --exit-code-from docs-builder --build
23+
- name: Add docs static artifacts
24+
uses: actions/upload-artifact@v2
25+
with:
26+
name: docs-api-static
27+
path: docs-api/build/html
28+
retention-days: 1
1229
test:
1330
if: github.event_name == 'push' || github.event_name == 'pull_request'
1431
runs-on: ubuntu-latest
@@ -51,3 +68,42 @@ jobs:
5168
--count --max-complexity=62 --max-line-length=127 --statistics
5269
black datajoint --check -v
5370
black tests --check -v
71+
publish-docs:
72+
if: |
73+
github.event_name == 'push' &&
74+
(
75+
github.repository_owner == 'datajoint' ||
76+
github.repository_owner == 'datajoint-company' ||
77+
github.repository_owner == 'dj-sciops'
78+
)
79+
needs: build-docs
80+
runs-on: ubuntu-latest
81+
steps:
82+
- uses: actions/checkout@v2
83+
- name: Fetch docs static artifacts
84+
uses: actions/download-artifact@v2
85+
with:
86+
name: docs-api-static
87+
path: docs-api/build/html
88+
- name: Commit documentation changes
89+
run: |
90+
git clone https://github.com/${GITHUB_REPOSITORY}.git \
91+
--branch gh-pages --single-branch gh-pages
92+
rm -R gh-pages/*
93+
cp -r docs-api/build/html/* gh-pages/
94+
cp .gitignore gh-pages/
95+
touch gh-pages/.nojekyll
96+
echo "docs-api.datajoint.org" > gh-pages/CNAME
97+
cd gh-pages
98+
git config --local user.email "[email protected]"
99+
git config --local user.name "GitHub Action"
100+
git add . --all
101+
git commit -m "Update documentation" -a || true
102+
# The above command will fail if no changes were present, so we ignore
103+
# the return code.
104+
- name: Push changes
105+
uses: ad-m/github-push-action@master
106+
with:
107+
branch: gh-pages
108+
directory: gh-pages
109+
github_token: ${{secrets.GITHUB_TOKEN}}

.nojekyll

Whitespace-only changes.

CHANGELOG.md

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

3+
### 0.13.5 -- May 13, 2022
4+
* Update - Import ABC from collections.abc for Python 3.10 compatibility
5+
36
### 0.13.4 -- March, 28 2022
47
* Add - Allow reading blobs produced by legacy 32-bit compiled mYm library for matlab. PR #995
58
* Bugfix - Add missing `jobs` argument for multiprocessing PR #997

datajoint/__init__.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,9 @@
1010
that any use of DataJoint leading to a publication be acknowledged in the publication.
1111
1212
Please cite:
13-
http://biorxiv.org/content/early/2015/11/14/031658
14-
http://dx.doi.org/10.1101/031658
13+
14+
- http://biorxiv.org/content/early/2015/11/14/031658
15+
- http://dx.doi.org/10.1101/031658
1516
"""
1617

1718
__author__ = "DataJoint Contributors"

datajoint/admin.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ def set_password(
2828
def kill(restriction=None, connection=None, order_by=None): # pragma: no cover
2929
"""
3030
view and kill database connections.
31+
3132
:param restriction: restriction to be applied to processlist
3233
:param connection: a datajoint.Connection object. Default calls datajoint.conn()
3334
:param order_by: order by a single attribute or the list of attributes. defaults to 'id'.
@@ -86,6 +87,7 @@ def kill(restriction=None, connection=None, order_by=None): # pragma: no cover
8687
def kill_quick(restriction=None, connection=None):
8788
"""
8889
Kill database connections without prompting. Returns number of terminated connections.
90+
8991
:param restriction: restriction to be applied to processlist
9092
:param connection: a datajoint.Connection object. Default calls datajoint.conn()
9193

datajoint/attribute_adapter.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,17 @@ def attribute_type(self):
1818
def get(self, value):
1919
"""
2020
convert value retrieved from the the attribute in a table into the adapted type
21+
2122
:param value: value from the database
23+
2224
:return: object of the adapted type
2325
"""
2426
raise NotImplementedError("Undefined attribute adapter")
2527

2628
def put(self, obj):
2729
"""
2830
convert an object of the adapted type into a value that DataJoint can store in a table attribute
31+
2932
:param obj: an object of the adapted type
3033
:return: value to store in the database
3134
"""

datajoint/blob.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -188,17 +188,17 @@ def pack_blob(self, obj):
188188
return self.pack_decimal(obj)
189189
if isinstance(obj, uuid.UUID):
190190
return self.pack_uuid(obj)
191-
if isinstance(obj, collections.Mapping):
191+
if isinstance(obj, collections.abc.Mapping):
192192
return self.pack_dict(obj)
193193
if isinstance(obj, str):
194194
return self.pack_string(obj)
195-
if isinstance(obj, collections.ByteString):
195+
if isinstance(obj, collections.abc.ByteString):
196196
return self.pack_bytes(obj)
197-
if isinstance(obj, collections.MutableSequence):
197+
if isinstance(obj, collections.abc.MutableSequence):
198198
return self.pack_list(obj)
199-
if isinstance(obj, collections.Sequence):
199+
if isinstance(obj, collections.abc.Sequence):
200200
return self.pack_tuple(obj)
201-
if isinstance(obj, collections.Set):
201+
if isinstance(obj, collections.abc.Set):
202202
return self.pack_set(obj)
203203
if obj is None:
204204
return self.pack_none()

datajoint/connection.py

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
"""
2-
This module contains the Connection class that manages the connection to the database,
3-
and the `conn` function that provides access to a persistent connection in datajoint.
2+
This module contains the Connection class that manages the connection to the database, and
3+
the ``conn`` function that provides access to a persistent connection in datajoint.
44
"""
55
import warnings
66
from contextlib import contextmanager
@@ -52,6 +52,7 @@ def connect_host_hook(connection_obj):
5252
def translate_query_error(client_error, query):
5353
"""
5454
Take client error and original query and return the corresponding DataJoint exception.
55+
5556
:param client_error: the exception raised by the client interface
5657
:param query: sql query with placeholders
5758
:return: an instance of the corresponding subclass of datajoint.errors.DataJointError
@@ -108,11 +109,9 @@ def conn(
108109
:param password: mysql password
109110
:param init_fun: initialization function
110111
:param reset: whether the connection should be reset or not
111-
:param use_tls: TLS encryption option. Valid options are: True (required),
112-
False (required no TLS), None (TLS prefered, default),
113-
dict (Manually specify values per
114-
https://dev.mysql.com/doc/refman/5.7/en/connection-options.html
115-
#encrypted-connection-options).
112+
:param use_tls: TLS encryption option. Valid options are: True (required), False
113+
(required no TLS), None (TLS prefered, default), dict (Manually specify values per
114+
https://dev.mysql.com/doc/refman/5.7/en/connection-options.html#encrypted-connection-options).
116115
"""
117116
if not hasattr(conn, "connection") or reset:
118117
host = host if host is not None else config["database.host"]
@@ -247,6 +246,7 @@ def set_query_cache(self, query_cache=None):
247246
1. Only SELECT queries are allowed.
248247
2. The results of queries are cached under the path indicated by dj.config['query_cache']
249248
3. query_cache is a string that differentiates different cache states.
249+
250250
:param query_cache: a string to initialize the hash for query results
251251
"""
252252
self._query_cache = query_cache
@@ -298,6 +298,7 @@ def query(
298298
):
299299
"""
300300
Execute the specified query and return the tuple generator (cursor).
301+
301302
:param query: SQL query
302303
:param args: additional arguments for the client.cursor
303304
:param as_dict: If as_dict is set to True, the returned cursor objects returns

datajoint/declare.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,7 @@ def build_index_parser():
153153

154154
def is_foreign_key(line):
155155
"""
156+
156157
:param line: a line from the table definition
157158
:return: true if the line appears to be a foreign key definition
158159
"""
@@ -366,6 +367,7 @@ def prepare_declare(definition, context):
366367
def declare(full_table_name, definition, context):
367368
"""
368369
Parse declaration and generate the SQL CREATE TABLE code
370+
369371
:param full_table_name: full name of the table
370372
:param definition: DataJoint table definition
371373
:param context: dictionary of objects that might be referred to in the table
@@ -566,6 +568,7 @@ def substitute_special_type(match, category, foreign_key_sql, context):
566568
def compile_attribute(line, in_key, foreign_key_sql, context):
567569
"""
568570
Convert attribute definition from DataJoint format to SQL
571+
569572
:param line: attribution line
570573
:param in_key: set to True if attribute is in primary key set
571574
:param foreign_key_sql: the list of foreign key declarations to add to

datajoint/diagram.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,7 @@ def __init__(self, source, context=None):
146146
def from_sequence(cls, sequence):
147147
"""
148148
The join Diagram for all objects in sequence
149+
149150
:param sequence: a sequence (e.g. list, tuple)
150151
:return: Diagram(arg1) + ... + Diagram(argn)
151152
"""

0 commit comments

Comments
 (0)