Skip to content

Commit 82ffc52

Browse files
authored
Merge pull request #352 from vanvalenlab/0.4-dev
Merge 0.4-dev before releasing 0.4
2 parents 4c24941 + 900ad2e commit 82ffc52

351 files changed

Lines changed: 15760 additions & 12382 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.env.example

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

.github/workflows/tests.yaml

Lines changed: 74 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,67 @@
33

44
name: tests
55

6-
on: [push, pull_request]
6+
on: [pull_request]
77

88
jobs:
9+
e2e-tests:
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Checkout
13+
uses: actions/checkout@v2
14+
15+
- name: Set up Python
16+
uses: actions/setup-python@v2
17+
with:
18+
working-directory: backend
19+
python-version: 3.8
20+
21+
- name: Cache pip
22+
uses: actions/cache@v2
23+
with:
24+
working-directory: backend
25+
# This path is specific to Ubuntu
26+
path: ~/.cache/pip
27+
# Look to see if there is a cache hit for the corresponding requirements file
28+
key: ${{ runner.os }}-pip-${{ hashFiles('requirements.txt') }}
29+
restore-keys: |
30+
${{ runner.os }}-pip-
31+
${{ runner.os }}-
32+
33+
- name: Install Dependencies
34+
working-directory: backend
35+
run: |
36+
python -m pip install --upgrade pip
37+
pip install -r requirements.txt
38+
pip install -r requirements-test.txt
39+
40+
- name: Cypress run
41+
uses: cypress-io/github-action@v4
42+
env:
43+
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
44+
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
45+
with:
46+
working-directory: frontend
47+
start: |
48+
npm run cypress:frontend
49+
npm run cypress:backend
50+
wait-on: "http://localhost:3000, http://localhost:5000/health"
51+
spec: |
52+
cypress/e2e/label.cy.js
53+
cypress/e2e/caliban.cy.js
54+
cypress/e2e/spots.cy.js
55+
56+
- name: Cypress Coveralls
57+
uses: coverallsapp/github-action@master
58+
env:
59+
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
60+
with:
61+
base-path: frontend
62+
path-to-lcov: frontend/coverage/lcov.info
63+
github-token: ${{ secrets.github_token }}
64+
flag-name: cypress
65+
parallel: true
66+
967
frontend-tests:
1068
runs-on: ubuntu-latest
1169

@@ -24,22 +82,22 @@ jobs:
2482
- name: Cache node_modules
2583
uses: actions/cache@v2
2684
with:
27-
path: "visualizer/**/node_modules"
28-
key: ${{ runner.os }}-modules-${{ hashFiles('visualizer/**/yarn.lock') }}
85+
path: "frontend/**/node_modules"
86+
key: ${{ runner.os }}-modules-${{ hashFiles('frontend/**/yarn.lock') }}
2987
restore-keys: |
3088
${{ runner.os }}-yarn-
3189
${{ runner.os }}-
3290
3391
- name: Yarn Install
34-
working-directory: visualizer
92+
working-directory: frontend
3593
run: yarn
3694

3795
- name: Lint
38-
working-directory: visualizer
96+
working-directory: frontend
3997
run: yarn lint
4098

4199
- name: Unit Tests
42-
working-directory: visualizer
100+
working-directory: frontend
43101
run: yarn test --coverage
44102
env:
45103
CI: true
@@ -49,8 +107,8 @@ jobs:
49107
env:
50108
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
51109
with:
52-
base-path: visualizer
53-
path-to-lcov: visualizer/coverage/lcov.info
110+
base-path: frontend
111+
path-to-lcov: frontend/coverage/lcov.info
54112
github-token: ${{ secrets.github_token }}
55113
flag-name: node-${{ matrix.node-version }}
56114
parallel: true
@@ -60,19 +118,21 @@ jobs:
60118

61119
strategy:
62120
matrix:
63-
python-version: ["3.8", "3.9", "3.10"]
121+
python-version: ["3.8"]
64122

65123
steps:
66124
- uses: actions/checkout@v2
67125

