Skip to content

Commit aff1495

Browse files
committed
updating all references to relation to either table or query
1 parent 16d58ea commit aff1495

File tree

14 files changed

+48
-49
lines changed

14 files changed

+48
-49
lines changed

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ Documentation and tutorials available at https://docs.datajoint.io and https://t
273273

274274
### 0.3.4
275275
* Added method the `ERD.add_parts` method, which adds the part tables of all tables currently in the ERD.
276-
* `ERD() + arg` and `ERD() - arg` can now accept relation classes as arg.
276+
* `ERD() + arg` and `ERD() - arg` can now accept table classes as arg.
277277

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

284284
### 0.3.2.
285285
* Fixed issue #223: `insert` can insert relations without fetching.
286-
* 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).
286+
* 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).
287287
* ERD.draw() no longer has the `prefix` argument: class names are shown as found in the context.

datajoint/autopopulate.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ def _call_populate1(key):
4343

4444
class AutoPopulate:
4545
"""
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,
46+
AutoPopulate is a mixin class that adds the method populate() to a Table class.
47+
Auto-populated tables must inherit from both Table and AutoPopulate,
4848
must define the property `key_source`, and must define the callback method `make`.
4949
"""
5050

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

118118
def _jobs_to_do(self, restrictions):
119119
"""
120-
:return: the relation containing the keys to be computed (derived from self.key_source)
120+
:return: the query yeilding the keys to be computed (derived from self.key_source)
121121
"""
122122
if self.restriction:
123123
raise DataJointError(

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
@@ -158,7 +158,7 @@ def __call__(
158158
unpacks blob attributes.
159159
160160
:param attrs: zero or more attributes to fetch. If not provided, the call will return all attributes of this
161-
relation. If provided, returns tuples with an entry for each attribute.
161+
table. If provided, returns tuples with an entry for each attribute.
162162
:param offset: the number of tuples to skip in the returned result
163163
:param limit: the maximum number of tuples to return
164164
:param order_by: a single attribute or the list of attributes to order the results. No ordering should be assumed
@@ -170,7 +170,7 @@ def __call__(
170170
True for .fetch('KEY')
171171
:param squeeze: if True, remove extra dimensions from arrays
172172
:param download_path: for fetches that download data, e.g. attachments
173-
:return: the contents of the relation in the form of a structured numpy.array or a dict list
173+
:return: the contents of the table in the form of a structured numpy.array or a dict list
174174
"""
175175
if order_by is not None:
176176
# if 'order_by' passed in a string, make into list
@@ -317,7 +317,7 @@ def __call__(self, *attrs, squeeze=False, download_path="."):
317317
If attrs is empty, the return result is a dict
318318
:param squeeze: When true, remove extra dimensions from arrays in attributes
319319
:param download_path: for fetches that download data, e.g. attachments
320-
:return: the one tuple in the relation in the form of a dict
320+
:return: the one tuple in the table in the form of a dict
321321
"""
322322
heading = self._expression.heading
323323

datajoint/heading.py

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

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

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>

datajoint/schemas.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -171,7 +171,7 @@ def __call__(self, cls, *, context=None):
171171
context = context or self.context or inspect.currentframe().f_back.f_locals
172172
if issubclass(cls, Part):
173173
raise DataJointError(
174-
"The schema decorator should not be applied to Part relations"
174+
"The schema decorator should not be applied to Part tables."
175175
)
176176
if self.is_activated():
177177
self._decorate_master(cls, context)
@@ -282,7 +282,7 @@ def size_on_disk(self):
282282

283283
def spawn_missing_classes(self, context=None):
284284
"""
285-
Creates the appropriate python user relation classes from tables in the schema and places them
285+
Creates the appropriate python user table classes from tables in the schema and places them
286286
in the context.
287287
288288
:param context: alternative context to place the missing classes into, e.g. locals()
@@ -319,7 +319,7 @@ def spawn_missing_classes(self, context=None):
319319
if re.fullmatch(Part.tier_regexp, table_name):
320320
part_tables.append(table_name)
321321
else:
322-
# declare and decorate master relation classes
322+
# declare and decorate master table classes
323323
context[class_name] = self(
324324
type(class_name, (cls,), dict()), context=context
325325
)

datajoint/table.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ def insert(
355355
356356
Example:
357357
358-
>>> relation.insert([
358+
>>> Table.insert([
359359
>>> dict(subject_id=7, species="mouse", date_of_birth="2014-09-01"),
360360
>>> dict(subject_id=8, species="mouse", date_of_birth="2014-09-02")])
361361
"""
@@ -613,8 +613,7 @@ def cascade(table):
613613

614614
def drop_quick(self):
615615
"""
616-
Drops the table associated with this relation without cascading and without user prompt.
617-
If the table has any dependent table(s), this call will fail with an error.
616+
Drops the table without cascading to dependent tables and without user prompt.
618617
"""
619618
if self.is_declared:
620619
query = "DROP TABLE %s" % self.full_table_name
@@ -682,7 +681,7 @@ def show_definition(self):
682681

683682
def describe(self, context=None, printout=True):
684683
"""
685-
:return: the definition string for the relation using DataJoint DDL.
684+
:return: the definition string for the query using DataJoint DDL.
686685
"""
687686
if context is None:
688687
frame = inspect.currentframe().f_back
@@ -1005,7 +1004,7 @@ def lookup_class_name(name, context, depth=3):
10051004

10061005
class FreeTable(Table):
10071006
"""
1008-
A base relation without a dedicated class. Each instance is associated with a table
1007+
A base table without a dedicated class. Each instance is associated with a table
10091008
specified by full_table_name.
10101009
10111010
:param conn: a dj.Connection object

datajoint/user_tables.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
"""
2-
Hosts the table tiers, user relations should be derived from.
2+
Hosts the table tiers, user tables should be derived from.
33
"""
44

55
from .table import Table
@@ -83,7 +83,7 @@ def __iter__(cls):
8383

8484
class UserTable(Table, metaclass=TableMeta):
8585
"""
86-
A subclass of UserTable is a dedicated class interfacing a base relation.
86+
A subclass of UserTable is a dedicated class interfacing a base table.
8787
UserTable is initialized by the decorator generated by schema().
8888
"""
8989

@@ -164,7 +164,7 @@ class Imported(UserTable, AutoPopulate):
164164

165165
class Computed(UserTable, AutoPopulate):
166166
"""
167-
Inherit from this class if the table's values are computed from other relations in the schema.
167+
Inherit from this class if the table's values are computed from other tables in the schema.
168168
The inherited class must at least provide the function `_make_tuples`.
169169
"""
170170

@@ -174,10 +174,10 @@ class Computed(UserTable, AutoPopulate):
174174

175175
class Part(UserTable):
176176
"""
177-
Inherit from this class if the table's values are details of an entry in another relation
178-
and if this table is populated by this relation. For example, the entries inheriting from
177+
Inherit from this class if the table's values are details of an entry in another table
178+
and if this table is populated by the other table. For example, the entries inheriting from
179179
dj.Part could be single entries of a matrix, while the parent table refers to the entire matrix.
180-
Part relations are implemented as classes inside classes.
180+
Part tables are implemented as classes inside classes.
181181
"""
182182

183183
_connection = None

0 commit comments

Comments
 (0)