Skip to content

Commit fdd42fb

Browse files
committed
update references for works-api
1 parent 06f44b3 commit fdd42fb

29 files changed

+64
-67
lines changed
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,8 +48,8 @@ def kill(restriction=None, connection=None, order_by=None):
4848
information_schema.processlist: ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO.
4949
5050
Examples:
51-
dj.kill('HOST LIKE "%compute%"') lists only connections from hosts containing "compute".
52-
dj.kill('TIME > 600') lists only connections in their current state for more than 10 minutes
51+
dj0.kill('HOST LIKE "%compute%"') lists only connections from hosts containing "compute".
52+
dj0.kill('TIME > 600') lists only connections in their current state for more than 10 minutes
5353
"""
5454

5555
if connection is None:
@@ -106,7 +106,7 @@ def kill_quick(restriction=None, connection=None):
106106
information_schema.processlist: ID, USER, HOST, DB, COMMAND, TIME, STATE, INFO.
107107
108108
Examples:
109-
dj.kill('HOST LIKE "%compute%"') terminates connections from hosts containing "compute".
109+
dj0.kill('HOST LIKE "%compute%"') terminates connections from hosts containing "compute".
110110
"""
111111
if connection is None:
112112
connection = conn()
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
"""This module defines class dj.AutoPopulate"""
1+
"""This module defines class dj0.AutoPopulate"""
22

33
import contextlib
44
import datetime
@@ -172,7 +172,7 @@ def make(self, key, **kwargs):
172172
def target(self):
173173
"""
174174
:return: table to be populated.
175-
In the typical case, dj.AutoPopulate is mixed into a dj.Table class by
175+
In the typical case, dj0.AutoPopulate is mixed into a dj0.Table class by
176176
inheritance and the target is self.
177177
"""
178178
return self
@@ -250,7 +250,7 @@ def populate(
250250
:param processes: number of processes to use. Set to None to use all cores
251251
:param make_kwargs: Keyword arguments which do not affect the result of computation
252252
to be passed down to each ``make()`` call. Computation arguments should be
253-
specified within the pipeline e.g. using a `dj.Lookup` table.
253+
specified within the pipeline e.g. using a `dj0.Lookup` table.
254254
:type make_kwargs: dict, optional
255255
:return: a dict with two keys
256256
"success_count": the count of successful ``make()`` calls in this ``populate()`` call
File renamed without changes.

datajoint/cli.py renamed to datajoint_v0/cli.py

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from code import interact
33
from collections import ChainMap
44

5-
import datajoint as dj
5+
import datajoint_v0 as dj0
66

77

88
def cli(args: list = None):
@@ -18,29 +18,29 @@ def cli(args: list = None):
1818
conflict_handler="resolve",
1919
)
2020
parser.add_argument(
21-
"-V", "--version", action="version", version=f"{dj.__name__} {dj.__version__}"
21+
"-V", "--version", action="version", version=f"{dj0.__name__} {dj0.__version__}"
2222
)
2323
parser.add_argument(
2424
"-u",
2525
"--user",
2626
type=str,
27-
default=dj.config["database.user"],
27+
default=dj0.config["database.user"],
2828
required=False,
2929
help="Datajoint username",
3030
)
3131
parser.add_argument(
3232
"-p",
3333
"--password",
3434
type=str,
35-
default=dj.config["database.password"],
35+
default=dj0.config["database.password"],
3636
required=False,
3737
help="Datajoint password",
3838
)
3939
parser.add_argument(
4040
"-h",
4141
"--host",
4242
type=str,
43-
default=dj.config["database.host"],
43+
default=dj0.config["database.host"],
4444
required=False,
4545
help="Datajoint host",
4646
)
@@ -55,15 +55,15 @@ def cli(args: list = None):
5555
kwargs = vars(parser.parse_args(args))
5656
mods = {}
5757
if kwargs["user"]:
58-
dj.config["database.user"] = kwargs["user"]
58+
dj0.config["database.user"] = kwargs["user"]
5959
if kwargs["password"]:
60-
dj.config["database.password"] = kwargs["password"]
60+
dj0.config["database.password"] = kwargs["password"]
6161
if kwargs["host"]:
62-
dj.config["database.host"] = kwargs["host"]
62+
dj0.config["database.host"] = kwargs["host"]
6363
if kwargs["schemas"]:
6464
for vm in kwargs["schemas"]:
6565
d, m = vm.split(":")
66-
mods[m] = dj.create_virtual_module(m, d)
66+
mods[m] = dj0.create_virtual_module(m, d)
6767

