Skip to content

Commit b6f37b3

Browse files
rename chapter operations -> manipulations
1 parent 5faf6a7 commit b6f37b3

File tree

15 files changed

+902
-349
lines changed

15 files changed

+902
-349
lines changed

.devcontainer/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,10 +30,10 @@ RUN wget --quiet https://repo.anaconda.com/miniconda/Miniconda3-latest-Linux-x86
3030
# Install additional tools or packages as needed in the base environment
3131
RUN conda init bash && \
3232
conda install -n base -c conda-forge python=3.11 python-graphviz jupyterlab 'nodejs>20,<21' pip -y && \
33+
pip install ipython-sql && \
3334
pip install mystmd && \
3435
pip install jupyterlab_myst && \
3536
pip install git+https://github.com/datajoint/datajoint-python.git && \
36-
pip install ipython-sql && \
3737
pip install Faker
3838

3939
# Set up shell to use Conda by default

LICENSE.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
By exercising the Licensed Rights (defined below), You accept and agree to be bound by the terms and conditions of this Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International Public License ("Public License"). To the extent this Public License may be interpreted as a contract, You are granted the Licensed Rights in consideration of Your acceptance of these terms and conditions, and the Licensor grants You such rights in consideration of benefits the Licensor receives from making the Licensed Material available under these terms and conditions.
66

7-
1. License
7+
## 1. License
88
You are free to:
99
- **Share** — copy and redistribute the material in any medium or format
1010

@@ -15,7 +15,7 @@ Under the following terms:
1515

1616
No additional restrictions — You may not apply legal terms or technological measures that legally restrict others from doing anything the license permits.
1717

