Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ branch = False
source = datajoint

[report]
show_missing = True
show_missing = True
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -47,4 +47,4 @@
}
// Uncomment to connect as an existing user other than the container default. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "devcontainer"
}
}
1 change: 0 additions & 1 deletion .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,4 +29,3 @@ services:

# Overrides default command so things don't shut down after the process ends.
command: /bin/sh -c "while sleep 1000; do :; done"

2 changes: 1 addition & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ build
*.egg-info
dist
.vscode
__pycache__
__pycache__
2 changes: 1 addition & 1 deletion .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ jobs:
export UPSTREAM_REPO=https://github.com/${GITHUB_REPOSITORY}.git
export HOST_UID=$(id -u)
docker compose -f docs/docker-compose.yaml up --exit-code-from docs --build
git push origin gh-pages
git push origin gh-pages
208 changes: 180 additions & 28 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,35 +1,187 @@
.ipynb_checkpoints/
*.json
*/.*.swp
*/.*.swo
*/*.pyc
.DS_Store
__*__
.idea/
*.pyc
.python-version
*.egg-info/
# https://github.com/github/gitignore/blob/main/Python.gitignore

# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST
.vagrant/
dj_local_conf.json
build/

# PyInstaller
# Usually these files are written by a python script from a template
# before PyInstaller builds the exe, so as to inject date/other infos into it.
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
./tests/.coverage
./tests/dj-store/*
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
*.env
docker-compose.yml
notebook
__main__.py
jupyter_custom.js
.eggs
*.code-workspace
docs/site
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

!.vscode/settings.json
!.vscode/launch.json
!.devcontainer/devcontainer.json
!.devcontainer/docker-compose.yml
# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
# For a library or package, you might want to ignore these files since the code is
# intended to run in multiple environments; otherwise, check them in:
.python-version

# pipenv
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
# However, in case of collaboration, if having platform-specific dependencies or dependencies
# having no cross-platform support, pipenv may install dependencies that don't work, or not
# install all needed dependencies.
#Pipfile.lock

# UV
# Similar to Pipfile.lock, it is generally recommended to include uv.lock in version control.
# This is especially recommended for binary packages to ensure reproducibility, and is more
# commonly ignored for libraries.
#uv.lock

# poetry
# Similar to Pipfile.lock, it is generally recommended to include poetry.lock in version control.
# https://python-poetry.org/docs/basic-usage/#commit-your-poetrylock-file-to-version-control
#poetry.lock

# pdm
# Similar to Pipfile.lock, it is generally recommended to include pdm.lock in version control.
#pdm.lock
# pdm stores project-wide configurations in .pdm.toml, but it is recommended to not include it
# in version control.
# https://pdm.fming.dev/latest/usage/project/#working-with-version-control
.pdm.toml
.pdm-python
.pdm-build/

# PEP 582; used by e.g. github.com/David-OConnor/pyflow and github.com/pdm-project/pdm
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

# PyCharm
# JetBrains specific template is maintained in a separate JetBrains.gitignore that can
# be found at https://github.com/github/gitignore/blob/main/Global/JetBrains.gitignore
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
.idea/

# VS Code
.vscode/

# Ruff stuff:
.ruff_cache/

# PyPI configuration file
.pypirc

######################

# Mac OS
.DS_Store

# Datajoint related files
dj_local_conf.json
*.env
!.vscode/launch.json
50 changes: 50 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# pip install datajoint[test]
# pre-commit install
# pre-commit run --all-files
# pre-commit autoupdate
# SKIP=flake8 git commit -m "foo"

# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: check-yaml
exclude: 'docs/mkdocs.yaml' # exclude mkdocs.yaml since pymdownx.emoji !! usage
- id: check-json
exclude: '(.vscode|.devcontainer)' # exclude these since // was used for comments
- id: check-toml
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-added-large-files
- repo: https://github.com/codespell-project/codespell
rev: v2.4.1
hooks:
- id: codespell
- repo: https://github.com/pycqa/isort
rev: 5.12.0 # Use the latest stable version
hooks:
- id: isort
args:
- --profile=black # Optional, makes isort compatible with Black
- repo: https://github.com/psf/black
rev: 24.2.0 # matching versions in pyproject.toml and github actions
hooks:
- id: black
args: ["--check", "-v", "datajoint", "tests", "--diff"] # --required-version is conflicting with pre-commit
- repo: https://github.com/PyCQA/flake8
rev: 7.1.2
hooks:
- id: flake8
args:
- --ignore=E203,E722,W503
- --count
- --max-complexity=62
- --max-line-length=127
- --statistics
- --per-file-ignores=datajoint/diagram.py:C901
files: datajoint # a lot of files in tests are not compliant

## Suggest to add pytest hook that runs unit test | Prerequisite: split unit/integration test
## https://github.com/datajoint/datajoint-python/issues/1211
2 changes: 1 addition & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,4 @@
"justMyCode": false
}
]
}
}
4 changes: 2 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,5 @@
"[dockercompose]": {
"editor.defaultFormatter": "disable"
},
"files.autoSave": "off"
}
//"files.autoSave": "off"
}
16 changes: 8 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@

# Welcome to DataJoint for Python!

DataJoint for Python is a framework for scientific workflow management based on
relational principles. DataJoint is built on the foundation of the relational data
model and prescribes a consistent method for organizing, populating, computing, and
DataJoint for Python is a framework for scientific workflow management based on
relational principles. DataJoint is built on the foundation of the relational data
model and prescribes a consistent method for organizing, populating, computing, and
querying data.

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
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.
Presently, the primary developer of DataJoint open-source software is the company
Presently, the primary developer of DataJoint open-source software is the company
DataJoint (https://datajoint.com).

## Data Pipeline Example
Expand Down
29 changes: 14 additions & 15 deletions datajoint/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,24 +55,23 @@
"cli",
]

from .logging import logger
from .version import __version__
from .settings import config
from .connection import conn, Connection
from .schemas import Schema
from .schemas import VirtualModule, list_schemas
from .table import Table, FreeTable
from .user_tables import Manual, Lookup, Imported, Computed, Part
from .expression import Not, AndList, U, Top
from .diagram import Diagram
from .admin import set_password, kill
from . import errors
from .admin import kill, set_password
from .attribute_adapter import AttributeAdapter
from .blob import MatCell, MatStruct
from .cli import cli
from .connection import Connection, conn
from .diagram import Diagram
from .errors import DataJointError
from .expression import AndList, Not, Top, U
from .fetch import key
from .hash import key_hash
from .attribute_adapter import AttributeAdapter
from . import errors
from .errors import DataJointError
from .cli import cli
from .logging import logger
from .schemas import Schema, VirtualModule, list_schemas
from .settings import config
from .table import FreeTable, Table
from .user_tables import Computed, Imported, Lookup, Manual, Part
from .version import __version__

ERD = Di = Diagram # Aliases for Diagram
schema = Schema # Aliases for Schema
Expand Down
6 changes: 4 additions & 2 deletions datajoint/admin.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
import pymysql
import logging
from getpass import getpass

import pymysql
from packaging import version

from .connection import conn
from .settings import config
from .utils import user_choice
import logging

logger = logging.getLogger(__name__.split(".")[0])

Expand Down
Loading