From 8cae4702c579dc5a46849ff05e992187cdf418e5 Mon Sep 17 00:00:00 2001 From: rhoadesScholar Date: Tue, 19 Mar 2024 18:09:42 +0000 Subject: [PATCH] :art: Format Python code with psf/black --- .../examples/distance_task/cosem_example.py | 58 +++++++++++++++++++ 1 file changed, 58 insertions(+) diff --git a/dacapo/examples/distance_task/cosem_example.py b/dacapo/examples/distance_task/cosem_example.py index 30dc262eb..da07f091c 100644 --- a/dacapo/examples/distance_task/cosem_example.py +++ b/dacapo/examples/distance_task/cosem_example.py @@ -1,3 +1,61 @@ +# %% [markdown] +# # Dacapo +# +# DaCapo is a framework that allows for easy configuration and execution of established machine learning techniques on arbitrarily large volumes of multi-dimensional images. +# +# DaCapo has 4 major configurable components: +# 1. **dacapo.datasplits.DataSplit** +# +# 2. **dacapo.tasks.Task** +# +# 3. **dacapo.architectures.Architecture** +# +# 4. **dacapo.trainers.Trainer** +# +# These are then combined in a single **dacapo.experiments.Run** that includes your starting point (whether you want to start training from scratch or continue off of a previously trained model) and stopping criterion (the number of iterations you want to train). + +# %% [markdown] +# ## Environment setup +# If you have not already done so, you will need to install DaCapo. You can do this by first creating a new environment and then installing DaCapo using pip. +# +# ```bash +# conda create -n dacapo python=3.10 +# conda activate dacapo +# ``` +# +# Then, you can install DaCapo using pip, via GitHub: +# +# ```bash +# pip install git+https://github.com/janelia-cellmap/dacapo.git +# ``` +# +# Or you can clone the repository and install it locally: +# +# ```bash +# git clone https://github.com/janelia-cellmap/dacapo.git +# cd dacapo +# pip install -e . +# ``` +# +# Be sure to select this environment in your Jupyter notebook or JupyterLab. + +# %% [markdown] +""" +## Config Store +To define where the data goes, create a dacapo.yaml configuration file either in `~/.config/dacapo/dacapo.yaml` or in `./dacapo.yaml`. Here is a template: + +```yaml +type: files +runs_base_dir: /path/to/my/data/storage +``` +The `runs_base_dir` defines where your on-disk data will be stored. The `type` setting determines the database backend. The default is `files`, which stores the data in a file tree on disk. Alternatively, you can use `mongodb` to store the data in a MongoDB database. To use MongoDB, you will need to provide a `mongodbhost` and `mongodbname` in the configuration file: + +```yaml +... +mongodbhost: mongodb://dbuser:dbpass@dburl:dbport/ +mongodbname: dacapo +""" + # %% # First we need to create a config store to store our configurations from dacapo.store.create_store import create_config_store