Skip to content

Commit 1fa6984

Browse files
authored
Merge pull request #54 from CBroz1/main
Prep for pypi publish
2 parents d2e4286 + 346e164 commit 1fa6984

3 files changed

Lines changed: 43 additions & 44 deletions

File tree

CHANGELOG.md

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2,15 +2,17 @@
22

33
Observes [Semantic Versioning](https://semver.org/spec/v2.0.0.html) standard and [Keep a Changelog](https://keepachangelog.com/en/1.0.0/) convention.
44

5-
## [0.2.0] - Unreleased
6-
+ Relocate module imports to the top of the files
7-
+ Add - Call reusable CICD
5+
## [0.2.0] - 2022-10-10
86
+ Update - Remove direct dependency (`element-interface`) for PyPI release.
97
+ Update - Docstring PEP257 compliance #24
108
+ Update - Explicit handling of KeyboardInterrupt #26
119
+ Update - Streamline insert_new_params #27
10+
+ Update - Relocate module imports to the top of the files
11+
+ Update - Missing f for formatted string in read_yaml
1212
+ Change - Rename datajoint-saved config to `dj_dlc_config.yaml`
13-
+ Fix - Missing f for formatted string in read_yaml
13+
+ Add - Call reusable CICD
14+
+ Add - NWB export
15+
+ Add - mkdocs deployment with workflow API docs
1416

1517
## [0.1.1] - 2022-06-10
1618
### Fixed
@@ -29,6 +31,7 @@ Observes [Semantic Versioning](https://semver.org/spec/v2.0.0.html) standard and
2931
+ Add - Drafts from a collection of precursor pipelines, including [DataJoint_Demo_DeepLabCut](https://github.com/MMathisLab/DataJoint_Demo_DeepLabCut) graciously provided by the Mathis Lab.
3032
+ Add - Support for 2d single-animal models
3133

32-
[0.1.1]: https://github.com/datajoint/element-deeplabcut/compare/0.1.0...0.1.1
33-
[0.1.0]: https://github.com/datajoint/element-deeplabcut/compare/0.0.0a...0.1.0
34+
[0.2.0]: https://github.com/datajoint/element-deeplabcut/releases/tag/0.2.0
35+
[0.1.1]: https://github.com/datajoint/element-deeplabcut/releases/tag/0.1.1
36+
[0.1.0]: https://github.com/datajoint/element-deeplabcut/releases/tag/0.1.0
3437
[0.0.0a]: https://github.com/datajoint/element-deeplabcut/releases/tag/0.0.0a

README.md

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,40 @@ For more detail, check the docstring of the `element-deeplabcut`:
9090

9191
[![YouTube tutorial](https://img.youtube.com/vi/8FDjTuQ52gQ/0.jpg)](https://www.youtube.com/watch?v=8FDjTuQ52gQ)
9292

93+
### Exporting to NWB
94+
95+
The `export/nwb.py` module calls [DLC2NWB](https://github.com/DeepLabCut/DLC2NWB/) to
96+
save output generated by Element DeepLabCut as NWB files.
97+
The main function, `dlc_session_to_nwb`, contains a flag to control calling a parallel
98+
function in [Element Session](https://github.com/datajoint/element-session/blob/main/element_session/export/nwb.py).
99+
100+
Before using, please install [DLC2NWB](https://github.com/DeepLabCut/DLC2NWB/)
101+
102+
```bash
103+
pip install dlc2nwb
104+
```
105+
106+
Then, call the export function using keys from the `PoseEstimation` table.
107+
108+
```python
109+
from element_deeplabcut import model
110+
from element_session import session
111+
from element_deeplabcut.export import dlc_session_to_nwb
112+
113+
session_key = (session.Session & CONDITION)
114+
pose_key = (model.PoseEstimation & session_key).fetch1('KEY')
115+
dlc_session_to_nwb(pose_key, use_element_session=True, session_kwargs=SESSION_KWARGS)
116+
```
117+
118+
Here, `CONDITION` should uniquely identify a session and `SESSION_KWARGS` can be any of
119+
the items described in the docstring of `element_session.export.nwb.session_to_nwb`
120+
as a dictionary.
121+
122+
As DLC2NWB does not currently offer a separate function for generating `PoseEstimation`
123+
objects (see [ndx-pose](https://github.com/rly/ndx-pose)), the current solution is to
124+
allow DLC2NWB to write to disk, and optionally rewrite this file using metadata provided
125+
by the export function in Element Session.
126+
93127
## Citation
94128

95129
+ If your work uses DataJoint and DataJoint Elements, please cite the respective Research Resource Identifiers (RRIDs) and manuscripts.

element_deeplabcut/export/README.md

Lines changed: 0 additions & 38 deletions
This file was deleted.

0 commit comments

Comments
 (0)