Skip to content

Commit 7ba4bbc

Browse files
Merge pull request #551 from austin-hilberg/master
Documentation content additions and revisions for M2
2 parents 24f1978 + 71abc6e commit 7ba4bbc

31 files changed

+247
-59
lines changed
Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1 @@
1-
.. code-block:: python
2-
3-
>>> schema.external_table.delete_garbage()
1+
Use ``dj.config`` for configuration.
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1-
.. code-block:: python
1+
This is done by saving the path in the ``cache`` key of the DataJoint configuration dictionary:
22

3-
>>> schema.external_table.clean_store('external-name')
3+
.. code-block:: python
4+
5+
dj.config['cache'] = '/temp/dj-cache'
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.. code-block:: python
2+
3+
>>> schema.external_table.delete_garbage()
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
.. code-block:: python
2+
3+
>>> schema.external_table.clean_store('external-name')
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
The ``populate`` method accepts a number of optional arguments that provide more features and allow greater control over the method's behavior.
2+
3+
- ``restrictions`` - A list of restrictions, restricting as ``(tab.key_source & AndList(restrictions)) - tab.proj()``.
4+
Here ``target`` is the table to be populated, usually ``tab`` itself.
5+
- ``suppress_errors`` - If ``True``, encountering an error will cancel the current ``make`` call, log the error, and continue to the next ``make`` call.
6+
Error messages will be logged in the job reservation table (if ``reserve_jobs`` is ``True``) and returned as a list.
7+
See also ``return_exception_objects`` and ``reserve_jobs``.
8+
Defaults to ``False``.
9+
- ``return_exception_objects`` - If ``True``, error objects are returned instead of error messages.
10+
This applies only when ``suppress_errors`` is ``True``.
11+
Defaults to ``False``.
12+
- ``reserve_jobs`` - If ``True``, reserves job to indicate to other distributed processes.
13+
The job reservation table may be access as ``schema.jobs``.
14+
Errors are logged in the jobs table.
15+
Defaults to ``False``.
16+
- ``order`` - The order of execution, either ``"original"``, ``"reverse"``, or ``"random"``.
17+
Defaults to ``"original"``.
18+
- ``display_progress`` - If ``True``, displays a progress bar.
19+
Defaults to ``False``.
20+
- ``limit`` - If not ``None``, checks at most this number of keys.
21+
Defaults to ``None``.
22+
- ``max_calls`` - If not ``None``, populates at most this many keys.
23+
Defaults to ``None``, which means no limit.
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
The method ``table.progress`` reports how many ``key_source`` entries have been populated and how many remain.
2+
Two optional parameters allow more advanced use of the method.
3+
A parameter of restriction conditions can be provided, specifying which entities to consider.
4+
A Boolean parameter ``display`` (default is ``True``) allows disabling the output, such that the numbers of remaining and total entities are returned but not printed.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
A custom key source can be configured by setting the ``key_source`` property within a table class, after the ``definition`` string.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
.. code-block:: python
2+
3+
@schema
4+
class EEG(dj.Imported):
5+
definition = """
6+
-> Recording
7+
---
8+
sample_rate : float
9+
eeg_data : longblob
10+
"""
11+
key_source = Recording & 'recording_type = "EEG"'
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
.. code-block:: python
2+
3+
@schema
4+
class Mouse(dj.Manual):
5+
definition = """
6+
mouse_name : varchar(64)
7+
---
8+
mouse_dob : datetime
9+
"""
10+
11+
@schema
12+
class MouseDeath(dj.Manual):
13+
definition = """
14+
-> Mouse
15+
---
16+
death_date : datetime
17+
"""
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
.. code-block:: python
2+
3+
@schema
4+
class EEGRecording(dj.Manual):
5+
definition = """
6+
-> Session
7+
eeg_recording_id : int
8+
---
9+
eeg_system : varchar(64)
10+
num_channels : int
11+
"""
12+
13+
@schema
14+
class ChannelData(dj.Imported):
15+
definition = """
16+
-> EEGRecording
17+
channel_idx : int
18+
---
19+
channel_data : longblob
20+
"""

0 commit comments

Comments
 (0)