68126
- name: Set up Python ${{ matrix.python-version }}
69127
uses: actions/setup-python@v2
70128
with:
129+
working-directory: backend
71130
python-version: ${{ matrix.python-version }}
72131

73132
- name: Cache pip
74133
uses: actions/cache@v2
75134
with:
135+
working-directory: backend
76136
# This path is specific to Ubuntu
77137
path: ~/.cache/pip
78138
# Look to see if there is a cache hit for the corresponding requirements file
@@ -82,27 +142,30 @@ jobs:
82142
${{ runner.os }}-
83143
84144
- name: Install Dependencies
145+
working-directory: backend
85146
run: |
86147
python -m pip install --upgrade pip
87148
pip install -r requirements.txt
88149
pip install -r requirements-test.txt
89150
90151
- name: Run PyTest
152+
working-directory: backend
91153
run: |
92-
pytest deepcell_label --cov deepcell_label
154+
PYTHONPATH=deepcell_label pytest deepcell_label --cov deepcell_label
93155
94156
- name: Coveralls
95157
if: env.COVERALLS_REPO_TOKEN != null
96158
env:
97159
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
98160
COVERALLS_FLAG_NAME: python-${{ matrix.python-version }}
99161
COVERALLS_PARALLEL: true
162+
working-directory: backend
100163
run: |
101164
coveralls
102165
103166
coveralls:
104167
name: Finish Coveralls
105-
needs: [frontend-tests, backend-tests]
168+
needs: [e2e-tests, frontend-tests, backend-tests]
106169
runs-on: ubuntu-latest
107170
steps:
108171
- name: Coveralls Finished

.gitignore

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,9 @@ venv.bak/
124124
node_modules
125125

