Skip to content

Commit 534b65c

Browse files
committed
Docs edits, CICD wf
1 parent 1c58ce2 commit 534b65c

File tree

13 files changed

+120
-123
lines changed

13 files changed

+120
-123
lines changed

.github/workflows/development.yaml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,3 +37,22 @@ jobs:
3737
COMPOSE_HTTP_TIMEOUT: "120"
3838
run: |
3939
docker-compose -f LNX-docker-compose.yaml up --build --exit-code-from app
40+
publish-docs:
41+
if: |
42+
github.event_name == 'push' &&
43+
startsWith(github.ref, 'refs/tags')
44+
needs: test
45+
runs-on: ubuntu-latest
46+
env:
47+
DOCKER_CLIENT_TIMEOUT: "120"
48+
COMPOSE_HTTP_TIMEOUT: "120"
49+
steps:
50+
- uses: actions/checkout@v2
51+
- name: Deploy docs
52+
run: |
53+
export MODE=BUILD
54+
export PACKAGE=datajoint
55+
export UPSTREAM_REPO=https://github.com/${GITHUB_REPOSITORY}.git
56+
export HOST_UID=$(id -u)
57+
docker compose -f docs/docker-compose.yaml up --exit-code-from docs --build
58+
git push origin gh-pages

CHANGELOG.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Changelog
2+
3+
Observes [Semantic Versioning](https://semver.org/spec/v2.0.0.html) standard and
4+
[Keep a Changelog](https://keepachangelog.com/en/1.0.0/) convention.
5+
6+
## [3.5.0] - 2022-03-21
7+
8+
+ Bugfix: Cascading delete for renamed foreign keys (#379) PR #386
9+
+ Minor: Add renaming the same attribute multiple times within a single projection PR #386
10+
+ Minor: Add config for reading values with 32-bit dimensions (datajoint/mym#86) PR #395
11+
12+
[3.5.0]: https://github.com/datajoint/element-deeplabcut/releases/tag/3.5.0

README.md

Lines changed: 21 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4,26 +4,25 @@
44

55
DataJoint for MATLAB is a high-level programming interface for relational databases designed to support data processing chains in science labs. DataJoint is built on the foundation of the relational data model and prescribes a consistent method for organizing, populating, and querying data.
66

7-
DataJoint was initially developed in 2009 by Dimitri Yatsenko in Andreas Tolias' Lab at Baylor College of Medicine for the distributed processing and management of large volumes of data streaming from regular experiments. Starting in 2011, DataJoint has been available as an open-source project adopted by other labs and improved through contributions from several developers.
8-
Presently, the primary developer of DataJoint open-source software is the company DataJoint (https://datajoint.com). Related resources are listed at https://datajoint.org.
9-
10-
For more information, please visit our [documentation](https://datajoint.com/docs/core/datajoint-matlab/).
11-
12-
## Config
13-
For help in utilizing `dj.config` (added in `3.4.0`), you may access the help via `help('dj.config')` or review it online [here](https://github.com/datajoint/datajoint-matlab/blob/c2bd6b3e195dfeef773d4e12bad5573c461193b0/%2Bdj/config.m#L2-L27). Formal documentation to follow.
7+
For more information, see our
8+
[general](https://datajoint.com/docs/welcome/) and
9+
[MATLAB](https://datajoint.com/docs/core/datajoint-matlab/) documentation pages.
1410

1511
## Citation
12+
1613
+ If your work uses DataJoint for MATLAB, please cite the following Research Resource Identifier (RRID) and manuscript.
1714

1815
+ DataJoint ([RRID:SCR_014543](https://scicrunch.org/resolver/SCR_014543)) - DataJoint for MATLAB (version `<Enter version number>`)
1916

2017
+ Yatsenko D, Reimer J, Ecker AS, Walker EY, Sinz F, Berens P, Hoenselaar A, Cotton RJ, Siapas AS, Tolias AS. DataJoint: managing big scientific data using MATLAB or Python. bioRxiv. 2015 Jan 1:031658. doi: https://doi.org/10.1101/031658
2118

22-
## Running Tests Locally
19+
## For Developers: Running Tests Locally
20+
2321
<details>
2422
<summary>Click to expand details</summary>
2523

26-
* Create an `.env` with desired development environment values e.g.
24+
+ Create an `.env` with desired development environment values e.g.
25+
2726
``` sh
2827
MATLAB_USER=rguzman
2928
MATLAB_LICENSE=IyBCRUd... # For image usage instructions see https://github.com/guzman-raphael/matlab, https://hub.docker.com/r/raphaelguzman/matlab
@@ -34,11 +33,12 @@ MATLAB_GID=1000
3433
MYSQL_TAG=5.7
3534
MINIO_VER=RELEASE.2022-01-03T18-22-58Z
3635
```
37-
* `cp local-docker-compose.yaml docker-compose.yaml`
38-
* `docker-compose up` (Note configured `JUPYTER_PASSWORD`)
39-
* Select a means of running MATLAB e.g. Jupyter Notebook, GUI, or Terminal (see bottom)
40-
* Add `tests` directory to path e.g. in MATLAB, `addpath('tests')`
41-
* Run desired tests. Some examples are as follows:
36+
37+
+ `cp local-docker-compose.yaml docker-compose.yaml`
38+
+ `docker-compose up` (Note configured `JUPYTER_PASSWORD`)
39+
+ Select a means of running MATLAB e.g. Jupyter Notebook, GUI, or Terminal (see bottom)
40+
+ Add `tests` directory to path e.g. in MATLAB, `addpath('tests')`
41+
+ Run desired tests. Some examples are as follows:
4242

4343
| Use Case | MATLAB Code |
4444
| ---------------------------- | ------------------------------------------------------------------------------ |
@@ -47,23 +47,20 @@ MINIO_VER=RELEASE.2022-01-03T18-22-58Z
4747
| Run one specific test | `runtests('TestTls/TestTls_testInsecureConn')` |
4848
| Run tests based on test name | `import matlab.unittest.TestSuite;`<br>`import matlab.unittest.selectors.HasName;`<br>`import matlab.unittest.constraints.ContainsSubstring;`<br>`suite = TestSuite.fromClass(?Main, ... `<br><code>&nbsp;&nbsp;&nbsp;&nbsp;</code>`HasName(ContainsSubstring('Conn')));`<br>`run(suite)`|
4949

50-
5150
### Launch Jupyter Notebook
5251

53-
* Navigate to `localhost:8888`
54-
* Input Jupyter password
55-
* Launch a notebook i.e. `New > MATLAB`
56-
52+
+ Navigate to `localhost:8888`
53+
+ Input Jupyter password
54+
+ Launch a notebook i.e. `New > MATLAB`
5755

5856
### Launch MATLAB GUI (supports remote interactive debugger)
5957

60-
* Shell into `datajoint-matlab_app_1` i.e. `docker exec -it datajoint-matlab_app_1 bash`
61-
* Launch Matlab by runnning command `matlab`
62-
58+
+ Shell into `datajoint-matlab_app_1` i.e. `docker exec -it datajoint-matlab_app_1 bash`
59+
+ Launch Matlab by running command `matlab`
6360

6461
### Launch MATLAB Terminal
6562

66-
* Shell into `datajoint-matlab_app_1` i.e. `docker exec -it datajoint-matlab_app_1 bash`
67-
* Launch Matlab with no GUI by runnning command `matlab -nodisplay`
63+
+ Shell into `datajoint-matlab_app_1` i.e. `docker exec -it datajoint-matlab_app_1 bash`
64+
+ Launch Matlab with no GUI by running command `matlab -nodisplay`
6865

6966
</details>

docs/.docker/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ RUN \
99
git config --global user.email "[email protected]"&& \
1010
git config --global pull.rebase false && \
1111
git init
12-
COPY --chown=anaconda:anaconda ./${PACKAGE} /main/${PACKAGE}
12+
# COPY --chown=anaconda:anaconda ./${PACKAGE} /main/${PACKAGE}
1313
COPY --chown=anaconda:anaconda ./docs/mkdocs.yaml /main/docs/mkdocs.yaml
1414
COPY --chown=anaconda:anaconda ./docs/src /main/docs/src
1515
COPY --chown=anaconda:anaconda ./CHANGELOG.md /main/docs/src/about/changelog.md

docs/cspell.json

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,16 @@
1515
"src/archive"
1616
],
1717
"words": [
18-
"conda",
18+
"ghtb",
19+
"disp",
20+
"mltbx",
21+
"setenv",
22+
"isempty",
23+
"fetchn",
24+
"struct",
1925
"linenums",
2026
"repr",
27+
"conda",
2128
"numpy",
2229
"sess",
2330
"cond",

docs/mkdocs.yaml

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,12 +11,11 @@ nav:
1111
- Common Commands: query-lang/common-commands.md
1212
- Operators: query-lang/operators.md
1313
- Iteration: query-lang/iteration.md
14-
- Query Caching: query-lang/query-caching.md
1514
- Reproducibility:
1615
- Table Tiers: reproduce/table-tiers.md
1716
- Make Method: reproduce/make-method.md
18-
- Tutorials: tutorials.md
19-
- Changelog: about/changelog.md
17+
# - Tutorials: tutorials.md # Commented out pending viable draft
18+
- Changelog: changelog.md
2019

2120
# ---------------------------- STANDARD -----------------------------
2221

@@ -50,9 +49,6 @@ plugins:
5049
- redirects:
5150
redirect_maps:
5251
"index.md": "getting-started/index.md"
53-
- gen-files:
54-
scripts:
55-
- ./src/api/make_pages.py
5652
- literate-nav:
5753
nav_file: navigation.md
5854
- exclude-search:

docs/src/changelog.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
../../CHANGELOG.md

docs/src/concepts/existing-pipelines.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ experiment_schema = experiment.getSchema();
2121
experiment_schema.v.Session() & 'session_id=1234';
2222
```
2323

24-
Note: You can view the available tables in a schema by using tab completion on
25-
the `schema.v` property.
24+
???+ Note
25+
26+
You can view the available tables in a schema by using tab completion on
27+
the `schema.v` property.
2628

2729
To visualize an unfamiliar schema, see commands for generating [diagrams](../../getting-started/#diagram).

docs/src/getting-started/index.md

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,6 @@ First, please install DataJoint via one of the following:
1010
2. Search and Select `DataJoint`
1111
3. Select *Add from GitHub*
1212

13-
=== "GHToolbox"
14-
15-
1. Install *GHToolbox* using using an appropriate method in https://github.com/datajoint/GHToolbox
16-
2. run: `ghtb.install('datajoint/datajoint-matlab')`
17-
1813
=== "Matlab < R2016"
1914

2015
1. Utilize MATLAB built-in GUI i.e. *Top Ribbon -> Add-Ons -> Get Add-Ons*
@@ -25,6 +20,11 @@ First, please install DataJoint via one of the following:
2520
6. Right-Click and Select *Install*
2621
7. Select *Install*
2722

23+
=== "GHToolbox"
24+
25+
1. Install *GHToolbox* using using an appropriate method in https://github.com/datajoint/GHToolbox
26+
2. run: `ghtb.install('datajoint/datajoint-matlab')`
27+
2828
=== "From source"
2929

3030
1. Download `DataJoint.mltbx` locally
@@ -48,15 +48,15 @@ server `tutorial-db.datajoint.io` with username `alice` and password
4848

4949
```matlab
5050
setenv DJ_USER alice
51-
setenv DJ_HOST alicelab.datajoint.io
51+
setenv DJ_HOST tutorial-db.datajoint.io
5252
setenv DJ_PASS 'fake-password'
5353
```
5454

5555
!!! note
5656

5757
Although you may connect to any MySQL server of your choice, the DataJoint company
5858
offers an online tutorial environment at `tutorial-db.datajoint.io`. Simply sign up
59-
for a free[DataJoint account](https://accounts.datajoint.io). You will be granted
59+
for a free [DataJoint account](https://accounts.datajoint.io). You will be granted
6060
privileges to create schemas that are prefixed as `{user}_`.
6161

6262
You will need to execute these commands at the beginning of each DataJoint work session.
@@ -71,11 +71,15 @@ password when connecting to the database.
7171
To change the database password, use the following command
7272

7373
```matlab
74-
>> dj.setPassword('my#cool!new*psswrd')
74+
>> dj.setPassword('my#cool!new*password')
7575
```
7676

7777
And update your credentials in your startup script for the next session.
7878

79+
For more information on various settings, access help via `help('dj.config')` or review
80+
it online
81+
[here](https://github.com/datajoint/datajoint-matlab/blob/c2bd6b3e195dfeef773d4e12bad5573c461193b0/%2Bdj/config.m#L2-L27).
82+
7983
## Creating Schemas
8084

8185
A schema can be created either automatically using the `dj.createSchema`
@@ -90,7 +94,7 @@ We can create the database schema using the following command:
9094
query(dj.conn, 'CREATE SCHEMA `{user}_my_schema`')
9195
```
9296

93-
!!! Note "Server privileges"
97+
??? Note "Server privileges"
9498

9599
You must have create privileges for the schema name pattern. It is a common practice
96100
to grant all privileges to users for schemas that begin with the username, in
@@ -250,6 +254,9 @@ Or for individual or sets of tables:
250254
erd my_schema.Rectangle
251255
draw(dj.ERD(my_schema.Rectangle) + dj.ERD(my_schema.Area))
252256
```
257+
258+
![Shapes Pipeline](../images/shapes_pipeline.svg)
259+
253260
### Customize
254261

255262
Adding or substracting a number to a diagram object adds nodes downstream or upstream,

docs/src/query-lang/common-commands.md

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
XX - refer to existing table defintions
21
# Common Commands
32

43
<!-- ## Insert is present in the general docs here-->
@@ -39,9 +38,9 @@ For example, the two methods below are equivalent although the second
3938
method creates an extra variable.
4039

4140
``` matlab
42-
result = fetch(university.Student, '*');
41+
result = fetch(my_schema.Rectangle, '*');
4342
44-
query = university.Student;
43+
query = my_schema.Rectangle;
4544
result = query.fetch()
4645
```
4746

@@ -53,7 +52,7 @@ the `struct`.
5352

5453
``` matlab
5554
keys = query.fetch;
56-
keys = fetch(university.Student & university.StudentMajor);
55+
keys = fetch(my_schema.Rectangle & my_schema.Area);
5756
```
5857

5958
Note that MATLAB allows calling functions without the parentheses `()`.
@@ -65,7 +64,7 @@ retrieves the entire result as a struct array.
6564

6665
``` matlab
6766
data = query.fetch('*');
68-
data = fetch(university.Student & university.StudentMajor, '*');
67+
data = fetch(my_schema.Rectangle & my_schema.Area, '*');
6968
```
7069

7170
??? Note "For very large tables..."
@@ -92,8 +91,8 @@ returned in the form of cell arrays, even when `query` happens to contain a sing
9291
entity.
9392

9493
``` matlab
95-
[name, img] = query.fetch1('name', 'image'); % (1)
96-
[names, imgs] = query.fetchn('name', 'image'); % (2)
94+
[shape_id, height] = query.fetch1('shape_id', 'shape_height'); % (1)
95+
[shape_ids, heights] = query.fetchn('shape_id', 'shape_height'); % (2)
9796
```
9897

9998
1. When the table has exactly one entity.
@@ -106,20 +105,21 @@ retrieved by `fetchn`. This can be done by adding a special input argument indic
106105
the request and another output argument to receive the key values:
107106

108107
``` matlab
109-
[names, imgs, keys] = query.fetchn('name', 'image', 'KEY');
108+
[shape_ids, heights, keys] = query.fetchn('shape_id', 'shape_height', 'KEY');
110109
```
111110

112111
The resulting value of `keys` will be a column array of type `struct`.
113112
This mechanism is only implemented for `fetchn`.
114113

115114
### Rename and calculate
116115

117-
In DataJoint for MATLAB, all `fetch` methods have all the same capability as the `proj
118-
<proj>` operator. For example, renaming an attribute can be accomplished using the
119-
syntax below.
116+
In DataJoint for MATLAB, all `fetch` methods have all the same capability as the
117+
[`proj` operator](../operators#proj). For example, renaming an attribute can be
118+
accomplished using the syntax below.
120119

121120
``` matlab
122-
[names, BMIs] = query.fetchn('name', 'weight/height/height -> bmi');
121+
[shape_ids, perimeter] = query.fetchn('shape_id', ...
122+
'2*(shape_height+shape_width) -> perimeter');
123123
```
124124

125125
See [`proj`](../operators#proj) for an in-depth description of projection.
@@ -129,23 +129,23 @@ See [`proj`](../operators#proj) for an in-depth description of projection.
129129
To sort the result, add the additional `ORDER BY` argument in `fetch` and `fetchn`
130130
methods as the last argument.
131131

132-
The following command retrieves the field `course_name` from courses in the biology
133-
department, sorted by course number.
132+
The following command retrieves the field `shape_id` from rectangles with height greater
133+
than 2, sorted by width.
134134

135135
``` matlab
136-
notes = fetchn(university.Course & 'dept="BIOL"', 'course_name', ...
137-
'ORDER BY course');
136+
notes = fetchn(my_schema.Rectangle & 'shape_height>2"', 'shape_id' ...
137+
'ORDER BY shape_width');
138138
```
139139

140140
The ORDER BY argument is passed directly to SQL and follows the same syntax as the
141141
[ORDER BY clause](https://dev.mysql.com/doc/refman/5.7/en/order-by-optimization.html)
142142

143143
Similarly, the LIMIT and OFFSET clauses can be used to limit the result to a subset of
144-
entities. For example, to return the most advanced courses, one could do the
144+
entities. For example, to return the five rectangles with largest area, one could do the
145145
following:
146146

147147
``` matlab
148-
s = fetch(university.Course, '*', 'ORDER BY course DESC LIMIT 5')
148+
s = fetch(my_schema.Area, '*', 'ORDER BY shape_area DESC LIMIT 5')
149149
```
150150

151151
The limit clause is passed directly to SQL and follows the same

0 commit comments

Comments
 (0)