Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
sidhulyalkar committed Jan 5, 2024
2 parents b4a6ae0 + 499d85e commit 50f0d43
Show file tree
Hide file tree
Showing 9 changed files with 744 additions and 898 deletions.
8 changes: 6 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,13 @@
Observes [Semantic Versioning](https://semver.org/spec/v2.0.0.html) standard and
[Keep a Changelog](https://keepachangelog.com/en/1.0.0/) convention.

## [0.2.11] - 2023-11-28
## [0.2.11] - 2023-01-04

+ Fix - Modify training to update init_weights path in pose_cfg.yaml
+ Fix - docstring typo
+ Fix - `dj.config()` setup moved to `tutorial_pipeline.py` instead of `__init__.py`
+ Bugfix - Resolved AttributeError from the latest update of the YAML dependency
+ Update - Flowchart images to increase consistency with other DataJoint Elements
+ Update - Elements installed directly from GitHub instead of PyPI

## [0.2.10] - 2023-11-20

Expand Down
3 changes: 1 addition & 2 deletions docs/src/.overrides/assets/stylesheets/extra.css
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,6 @@ html a[title="YouTube"].md-social__link svg {
/* --md-footer-fg-color: var(--dj-white); */
}

[data-md-color-scheme="slate"] td,
th {
[data-md-color-scheme="slate"] .jupyter-wrapper .Table Td {
color: var(--dj-black)
}
20 changes: 0 additions & 20 deletions element_deeplabcut/__init__.py
Original file line number Diff line number Diff line change
@@ -1,21 +1 @@
import os
import datajoint as dj

if "custom" not in dj.config:
dj.config["custom"] = {}

# overwrite dj.config['custom'] values with environment variables if available

dj.config["custom"]["database.prefix"] = os.getenv(
"DATABASE_PREFIX", dj.config["custom"].get("database.prefix", "")
)

dj.config["custom"]["dlc_root_data_dir"] = os.getenv(
"DLC_ROOT_DATA_DIR", dj.config["custom"].get("dlc_root_data_dir", "")
)

dj.config["custom"]["dlc_processed_data_dir"] = os.getenv(
"DLC_PROCESSED_DATA_DIR", dj.config["custom"].get("dlc_processed_data_dir", "")
)

db_prefix = dj.config["custom"].get("database.prefix", "")
2 changes: 1 addition & 1 deletion element_deeplabcut/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,7 +308,7 @@ class Model(dj.Manual):
config_template (longblob): Dictionary of the config for analyze_videos().
project_path ( varchar(255) ): DLC's project_path in config relative to root.
model_prefix ( varchar(32) ): Optional. Prefix for model files.
model_description ( varchar(1000) ): Optional. User-entered description.
model_description ( varchar(300) ): Optional. User-entered description.
TrainingParamSet (foreign key): Optional. Training parameters primary key.
Note:
Expand Down
82 changes: 81 additions & 1 deletion images/flowchart.drawio

Large diffs are not rendered by default.

3 changes: 2 additions & 1 deletion images/flowchart.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1,470 changes: 618 additions & 852 deletions notebooks/tutorial.ipynb

Large diffs are not rendered by default.

44 changes: 30 additions & 14 deletions notebooks/tutorial_pipeline.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import os
import datajoint as dj
from collections import abc
from element_lab import lab
Expand All @@ -8,22 +9,31 @@
from element_animal.subject import Subject
from element_lab.lab import Source, Lab, Protocol, User, Project

__all__ = [
"Subject",
"Source",
"Lab",
"Protocol",
"User",
"Project",
"Session",
]

if "custom" not in dj.config:
dj.config["custom"] = {}

# overwrite dj.config['custom'] values with environment variables if available

dj.config["custom"]["database.prefix"] = os.getenv(
"DATABASE_PREFIX", dj.config["custom"].get("database.prefix", "")
)

dj.config["custom"]["dlc_root_data_dir"] = os.getenv(
"DLC_ROOT_DATA_DIR", dj.config["custom"].get("dlc_root_data_dir", "")
)

dj.config["custom"]["dlc_processed_data_dir"] = os.getenv(
"DLC_PROCESSED_DATA_DIR", dj.config["custom"].get("dlc_processed_data_dir", "")
)

if "custom" not in dj.config:
dj.config["custom"] = {}

db_prefix = dj.config["custom"].get("database.prefix", "")


# Declare functions for retrieving data
def get_dlc_root_data_dir() -> list:
"""Returns a list of root directories for Element DeepLabCut"""
dlc_root_dirs = dj.config.get("custom", {}).get("dlc_root_data_dir")
Expand All @@ -46,18 +56,24 @@ def get_dlc_processed_data_dir() -> str:
return None


# Activate "lab", "subject", "session" schema -------------
__all__ = [
"Subject",
"Source",
"Lab",
"Protocol",
"User",
"Project",
"Session",
]

# Activate schemas -------------

lab.activate(db_prefix + "lab")

subject.activate(db_prefix + "subject", linking_module=__name__)

Experimenter = lab.User
Session = session.Session
session.activate(db_prefix + "session", linking_module=__name__)

# Activate equipment table ------------------------------------


@lab.schema
class Device(dj.Lookup):
Expand Down
10 changes: 5 additions & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
packages=find_packages(exclude=["contrib", "docs", "tests*"]),
scripts=[],
install_requires=[
"datajoint>=0.13",
"datajoint>=0.13.0",
"graphviz",
"pydot",
"ipykernel",
Expand All @@ -40,10 +40,10 @@
],
"dlc_gui": ["deeplabcut[gui]"],
"elements": [
"element-lab>=0.3.0",
"element-animal>=0.1.8",
"element-session>=0.1.5",
"element-interface>=0.6.0",
"element-lab @ git+https://github.com/datajoint/element-lab.git",
"element-animal @ git+https://github.com/datajoint/element-animal.git",
"element-session @ git+https://github.com/datajoint/element-session.git",
"element-interface @ git+https://github.com/datajoint/element-interface.git",
],
},
)

0 comments on commit 50f0d43

Please sign in to comment.