Skip to content

Commit

Permalink
Merge pull request #90 from MilagrosMarin/element-dlc-test
Browse files Browse the repository at this point in the history
Update the example data, environment variables, tutorial notebook and README
  • Loading branch information
Thinh Nguyen authored Oct 17, 2023
2 parents 55adb0e + 0fb7c05 commit 4a74fe4
Show file tree
Hide file tree
Showing 8 changed files with 3,120 additions and 10 deletions.
9 changes: 6 additions & 3 deletions .devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,12 @@ ENV DJ_HOST fakeservices.datajoint.io
ENV DJ_USER root
ENV DJ_PASS simple

ENV DLC_ROOT_DATA_DIR /workspaces/element-deeplabcut/example_data
ENV CURRENT_PROJECT_FOLDER from_top_tracking
ENV DATA_MOUNTPOINT /workspaces/element-deeplabcut/example_data
ENV DLC_ROOT_DATA_DIR $DATA_MOUNTPOINT/inbox
ENV DLC_PROCESSED_DATA_DIR $DATA_MOUNTPOINT/outbox
ENV DATABASE_PREFIX neuro_

USER vscode
CMD bash -c "sudo rm /var/run/docker.pid; sudo dockerd"
CMD bash -c "sudo rm /var/run/docker.pid; sudo dockerd"

ENV LD_LIBRARY_PATH="/lib:/opt/conda/lib"
4 changes: 2 additions & 2 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"remoteEnv": {
"LOCAL_WORKSPACE_FOLDER": "${localWorkspaceFolder}"
},
"onCreateCommand": "mkdir -p ${DLC_ROOT_DATA_DIR} && pip install -e .",
"postStartCommand": "docker volume prune -f && s3fs ${DJ_PUBLIC_S3_LOCATION} ${DLC_ROOT_DATA_DIR} -o nonempty,multipart_size=530,endpoint=us-east-1,url=http://s3.amazonaws.com,public_bucket=1",
"onCreateCommand": "mkdir -p ${DATA_MOUNTPOINT} && pip install -e .",
"postStartCommand": "docker volume prune -f && s3fs ${DJ_PUBLIC_S3_LOCATION} ${DATA_MOUNTPOINT} -o nonempty,multipart_size=530,endpoint=us-east-1,url=http://s3.amazonaws.com,public_bucket=1",
"hostRequirements": {
"cpus": 4,
"memory": "8gb",
Expand Down
2 changes: 1 addition & 1 deletion .devcontainer/docker-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ services:
extra_hosts:
- fakeservices.datajoint.io:127.0.0.1
environment:
- DJ_PUBLIC_S3_LOCATION=djhub.vathes.datapub.elements:/workflow-dlc-data/v1
- DJ_PUBLIC_S3_LOCATION=djhub.vathes.datapub.elements:/workflow-dlc-data/v2
devices:
- /dev/fuse
cap_add:
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ tables that can be combined with other Elements to assemble a fully functional p

## Data Pipeline Diagram

![pipeline](https://raw.githubusercontent.com/datajoint/element-deeplabcut/main/images/pipeline_dlc.svg)
![pipeline](https://raw.githubusercontent.com/datajoint/element-deeplabcut/main/images/pipeline.svg)

## Getting Started

Expand Down
5 changes: 3 additions & 2 deletions element_deeplabcut/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
"DLC_ROOT_DATA_DIR", dj.config["custom"].get("dlc_root_data_dir", "")
)

dj.config["custom"]["current_project_folder"] = os.getenv(
"CURRENT_PROJECT_FOLDER", dj.config["custom"].get("current_project_folder", "")
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", "")
5 changes: 4 additions & 1 deletion element_deeplabcut/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,10 @@ def insert_new_model(
print("Canceled insert.")
return
# ---- Save DJ-managed config ----
_ = dlc_reader.save_yaml(project_path, dlc_config)
try:
_ = dlc_reader.save_yaml(project_path, dlc_config)
except PermissionError:
pass
# ____ Insert into table ----
with cls.connection.transaction:
cls.insert1(model_dict)
Expand Down
Loading

0 comments on commit 4a74fe4

Please sign in to comment.