126126
# Elastic Beanstalk Files
127-
.elasticbeanstalk/*
128-
!.elasticbeanstalk/*.cfg.yml
129-
!.elasticbeanstalk/*.global.yml
127+
backend/.elasticbeanstalk/*
128+
!backend/.elasticbeanstalk/*.cfg.yml
129+
!backend/.elasticbeanstalk/*.global.yml
130130

131131
# VS Code
132132
settings.json
@@ -162,5 +162,4 @@ yarn-debug.log*
162162
yarn-error.log*
163163
package-lock.json
164164

165-
# Webpack builds javascript files into deepcell_label/static
166-
deepcell_label/static/js/*
165+
.nyc_output

README.md

Lines changed: 4 additions & 75 deletions
Original file line numberDiff line numberDiff line change
@@ -4,81 +4,10 @@
44
[![Coverage Status](https://coveralls.io/repos/github/vanvalenlab/deepcell-label/badge.svg?branch=main)](https://coveralls.io/github/vanvalenlab/deepcell-label?branch=main)
55
[![Apache 2.0](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/vanvalenlab/deepcell-label/blob/main/LICENSE)
66

7-
DeepCell Label is a web-based tool to visualize and label cells in biological images, and is tailored for cell segmentation. Label works with multiplexed images, 3D image stacks, and time-lapse movies. The tool can label images from scratch, or correct labels from model predictions or existing datasets.
7+
DeepCell Label is a web-based tool to visualize and label biological images. It can segment an image, assign cells across a timelapse, and track divisions in multiplexed images, 3D image stacks, and time-lapse movies.
88

9-
DeepCell Label distributes images and labeling tools through a browser, providing easy access to crowdsource data labeling and to review, correct, and curate labels as a domain expert.
9+
As it's available through a browser, DeepCell Label can crowdsource data labeling or review, correct, and curate labels as a domain expert.
1010

11-
DeepCell Label is built with [React](https://reactjs.org/), [XState](https://xstate.js.org/docs/), and [Flask](https://flask.palletsprojects.com/en/2.0.x/) and [runs locally](#local-use) or [on the cloud](#cloud-deployment) (e.g. with [AWS Elastic Beanstalk](https://aws.amazon.com/elasticbeanstalk/)).
11+
The site is built with [React](https://reactjs.org/), [XState](https://xstate.js.org/docs/), and [Flask](https://flask.palletsprojects.com/en/2.0.x/) and [runs locally](/documentation/LOCAL_USE.md) or [on the cloud](/documentation/DEPLOYMENT.md).
1212

13-
Visit [label.deepcell.org](https://label.deepcell.org) and create a project from an example file or upload a .tiff, .png, or .npz. Detailed instructions on how to use the app are in the dropdown instructions tab when working in DeepCell Label.
14-
15-
## Local use
16-
17-
To run DeepCell Label locally, you will set up the client and the server from your computer. If you haven't worked with Python or Javascript projects before, follow the [first time setup instructions](FIRST_TIME_SETUP.md) to install Python and Node.js.
18-
19-
To start, clone the repository with:
20-
21-
```bash
22-
git clone https://github.com/vanvalenlab/deepcell-label.git
23-
```
24-
25-
and open the repository with:
26-
27-
```bash
28-
cd deepcell-label
29-
```
30-
31-
### Set up Flask server
32-
33-
The backend is a Flask HTTP API that stores and updates project data.
34-
35-
#### Run Python backend
36-
37-
We recommend using Python virtual environment, either with [conda](https://conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html) or [venv](https://docs.python.org/3/library/venv.html).
38-
After setting up a virtual environment, install the Python dependencies with:
39-
40-
```bash
41-
pip install -r requirements.txt
42-
pip install -r requirements-test.txt
43-
```
44-
45-
Flask requires some environment variables to be set, like [FLASK_APP](https://flask.palletsprojects.com/en/2.0.x/cli/). We need to set `export FLASK_APP=application` in the terminal or in an `.env` file. There is an example `.env.example` with FLASK_APP already set. Make a copy and rename the file `.env`. Then, start the server with:
46-
47-
```bash
48-
flask run
49-
```
50-
51-
By default, DeepCell Label creates a temporary database in `/tmp`. Change `SQLALCHEMY_DATABASE_URI` in your `.env`, for example `SQLALCHEMY_DATABASE_URI=sqlite:///~/Documents/deepcell_label.db`, to make a persistent database in another location.
52-
53-
#### Run with Docker
54-
55-
The backend can also be containerized with [Docker](https://www.docker.com). To build a production-ready Docker image, run:
56-
57-
```bash
58-
docker build -t vanvalenlab/deepcell-label:$USER
59-
```
60-
61-
The built image can run the backend on port 5000 with:
62-
63-
```bash
64-
docker run -p 5000:5000 -it vanvalenlab/deepcell-label:$USER
65-
```
66-
67-
Envrionment variables like `SQLALCHEMY_DATABASE_URI` can be passed to the run command using the [environment variable flags](https://docs.docker.com/engine/reference/commandline/run/#set-environment-variables--e---env---env-file): `-e` and `--env`.
68-
69-
### Set up React client
70-
71-
Once the server is running, we need to set up the frontend. Install the dependencies for the frontend with:
72-
73-
```bash
74-
cd visualizer
75-
yarn
76-
```
77-
78-
Then, start the frontend with:
79-
80-
```bash
81-
yarn start
82-
```
83-
84-
Visit [localhost:3000](http://localhost:3000) to see the DeepCell Label homepage.
13+
Visit [label.deepcell.org](https://label.deepcell.org) to create a project from an example file or your own .tiff, .png, or .npz. Dropdown instructions are available while working on a project in DeepCell Label.

.coveragerc renamed to backend/.coveragerc

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,6 @@ omit =
1616
**/*_test.py
1717
env/**/*.py
1818
venv/**/*.py
19+
.venv/**/*.py
1920
ENV/**/*.py
2021
VENV/**/*.py
21-
desktop/env/**/*.py
22-
desktop/venv/**/*.py
23-
desktop/ENV/**/*.py
24-
desktop/VENV/**/*.py
25-
browser/env/**/*.py
26-
browser/venv/**/*.py
27-
browser/ENV/**/*.py
28-
browser/VENV/**/*.py
29-
browser/conftest.py

.dockerignore renamed to backend/.dockerignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Dockerfile
55
.vscode
66
.gitignore
77
.dockerignore
8-
visualizer
8+
frontend
99

1010
/credentials
1111
/cache

0 commit comments

Comments
 (0)