Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add Filepath and Attachment notebooks #7

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
104 changes: 104 additions & 0 deletions dj-course-01/000-Contents.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Welcome to DataJoint\n",
"DataJoint for Python 3 is a full-featured relational database programming sublanguage.\n",
"\n",
"It is designed for work with scientific data and computational data pipelines. This tutorial assumes intermediate programming proficiency in Python. "
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"## Contents\n",
"\n",
"### 0. Setup \n",
"| | | | |\n",
"|:--|:--|:--|:--|\n",
"| [Set up and Connect](010-Setup.ipynb) | <p align=\"left\">install datajoint, configure database connection, `dj.config`, authentication, change password, save configuration, secure connection | [Administration](020-Admin.ipynb) | <p align=\"left\">configure database server, create user accounts, user privileges"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### 1. Work with Individual Tables\n",
"| | | | |\n",
"|:--|:--|:--|:--|\n",
"| [Create a Schema](100-Schema.ipynb) | <p align=\"left\"> `dj.schema` | [Define a Table](110-Table.ipynb) | <p align=\"left\"> table class, simple attributes types, primary and secondary attributes, `insert`, `insert1`, `delete`, `describe`.\n",
"| [Fetch](120-Fetch.ipynb)| <p align=\"left\"> `fetch`, `fetch1`, `head`, `tail`, `len` | [Restrict and project](130-Restrict-Project.ipynb) | <p align=\"left\"> `&`, `-`, `.proj`, `AndList`, restricted `delete`.\n",
"| [More Attribute Types](MoreTypes.ipynb) | <p align=\"left\"> `uuid`, `raw`| [Blobs](130-Blobs.ipynb) | <p align=\"left\"> storing complex data \n",
"| [Attachments](135-Attach.ipynb) | <p align=\"left\"> attaching files | [Lookup Tables](135-Lookup.ipynb) | <p align=\"left\"> specifying fixed contents | \n",
"| [External Storage](160-External.ipynb) | <p align=\"left\"> storing blobs and attachments in external filesystems and AWS S3 | [File Management](170-Filepath.ipynb) | <p align=\"left\"> tracking files in an external repository\n",
"| [Adapted Attribute Types](180-AdaptedTypes.ipynb) | <p align=\"left\"> user-defined attribute types | [Redefining Tables](185-Redefine.ipynb) | <p align=\"left\"> `drop`, `alter`\n",
"| [Secondary Indexes](188-SecondaryIndexes.ipynb) | <p align=\"left\"> secondary indexes | [Transactions](190-Transactions.ipynb) | <p align=\"left\"> Transactions \n",
"| [Log](195-Log.ipynb) | <p align=\"left\"> The log table"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### 2. Work with Multiple Tables\n",
"| | | | |\n",
"|:--|:--|:--|:--|\n",
"| [Schemas and Modules](200-SchemaModules.ipynb) | <p align=\"left\"> correspondence between schemas and modules | [Dependencies](210-Dependencies.ipynb) | <p align=\"left\"> primary and secondary dependencies, referential constraints, cascading deletes\n",
"| [Work with Existing Schemas](220-Existing.ipynb) | <p align=\"left\"> `dj.list_schemas`, `schema.spawn_missing_classes`, `dj.create_virtual_modules` | [Diagramming](230-Diagramming.ipynb) | `dj.Diagram`, graph algebra, multi-schema databases |\n",
"| [Join and Restrict](240-Join.ipynb) | <p align=\"left\">`*`, using `proj` to control join | [Aggregate](250-Aggregate.ipynb) | <p align=\"left\">`.aggr`\n",
"| [Hierarchical Relationships](250-Nested.ipynb) | <p align=\"left\"> modeling hierarchical or nested data | [Dimensional Relationships](255-Dimensional.ipynb) | <p align=\"left\"> modeling dimensional relationships \n",
"| [Master-part Relationships](Master-Part.ipynb) | <p align=\"left\"> modeling master-part relationships | [Specialization Relationships](260-Specialization.ipynb) | <p align=\"left\"> modeling specialization relationships |\n",
"| [Derived Dependencies](270-DerivedDependencies.ipynb) | <p align=\"left\"> dependencies on query expressions | [Dependency Properties](274-DependencyProperties.ipynb) | <p align=\"left\"> `unique` and `nullable` dependencies\n",
"| [Association Relationships](276-Associations.ipynb) | <p align=\"left\"> modeling associations between entities | [Cyclic Relationships](278-Cyclic.ipynb) | <p align=\"left\"> modeling cyclic relationships | \n",
"| [Universal sets](280-U.ipynb) | <p align=\"left\"> `dj.U` in restrictions, aggregations, and joins | [Union](282-Union.ipynb) | <p align=\"left\"> `+` \n"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### 3. Computations\n",
"| | | | |\n",
"|:--|:--|:--|:--|\n",
"| [Populate](300-SchemaModules.ipynb) | <p align=\"left\"> The `populate` method and the `make` callback in `dj.Imported` and `dj.Computed` tables. | [Distributed Computations](310-Distributed) | <p align=\"left\"> Using `populate` with `reserve_jobs=True`\n",
"| [Jobs Table](320-Jobs.ipynb) | <p align=\"left\"> Working with `schema.jobs` table and `dj.kill` | [Master-Part Computations](330-MasterPart.ipynb) | <p align=\"left\"> Computations in a master-part relationship\n",
"| [Computation Parameters](340-Parameters.ipynb) | <p align=\"left\"> Computation parameters and versions | [Key Source](350-KeySource.ipynb) | <p align=\"left\"> Controlling the scope and granularity of computing jobs with `key_source`\n",
"| [Offline Jobs](360-OfflineJobs.ipynb) | <p align=\"left\"> work with no database connection"
]
},
{
"cell_type": "markdown",
"metadata": {},
"source": [
"### 4. Interfaces & Applications\n",
"| | | | |\n",
"|:--|:--|:--|:--|\n",
"| [Export](410-Export.ipynb) | <p align=\"left\"> exporting data for dataset sharing | [Web GUIs](440-WebGUIs.ipynb) | <p align=\"left\"> wen interfaces\n"
]
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.3"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
71 changes: 71 additions & 0 deletions dj-course-01/010-Setup.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
{
"cells": [
{
"cell_type": "markdown",
"metadata": {},
"source": [
"# Setup\n",
"\n",
"## Install DataJoint\n",
"To get started you will need to install `datajoint` from PyPi:\n",
"\n",
"```shell\n",
"$ pip install datajoint\n",
"```\n",
"\n",
"Import datajoint and verify its version. It should be 0.12 or higher. It is a common convention to import datajoint as `dj`:"
]
},
{
"cell_type": "code",
"execution_count": 2,
"metadata": {},
"outputs": [
{
"ename": "SyntaxError",
"evalue": "invalid syntax (external.py, line 166)",
"output_type": "error",
"traceback": [
"Traceback \u001b[0;36m(most recent call last)\u001b[0m:\n",
" File \u001b[1;32m\"/home/dimitri/.local/lib/python3.7/site-packages/IPython/core/interactiveshell.py\"\u001b[0m, line \u001b[1;32m3326\u001b[0m, in \u001b[1;35mrun_code\u001b[0m\n exec(code_obj, self.user_global_ns, self.user_ns)\n",
" File \u001b[1;32m\"<ipython-input-2-a1238753d0e2>\"\u001b[0m, line \u001b[1;32m1\u001b[0m, in \u001b[1;35m<module>\u001b[0m\n import datajoint as dj\n",
" File \u001b[1;32m\"/home/dimitri/dev/datajoint-python/datajoint/__init__.py\"\u001b[0m, line \u001b[1;32m33\u001b[0m, in \u001b[1;35m<module>\u001b[0m\n from .schema import Schema as schema\n",
"\u001b[0;36m File \u001b[0;32m\"/home/dimitri/dev/datajoint-python/datajoint/schema.py\"\u001b[0;36m, line \u001b[0;32m13\u001b[0;36m, in \u001b[0;35m<module>\u001b[0;36m\u001b[0m\n\u001b[0;31m from .external import ExternalMapping\u001b[0m\n",
"\u001b[0;36m File \u001b[0;32m\"/home/dimitri/dev/datajoint-python/datajoint/external.py\"\u001b[0;36m, line \u001b[0;32m166\u001b[0m\n\u001b[0;31m with open(full_path, 'rb')\u001b[0m\n\u001b[0m ^\u001b[0m\n\u001b[0;31mSyntaxError\u001b[0m\u001b[0;31m:\u001b[0m invalid syntax\n"
]
}
],
"source": [
"import datajoint as dj"
]
},
{
"cell_type": "code",
"execution_count": null,
"metadata": {},
"outputs": [],
"source": []
}
],
"metadata": {
"kernelspec": {
"display_name": "Python 3",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.7.3"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
Loading