18-
2. Notices:
18+
## 2. Notices:
1919
- You do not have to comply with the license for elements of the material in the public domain or where your use is permitted by an applicable exception or limitation.
2020
- No warranties are given. The license may not give you all of the permissions necessary for your intended use. For example, other rights such as publicity, privacy, or moral rights may limit how you use the material.
2121

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[![License: CC BY-NC-ND 4.0](https://img.shields.io/badge/License-CC%20BY--NC--ND%204.0-lightgrey.svg)](https://creativecommons.org/licenses/by-nc-nd/4.0/)
22

3-
# Datajoint Workbook
3+
# Datajoint Book
44

55
Welcome to DataJoint book, a comprehensive introduction to relational database programming in the context of scientific computing and data science.
66

book/00-introduction/00-purpose.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,6 @@ authors:
99

1010
This book is a comprehensive guide to *DataJoint for Python* — a specialized framework designed to implement scientific data pipelines that manage data and orchestrate computations in collaborative and AI-powered scientific projects. At its core, DataJoint builds upon the traditional relational database model, enabling scientists, data engineers, and programmers to design and query relational databases. However, DataJoint’s main innovation lies in introducing computational dependencies as a first-class feature within the relational database. This allows researchers to define, execute, and reproduce data processing pipelines with precision and efficiency.
1111

12-
Existing documentation for DataJoint can be found here:
13-
* Current documentation: https://datajoint.com/docs/core/datajoint-python/
14-
- hosted at https://github.com/datajoint/datajoint-python/
15-
* Legacy documentation: https://datajoint.github.io/datajoint-docs-original/python/
16-
- hosted at https://github.com/datajoint/datajoint-docs-original
17-
1812
# Purpose of This Book
1913

2014
This book aims to introduce database programming for data science and scientific computing, using DataJoint as the central tool. DataJoint can be viewed as a data model, a database programming language, and a software framework all in one. Throughout the book, you will learn a rigorous database design methodology, which also serves as a general introduction to relational database programming—albeit with a unique perspective. To support this learning, code examples are provided in both DataJoint and SQL (Structured Query Language), the most common language for interacting with relational databases.

book/35-example-designs/010-sales-database.ipynb

Lines changed: 161 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
},
3434
{
3535
"cell_type": "code",
36-
"execution_count": 6,
36+
"execution_count": 2,
3737
"metadata": {},
3838
"outputs": [
3939
{
@@ -78,7 +78,7 @@
7878
"[]"
7979
]
8080
},
81-
"execution_count": 6,
81+
"execution_count": 2,
8282
"metadata": {},
8383
"output_type": "execute_result"
8484
}
@@ -89,15 +89,15 @@
8989
},
9090
{
9191
"cell_type": "code",
92-
"execution_count": 7,
92+
"execution_count": 3,
9393
"metadata": {},
9494
"outputs": [
9595
{
9696
"name": "stderr",
9797
"output_type": "stream",
9898
"text": [
99-
"[2025-01-14 01:25:11,122][INFO]: Connecting root@localhost:3306\n",
100-
"[2025-01-14 01:25:11,146][INFO]: Connected root@localhost:3306\n"
99+
"[2025-01-15 01:40:49,567][INFO]: Connecting root@localhost:3306\n",
100+
"[2025-01-15 01:40:49,584][INFO]: Connected root@localhost:3306\n"
101101
]
102102
}
103103
],
@@ -109,7 +109,7 @@
109109
},
110110
{
111111
"cell_type": "code",
112-
"execution_count": 8,
112+
"execution_count": 4,
113113
"metadata": {},
114114
"outputs": [
115115
{
@@ -270,17 +270,170 @@
270270
"</svg>"
271271
],
272272
"text/plain": [
273-
"<datajoint.diagram.Diagram at 0x7f065b758a50>"
273+
"<datajoint.diagram.Diagram at 0x7f2a5ab50450>"
274274
]
275275
},
276-
"execution_count": 8,
276+
"execution_count": 4,
277277
"metadata": {},
278278
"output_type": "execute_result"
279279
}
280280
],
281281
"source": [
282282
"dj.Diagram(schema)"
283283
]
284+
},
285+
{
286+
"cell_type": "code",
287+
"execution_count": 5,
288+
"metadata": {},
289+
"outputs": [
290+
{
291+
"data": {
292+
"text/html": [
293+
"\n",
294+
" \n",
295+
" <style type=\"text/css\">\n",
296+
" .Table{\n",
297+
" border-collapse:collapse;\n",
298+
" }\n",
299+
" .Table th{\n",
300+
" background: #A0A0A0; color: #ffffff; padding:4px; border:#f0e0e0 1px solid;\n",
301+
" font-weight: normal; font-family: monospace; font-size: 100%;\n",
302+
" }\n",
303+
" .Table td{\n",
304+
" padding:4px; border:#f0e0e0 1px solid; font-size:100%;\n",
305+
" }\n",
306+
" .Table tr:nth-child(odd){\n",
307+
" background: #ffffff;\n",
308+
" color: #000000;\n",
309+
" }\n",
310+
" .Table tr:nth-child(even){\n",
311+
" background: #f3f1ff;\n",
312+
" color: #000000;\n",
313+
" }\n",
314+
" /* Tooltip container */\n",
315+
" .djtooltip {\n",
316+
" }\n",
317+
" /* Tooltip text */\n",
318+
" .djtooltip .djtooltiptext {\n",
319+
" visibility: hidden;\n",
320+
" width: 120px;\n",
321+
" background-color: black;\n",
322+
" color: #fff;\n",
323+
" text-align: center;\n",
324+
" padding: 5px 0;\n",
325+
" border-radius: 6px;\n",
326+
" /* Position the tooltip text - see examples below! */\n",
327+
" position: absolute;\n",
328+
" z-index: 1;\n",
329+
" }\n",
330+
" #primary {\n",
331+
" font-weight: bold;\n",
332+
" color: black;\n",
333+
" }\n",
334+
" #nonprimary {\n",
335+
" font-weight: normal;\n",
336+
" color: white;\n",
337+
" }\n",
338+
"\n",
339+
" /* Show the tooltip text when you mouse over the tooltip container */\n",
340+
" .djtooltip:hover .djtooltiptext {\n",
341+
" visibility: visible;\n",
342+
" }\n",
343+
" </style>\n",
344+
" \n",
345+
" <b></b>\n",
346+
" <div style=\"max-height:1000px;max-width:1500px;overflow:auto;\">\n",
347+
" <table border=\"1\" class=\"Table\">\n",
348+
" <thead> <tr style=\"text-align: right;\"> <th> <div class=\"djtooltip\">\n",
349+
" <p id=\"primary\">customerNumber</p>\n",
350+
" <span class=\"djtooltiptext\"></span>\n",
351+
" </div></th><th><div class=\"djtooltip\">\n",
352+
" <p id=\"primary\">checkNumber</p>\n",
353+
" <span class=\"djtooltiptext\"></span>\n",
354+
" </div></th><th><div class=\"djtooltip\">\n",
355+
" <p id=\"nonprimary\">paymentDate</p>\n",
356+
" <span class=\"djtooltiptext\"></span>\n",
357+
" </div></th><th><div class=\"djtooltip\">\n",
358+
" <p id=\"nonprimary\">amount</p>\n",
359+
" <span class=\"djtooltiptext\"></span>\n",
360+
" </div> </th> </tr> </thead>\n",
361+
" <tbody> <tr> <td>103</td>\n",
362+
"<td>HQ336336</td>\n",
363+
"<td>2004-10-19</td>\n",
364+
"<td>6066.78</td></tr><tr><td>103</td>\n",
365+
"<td>JM555205</td>\n",
366+
"<td>2003-06-05</td>\n",
367+
"<td>14571.44</td></tr><tr><td>103</td>\n",
368+
"<td>OM314933</td>\n",
369+
"<td>2004-12-18</td>\n",
370+
"<td>1676.14</td></tr><tr><td>112</td>\n",
371+
"<td>BO864823</td>\n",
372+
"<td>2004-12-17</td>\n",
373+
"<td>14191.12</td></tr><tr><td>112</td>\n",
374+
"<td>HQ55022</td>\n",
375+
"<td>2003-06-06</td>\n",
376+
"<td>32641.98</td></tr><tr><td>112</td>\n",
377+
"<td>ND748579</td>\n",
378+
"<td>2004-08-20</td>\n",
379+
"<td>33347.88</td></tr><tr><td>114</td>\n",
380+
"<td>GG31455</td>\n",
381+
"<td>2003-05-20</td>\n",
382+
"<td>45864.03</td></tr><tr><td>114</td>\n",
383+
"<td>MA765515</td>\n",
384+
"<td>2004-12-15</td>\n",
385+
"<td>82261.22</td></tr><tr><td>114</td>\n",
386+
"<td>NP603840</td>\n",
387+
"<td>2003-05-31</td>\n",
388+
"<td>7565.08</td></tr><tr><td>114</td>\n",
389+
"<td>NR27552</td>\n",
390+
"<td>2004-03-10</td>\n",
391+
"<td>44894.74</td></tr><tr><td>119</td>\n",
392+
"<td>DB933704</td>\n",
393+
"<td>2004-11-14</td>\n",
394+
"<td>19501.82</td></tr><tr><td>119</td>\n",
395+
"<td>LN373447</td>\n",
396+
"<td>2004-08-08</td>\n",
397+
"<td>47924.19</td> </tr> </tbody>\n",
398+
" </table>\n",
399+
" <p>...</p>\n",
400+
" <p>Total: 273</p></div>\n",
401+
" "
402+
],
403+
"text/plain": [
404+
"*customerNumbe *checkNumber paymentDate amount \n",
405+
"+------------+ +------------+ +------------+ +----------+\n",
406+
"103 HQ336336 2004-10-19 6066.78 \n",
407+
"103 JM555205 2003-06-05 14571.44 \n",
408+
"103 OM314933 2004-12-18 1676.14 \n",
409+
"112 BO864823 2004-12-17 14191.12 \n",
410+
"112 HQ55022 2003-06-06 32641.98 \n",
411+
"112 ND748579 2004-08-20 33347.88 \n",
412+
"114 GG31455 2003-05-20 45864.03 \n",
413+
"114 MA765515 2004-12-15 82261.22 \n",
414+
"114 NP603840 2003-05-31 7565.08 \n",
415+
"114 NR27552 2004-03-10 44894.74 \n",
416+
"119 DB933704 2004-11-14 19501.82 \n",
417+
"119 LN373447 2004-08-08 47924.19 \n",
418+
" ...\n",
419+
" (Total: 273)"
420+
]
421+
},
422+
"execution_count": 5,
423+
"metadata": {},
424+
"output_type": "execute_result"
425+
}
426+
],
427+
"source": [
428+
"Payment()"
429+
]
430+
},
431+
{
432+
"cell_type": "code",
433+
"execution_count": null,
434+
"metadata": {},
435+
"outputs": [],
436+
"source": []
284437
}
285438
],
286439
"metadata": {

0 commit comments

Comments
 (0)