6868
banner = "dj repl\n"
6969
if mods:
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ class AndList(list):
5252
applied by logical disjunction (OR).
5353
5454
Example:
55-
expr2 = expr & dj.AndList((cond1, cond2, cond3))
55+
expr2 = expr & dj0.AndList((cond1, cond2, cond3))
5656
is equivalent to
5757
expr2 = expr & cond1 & cond2 & cond3
5858
"""
@@ -120,7 +120,7 @@ def assert_join_compatibility(expr1, expr2):
120120
)
121121
if not isinstance(expr1, U) and not isinstance(
122122
expr2, U
123-
): # dj.U is always compatible
123+
): # dj0.U is always compatible
124124
try:
125125
raise DataJointError(
126126
"Cannot join query expressions on dependent attribute `%s`"
@@ -139,7 +139,7 @@ def make_condition(query_expression, condition, columns):
139139
"""
140140
Translate the input condition into the equivalent SQL condition (a string)
141141
142-
:param query_expression: a dj.QueryExpression object to apply condition
142+
:param query_expression: a dj0.QueryExpression object to apply condition
143143
:param condition: any valid restriction object.
144144
:param columns: a set passed by reference to collect all column names used in the
145145
condition.
@@ -216,7 +216,7 @@ def combine_conditions(negate, conditions):
216216
return not negate # and empty AndList is True
217217
return combine_conditions(negate, conditions=items)
218218

219-
# restriction by dj.U evaluates to True
219+
# restriction by dj0.U evaluates to True
220220
if isinstance(condition, U):
221221
return not negate
222222

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
query_log_max_length = 300
2525

2626

27-
cache_key = "query_cache" # the key to lookup the query_cache folder in dj.config
27+
cache_key = "query_cache" # the key to lookup the query_cache folder in dj0.config
2828

2929

3030
def get_host_hook(host_input):
@@ -163,7 +163,7 @@ def rowcount(self):
163163

164164
class Connection:
165165
"""
166-
A dj.Connection object manages a connection to a database server.
166+
A dj0.Connection object manages a connection to a database server.
167167
It also catalogues modules, schemas, tables, and their dependencies (foreign keys).
168168
169169
Most of the parameters below should be set in the local configuration file.
@@ -257,7 +257,7 @@ def set_query_cache(self, query_cache=None):
257257
"""
258258
When query_cache is not None, the connection switches into the query caching mode, which entails:
259259
1. Only SELECT queries are allowed.
260-
2. The results of queries are cached under the path indicated by dj.config['query_cache']
260+
2. The results of queries are cached under the path indicated by dj0.config['query_cache']
261261
3. query_cache is a string that differentiates different cache states.
262262
263263
:param query_cache: a string to initialize the hash for query results
@@ -327,7 +327,7 @@ def query(
327327
if use_query_cache:
328328
if not config[cache_key]:
329329
raise errors.DataJointError(
330-
f"Provide filepath dj.config['{cache_key}'] when using query caching."
330+
f"Provide filepath dj0.config['{cache_key}'] when using query caching."
331331
)
332332
hash_ = uuid_from_buffer(
333333
(str(self._query_cache) + re.sub(r"`\$\w+`", "", query)).encode()
@@ -422,7 +422,7 @@ def transaction(self):
422422
423423
Example:
424424
>>> import datajoint as dj
425-
>>> with dj.conn().transaction as conn:
425+
>>> with dj0.conn().transaction as conn:
426426
>>> # transaction is open here
427427
"""
428428
try:

0 commit comments

Comments
 (0)