Skip to content

Commit deb64f1

Browse files
authored
Merge pull request #42 from CBroz1/main
Add NWB support for project schema, pre-commit and markdownlint
2 parents a7cf6ee + 2cc0c8d commit deb64f1

19 files changed

+736
-421
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ ENV/
106106
# datajoint
107107
dj_local_conf.json
108108
dj_local_conf_old.json
109+
temp*
109110

110111
# emacs
111112
**/*~

.markdownlint.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Markdown Linter configuration for docs
2+
# https://github.com/DavidAnson/markdownlint
3+
# https://github.com/DavidAnson/markdownlint/blob/main/doc/Rules.md
4+
MD009: false # permit trailing spaces
5+
MD007: false # List indenting - permit 4 spaces
6+
MD013:
7+
line_length: "88" # Line length limits
8+
tables: false # disable for tables
9+
headings: false # disable for headings
10+
MD030: false # Number of spaces after a list
11+
MD033: # HTML elements allowed
12+
allowed_elements:
13+
- "br"
14+
MD034: false # Permit bare URLs
15+
MD031: false # Spacing w/code blocks. Conflicts with `??? Note` and code tab styling
16+
MD046: false # Spacing w/code blocks. Conflicts with `??? Note` and code tab styling

.pre-commit-config.yaml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
default_stages: [commit, push]
2+
exclude: (^.github/|^docs/|^images/)
3+
4+
repos:
5+
- repo: https://github.com/pre-commit/pre-commit-hooks
6+
rev: v4.4.0
7+
hooks:
8+
- id: trailing-whitespace
9+
- id: end-of-file-fixer
10+
- id: check-yaml
11+
- id: check-added-large-files # prevent giant files from being committed
12+
- id: requirements-txt-fixer
13+
- id: mixed-line-ending
14+
args: ["--fix=lf"]
15+
description: Forces to replace line ending by the UNIX 'lf' character.
16+
17+
# black
18+
- repo: https://github.com/psf/black
19+
rev: 22.12.0
20+
hooks:
21+
- id: black
22+
- id: black-jupyter
23+
args:
24+
- --line-length=88
25+
26+
# isort
27+
- repo: https://github.com/pycqa/isort
28+
rev: 5.11.2
29+
hooks:
30+
- id: isort
31+
args: ["--profile", "black"]
32+
description: Sorts imports in an alphabetical order
33+
34+
# flake8
35+
- repo: https://github.com/pycqa/flake8
36+
rev: 4.0.1
37+
hooks:
38+
- id: flake8
39+
args: # arguments to configure flake8
40+
# making isort line length compatible with black
41+
- "--max-line-length=88"
42+
- "--max-complexity=18"
43+
- "--select=B,C,E,F,W,T4,B9"
44+
45+
# these are errors that will be ignored by flake8
46+
# https://www.flake8rules.com/rules/{code}.html
47+
- "--ignore=E203,E501,W503,W605,E402"
48+
# E203 - Colons should not have any space before them.
49+
# Needed for list indexing
50+
# E501 - Line lengths are recommended to be no greater than 79 characters.
51+
# Needed as we conform to 88
52+
# W503 - Line breaks should occur after the binary operator.
53+
# Needed because not compatible with black
54+
# W605 - a backslash-character pair that is not a valid escape sequence now
55+
# generates a DeprecationWarning. This will eventually become a SyntaxError.
56+
# Needed because we use \d as an escape sequence
57+
# E402 - Place module level import at the top.
58+
# Needed to prevent circular import error

CHANGELOG.md

Lines changed: 10 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,31 @@
11
# Changelog
22

3-
Observes [Semantic Versioning](https://semver.org/spec/v2.0.0.html) standard and [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) convention.
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+
## [0.2.0] - 2022-01-20
47

5-
## [0.2.0] - 2022-12-12
68
+ Add - `project` schema for project/study/experiment related tables
9+
+ Add - pre-commit and markdown lint checks
710

811
## [0.1.2] - 2022-10-17
12+
913
+ Update - CICD for triggering PyPI release
1014

1115
## [0.1.1] - 2022-05-10
16+
1217
+ Add - Adopted black formatting into code base
1318

1419
## [0.1.0b1] - 2022-01-28
20+
1521
+ Add - Functions to generate dictionaries for NWB export.
1622

1723
## [0.1.0b0] - 2021-05-07
24+
1825
+ Add - First beta release
1926

2027
## [0.1.0a1] - 2021-04-30
28+
2129
+ Add - GitHub Action release process
2230
+ Add - `lab` schema
2331

CODE_OF_CONDUCT.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
21
# Contributor Covenant Code of Conduct
32

43
## Our Pledge

CONTRIBUTING.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
# Contribution Guidelines
2-
This project follows the [DataJoint Contribution Guidelines](https://docs.datajoint.io/python/community/02-Contribute.html). Please reference the link for more full details.
2+
3+
This project follows the
4+
[DataJoint Contribution Guidelines](https://datajoint.com/docs/community/contribute/).
5+
Please reference the link for more full details.

README.md

Lines changed: 6 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,47 +1,9 @@
11
# DataJoint Element - Lab
22

3-
DataJoint Element for lab metadata. DataJoint Elements collectively standardize and automate data collection and analysis for neuroscience experiments. Each Element is a modular pipeline for data storage and processing with corresponding database tables that can be combined with other Elements to assemble a fully functional pipeline.
3+
DataJoint Element for lab metadata. DataJoint Elements collectively standardize and
4+
automate data collection and analysis for neuroscience experiments. Each Element is a
5+
modular pipeline for data storage and processing with corresponding database tables that
6+
can be combined with other Elements to assemble a fully functional pipeline.
47

5-
+ `element-lab` features a DataJoint pipeline design for lab related information, such as Lab, User, Project, Protocol, Source.
6-
7-
+ `element-lab` is not a complete workflow by itself, but rather a modular design of tables and dependencies.
8-
9-
+ `element-lab` can be flexibly attached to any DataJoint workflow.
10-
11-
+ See the [Element Lab documentation](https://elements.datajoint.org/description/lab/) for the background information and development timeline.
12-
13-
+ For more information on the DataJoint Elements project, please visit https://elements.datajoint.org. This work is supported by the National Institutes of Health.
14-
15-
## Element architecture
16-
17-
![element lab diagram](images/lab_diagram.svg)
18-
19-
## Installation
20-
```
21-
pip install element-lab
22-
```
23-
24-
If you already have an older version of ***element-lab*** installed using `pip`, upgrade with
25-
```
26-
pip install --upgrade element-lab
27-
```
28-
29-
## Element usage
30-
31-
+ `element-lab` is not a complete workflow by itself, but rather a modular design of tables and dependencies that can be flexibly attached to any DataJoint workflow.
32-
33-
+ See the [workflow-calcium-imaging](https://github.com/datajoint/workflow-calcium-imaging) and [workflow-array-ephys](https://github.com/datajoint/workflow-array-ephys) repositories for example usages of `element-lab`.
34-
35-
## Citation
36-
37-
+ If your work uses DataJoint and DataJoint Elements, please cite the respective Research Resource Identifiers (RRIDs) and manuscripts.
38-
39-
+ DataJoint for Python or MATLAB
40-
+ 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
41-
42-
+ DataJoint ([RRID:SCR_014543](https://scicrunch.org/resolver/SCR_014543)) - DataJoint for `<Select Python or MATLAB>` (version `<Enter version number>`)
43-
44-
+ DataJoint Elements
45-
+ Yatsenko D, Nguyen T, Shen S, Gunalan K, Turner CA, Guzman R, Sasaki M, Sitonic D, Reimer J, Walker EY, Tolias AS. DataJoint Elements: Data Workflows for Neurophysiology. bioRxiv. 2021 Jan 1. doi: https://doi.org/10.1101/2021.03.30.437358
46-
47-
+ DataJoint Elements ([RRID:SCR_021894](https://scicrunch.org/resolver/SCR_021894)) - Element Lab (version `<Enter version number>`)
8+
Installation and usage instructions can be found at the
9+
[Element documentation](https://datajoint.com/docs/elements/element-lab).

cspell.json

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
// cSpell Settings
2+
//https://github.com/streetsidesoftware/vscode-spell-checker
3+
{
4+
"version": "0.2", // Version of the setting file. Always 0.2
5+
"language": "en", // language - current active spelling language
6+
"enabledLanguageIds": [
7+
"markdown", "yaml", "python"
8+
],
9+
// flagWords - list of words to be always considered incorrect
10+
// This is useful for offensive words and common spelling errors.
11+
// For example "hte" should be "the"
12+
"flagWords": [],
13+
"allowCompoundWords": true,
14+
"ignorePaths": [
15+
"./element_array_ephys.egg-info/*",
16+
"./images/*"
17+
],
18+
"words": [
19+
"Berens",
20+
"CICD",
21+
"Ecker",
22+
"elif",
23+
"Ephys",
24+
"Hoenselaar",
25+
"IACUC",
26+
"inlinehilite",
27+
"linenums",
28+
"mkdocs",
29+
"mkdocstrings",
30+
"pymdownx",
31+
"Reimer",
32+
"Roboto",
33+
"RRID",
34+
"Rxiv",
35+
"Sasaki",
36+
"Shen",
37+
"Siapas",
38+
"Sinz",
39+
"Sitonic",
40+
"Tolias",
41+
"Yatsenko",
42+
"Zuckerman"
43+
]
44+
}

docs/mkdocs.yaml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ nav:
4343
# HOST_UID=$(id -u) docker compose -f docs/docker-compose.yaml up --build
4444
# ```
4545
# 02. Site analytics depend on a local environment variable GOOGLE_ANALYTICS_KEY
46-
# You can find this in LastPass or declare with any string to suprress errors
46+
# You can find this in LastPass or declare with any string to suppress errors
4747
# 03. The API section will pull docstrings.
4848
# A. Follow google styleguide e.g.,
4949
# https://sphinxcontrib-napoleon.readthedocs.io/en/latest/example_google.html
@@ -126,6 +126,7 @@ markdown_extensions:
126126
linenums: true
127127
- pymdownx.inlinehilite
128128
- pymdownx.snippets
129+
- footnotes
129130

130131
extra:
131132
PATCH_VERSION: !ENV PATCH_VERSION

docs/src/citation.md

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
11

22
# Citation
33

4-
If your work uses DataJoint and DataJoint Elements, please cite the respective Research Resource Identifiers (RRIDs) and manuscripts.
4+
If your work uses this Element, please cite the following manuscript and Research
5+
Resource Identifier (RRID).
56

6-
+ DataJoint for Python or MATLAB
7-
+ 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
7+
+ Yatsenko D, Nguyen T, Shen S, Gunalan K, Turner CA, Guzman R, Sasaki M, Sitonic D,
8+
Reimer J, Walker EY, Tolias AS. DataJoint Elements: Data Workflows for
9+
Neurophysiology. bioRxiv. 2021 Jan 1. doi: https://doi.org/10.1101/2021.03.30.437358
810

9-
+ DataJoint ([RRID:SCR_014543](https://scicrunch.org/resolver/SCR_014543)) - DataJoint for `<Select Python or MATLAB>` (version `<Enter version number>`)
10-
11-
+ DataJoint Elements
12-
+ Yatsenko D, Nguyen T, Shen S, Gunalan K, Turner CA, Guzman R, Sasaki M, Sitonic D, Reimer J, Walker EY, Tolias AS. DataJoint Elements: Data Workflows for Neurophysiology. bioRxiv. 2021 Jan 1. doi: https://doi.org/10.1101/2021.03.30.437358
13-
14-
+ DataJoint Elements ([RRID:SCR_021894](https://scicrunch.org/resolver/SCR_021894)) - Element Lab (version {{ PATCH_VERSION }})
11+
+ DataJoint Elements ([RRID:SCR_021894](https://scicrunch.org/resolver/SCR_021894)) -
12+
Element Lab (version {{ PATCH_VERSION }})

0 commit comments

Comments
 (0)