Skip to content

Commit 0a4f193

Browse files
Fix merge conflicts.
2 parents 6ad07ea + 3b6e845 commit 0a4f193

File tree

124 files changed

+1385
-2721
lines changed

Some content is hidden

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

124 files changed

+1385
-2721
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name: Bug report
33
about: Create a report to help us improve
44
title: ''
5-
labels: 'bug, awaiting-triage'
5+
labels: 'bug'
66
assignees: ''
77

88
---

CHANGELOG.md

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,13 @@
11
## Release notes
22

3-
### 0.14.0 -- TBA
4-
* Add `json` data type ([#245](https://github.com/datajoint/datajoint-python/issues/245)) PR [#1051](https://github.com/datajoint/datajoint-python/pull/1051)
5-
- Fix lingering prints by replacing with logs PR [#1051](https://github.com/datajoint/datajoint-python/pull/1051)
6-
- `table.progress()` defaults to no stdout PR [#1051](https://github.com/datajoint/datajoint-python/pull/1051)
7-
- `table.describe()` defaults to no stdout PR [#1051](https://github.com/datajoint/datajoint-python/pull/1051)
3+
### 0.14.0 -- Feb 08, 2023
4+
* Add - `json` data type ([#245](https://github.com/datajoint/datajoint-python/issues/245)) PR [#1051](https://github.com/datajoint/datajoint-python/pull/1051)
5+
* Bugfix - Convert lingering prints by replacing with logs PR [#1051](https://github.com/datajoint/datajoint-python/pull/1051)
6+
* Update - `table.progress()` defaults to no stdout PR [#1051](https://github.com/datajoint/datajoint-python/pull/1051)
7+
* Update - `table.describe()` defaults to no stdout PR [#1051](https://github.com/datajoint/datajoint-python/pull/1051)
8+
* Bugfix - Activating a schema requires all tables to exist even if `create_tables=False` PR [#1058](https://github.com/datajoint/datajoint-python/pull/1058)
9+
* Update - Populate call with `reserve_jobs=True` to exclude `error` and `ignore` keys PR [#1062](https://github.com/datajoint/datajoint-python/pull/1062)
10+
* Add - Support for inserting data with CSV files PR [#1067](https://github.com/datajoint/datajoint-python/pull/1067)
811

912
### 0.13.8 -- Sep 21, 2022
1013
* Add - New documentation structure based on markdown PR [#1052](https://github.com/datajoint/datajoint-python/pull/1052)
@@ -276,7 +279,7 @@ Documentation and tutorials available at https://docs.datajoint.io and https://t
276279

277280
### 0.3.4
278281
* Added method the `ERD.add_parts` method, which adds the part tables of all tables currently in the ERD.
279-
* `ERD() + arg` and `ERD() - arg` can now accept relation classes as arg.
282+
* `ERD() + arg` and `ERD() - arg` can now accept table classes as arg.
280283

281284
### 0.3.3
282285
* Suppressed warnings (redirected them to logging). Previoiusly, scipy would throw warnings in ERD, for example.
@@ -286,5 +289,5 @@ Documentation and tutorials available at https://docs.datajoint.io and https://t
286289

287290
### 0.3.2.
288291
* Fixed issue #223: `insert` can insert relations without fetching.
289-
* ERD() now takes the `context` argument, which specifies in which context to look for classes. The default is taken from the argument (schema or relation).
292+
* ERD() now takes the `context` argument, which specifies in which context to look for classes. The default is taken from the argument (schema or table).
290293
* ERD.draw() no longer has the `prefix` argument: class names are shown as found in the context.

LNX-docker-compose.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ services:
3737
interval: 15s
3838
fakeservices.datajoint.io:
3939
<<: *net
40-
image: datajoint/nginx:v0.2.3
40+
image: datajoint/nginx:v0.2.4
4141
environment:
4242
- ADD_db_TYPE=DATABASE
4343
- ADD_db_ENDPOINT=db:3306

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -112,15 +112,15 @@ important DataJoint schema or records.
112112

113113
### API docs
114114

115-
The API documentation can be built using sphinx by running
115+
The API documentation can be built with mkdocs using the docker compose file in
116+
`docs/` with the following command:
116117

117118
``` bash
118-
pip install sphinx sphinx_rtd_theme
119-
(cd docs-api/sphinx && make html)
119+
MODE="LIVE" PACKAGE=datajoint UPSTREAM_REPO=https://github.com/datajoint/datajoint-python.git HOST_UID=$(id -u) docker compose -f docs/docker-compose.yaml up --build
120120
```
121121

122-
Generated docs are written to `docs-api/docs/html/index.html`.
123-
More details in [docs-api/README.md](docs-api/README.md).
122+
The site will then be available at `http://localhost/`. When finished, be sure to run
123+
the same command as above, but replace `up --build` with `down`.
124124

125125
## Running Tests Locally
126126
<details>
@@ -141,11 +141,11 @@ HOST_GID=1000
141141
* Add entry in `/etc/hosts` for `127.0.0.1 fakeservices.datajoint.io`
142142
* Run desired tests. Some examples are as follows:
143143

144-
| Use Case | Shell Code |
145-
| ---------------------------- | ------------------------------------------------------------------------------ |
146-
| Run all tests | `nosetests -vsw tests --with-coverage --cover-package=datajoint` |
147-
| Run one specific class test | `nosetests -vs --tests=tests.test_fetch:TestFetch.test_getattribute_for_fetch1` |
148-
| Run one specific basic test | `nosetests -vs --tests=tests.test_external_class:test_insert_and_fetch` |
144+
| Use Case | Shell Code |
145+
| ---------------------------- | ------------------------------------------------------------------------------ |
146+
| Run all tests | `nosetests -vsw tests --with-coverage --cover-package=datajoint` |
147+
| Run one specific class test | `nosetests -vs --tests=tests.test_fetch:TestFetch.test_getattribute_for_fetch1` |
148+
| Run one specific basic test | `nosetests -vs --tests=tests.test_external_class:test_insert_and_fetch` |
149149

150150

151151
### Launch Docker Terminal

datajoint/autopopulate.py

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import random
66
import inspect
77
from tqdm import tqdm
8+
from .hash import key_hash
89
from .expression import QueryExpression, AndList
910
from .errors import DataJointError, LostConnectionError
1011
import signal
@@ -43,8 +44,8 @@ def _call_populate1(key):
4344

4445
class AutoPopulate:
4546
"""
46-
AutoPopulate is a mixin class that adds the method populate() to a Relation class.
47-
Auto-populated relations must inherit from both Relation and AutoPopulate,
47+
AutoPopulate is a mixin class that adds the method populate() to a Table class.
48+
Auto-populated tables must inherit from both Table and AutoPopulate,
4849
must define the property `key_source`, and must define the callback method `make`.
4950
"""
5051

@@ -117,7 +118,7 @@ def _job_key(self, key):
117118

118119
def _jobs_to_do(self, restrictions):
119120
"""
120-
:return: the relation containing the keys to be computed (derived from self.key_source)
121+
:return: the query yeilding the keys to be computed (derived from self.key_source)
121122
"""
122123
if self.restriction:
123124
raise DataJointError(
@@ -202,6 +203,16 @@ def handler(signum, frame):
202203
old_handler = signal.signal(signal.SIGTERM, handler)
203204

204205
keys = (self._jobs_to_do(restrictions) - self.target).fetch("KEY", limit=limit)
206+
207+
# exclude "error" or "ignore" jobs
208+
if reserve_jobs:
209+
exclude_key_hashes = (
210+
jobs
211+
& {"table_name": self.target.table_name}
212+
& 'status in ("error", "ignore")'
213+
).fetch("key_hash")
214+
keys = [key for key in keys if key_hash(key) not in exclude_key_hashes]
215+
205216
if order == "reverse":
206217
keys.reverse()
207218
elif order == "random":

datajoint/diagram.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ class Diagram(nx.DiGraph):
7878
7979
>>> diag = Diagram(source)
8080
81-
source can be a base relation object, a base relation class, a schema, or a module that has a schema.
81+
source can be a base table object, a base table class, a schema, or a module that has a schema.
8282
8383
>>> diag.draw()
8484

datajoint/fetch.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,7 @@ def __call__(
160160
unpacks blob attributes.
161161
162162
:param attrs: zero or more attributes to fetch. If not provided, the call will return all attributes of this
163-
relation. If provided, returns tuples with an entry for each attribute.
163+
table. If provided, returns tuples with an entry for each attribute.
164164
:param offset: the number of tuples to skip in the returned result
165165
:param limit: the maximum number of tuples to return
166166
:param order_by: a single attribute or the list of attributes to order the results. No ordering should be assumed
@@ -172,7 +172,7 @@ def __call__(
172172
True for .fetch('KEY')
173173
:param squeeze: if True, remove extra dimensions from arrays
174174
:param download_path: for fetches that download data, e.g. attachments
175-
:return: the contents of the relation in the form of a structured numpy.array or a dict list
175+
:return: the contents of the table in the form of a structured numpy.array or a dict list
176176
"""
177177
if order_by is not None:
178178
# if 'order_by' passed in a string, make into list
@@ -319,7 +319,7 @@ def __call__(self, *attrs, squeeze=False, download_path="."):
319319
If attrs is empty, the return result is a dict
320320
:param squeeze: When true, remove extra dimensions from arrays in attributes
321321
:param download_path: for fetches that download data, e.g. attachments
322-
:return: the one tuple in the relation in the form of a dict
322+
:return: the one tuple in the table in the form of a dict
323323
"""
324324
heading = self._expression.heading
325325

datajoint/heading.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ def original_name(self):
8585

8686
class Heading:
8787
"""
88-
Local class for relations' headings.
88+
Local class for table headings.
8989
Heading contains the property attributes, which is an dict in which the keys are
9090
the attribute names and the values are Attributes.
9191
"""

datajoint/jobs.py

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

1313
class JobTable(Table):
1414
"""
15-
A base relation with no definition. Allows reserving jobs
15+
A base table with no definition. Allows reserving jobs
1616
"""
1717

1818
def __init__(self, conn, database):

datajoint/preview.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,20 +56,20 @@ def repr_html(query_expression):
5656

5757
css = """
5858
<style type="text/css">
59-
.Relation{
59+
.Table{
6060
border-collapse:collapse;
6161
}
62-
.Relation th{
62+
.Table th{
6363
background: #A0A0A0; color: #ffffff; padding:4px; border:#f0e0e0 1px solid;
6464
font-weight: normal; font-family: monospace; font-size: 100%;
6565
}
66-
.Relation td{
66+
.Table td{
6767
padding:4px; border:#f0e0e0 1px solid; font-size:100%;
6868
}
69-
.Relation tr:nth-child(odd){
69+
.Table tr:nth-child(odd){
7070
background: #ffffff;
7171
}
72-
.Relation tr:nth-child(even){
72+
.Table tr:nth-child(even){
7373
background: #f3f1ff;
7474
}
7575
/* Tooltip container */
@@ -111,7 +111,7 @@ def repr_html(query_expression):
111111
{css}
112112
{title}
113113
<div style="max-height:1000px;max-width:1500px;overflow:auto;">
114-
<table border="1" class="Relation">
114+
<table border="1" class="Table">
115115
<thead> <tr style="text-align: right;"> <th> {head} </th> </tr> </thead>
116116
<tbody> <tr> {body} </tr> </tbody>
117117
</table>

0 commit comments

Comments
 (0)