Developer instructions¶
Development mode installation¶
- We recommend doing development work in a conda environment. For information on setting up conda for the first time, see this article.
- This method allows you to modify the source code for example DataJoint
workflows (e.g.
workflow-array-ephys) and their dependencies (e.g.,element-array-ephys).
- Launch a new terminal and change directory to where you want to clone the
repositories (e.g.,
bash cd ~/Projects)
- Clone the relevant workflow and refer to the
requirements.txtin the workflow for the list of Elements to clone and install as editable. You will also need to installelement-interfacedeps=("lab" "animal" "session" "interface" "<others>") for repo in $deps # clone each do git clone https://github.com/datajoint/element-$repo done for repo in $(ls -d ./{element,workflow}*) # editable install do pip install -e ./$repo done
Drop schemas¶
If you need to drop all schemas to start fresh, you'll need to do following the
dependency order. Refer to the workflow's notebook
(notebooks/06-drop-optional.ipynb) for the drop order.
Pytests¶
- Download the test dataset to your local machine. Note the directory where the dataset
is saved (e.g.
/tmp/testset).
- Create an
.envfile within thedockerdirectory with the following content. Replace/tmp/testsetwith the directory where you have the test dataset downloaded.TEST_DATA_DIR=/tmp/testset
- If testing an unreleased version of the
elementor your fork of anelementor theworkflow, within theDockerfileuncomment the lines from the different options presented. This will allow you to install the repositories of interest and run the integration tests on those packages. Be sure that theelementpackage version matches the version in therequirements.txtof theworkflow.
- Run the Docker container.
docker-compose -f ./docker/docker-compose-test.yaml up --build