Skip to content

Commit

Permalink
Merge branch 'helmholtz_design' of https://github.com/HelmholtzAI-Con…
Browse files Browse the repository at this point in the history
  • Loading branch information
KorenMary committed Mar 17, 2024
2 parents 0d7ae1c + 9b80454 commit 773df7e
Show file tree
Hide file tree
Showing 82 changed files with 4,864 additions and 2,723 deletions.
50 changes: 43 additions & 7 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
strategy:
matrix:
platform: [ubuntu-latest, windows-latest, macos-latest]
python-version: [3.9, "3.10"]
python-version: [3.9, "3.10", "3.11"]
env:
DISPLAY: ':99.0'
steps:
Expand All @@ -44,17 +44,15 @@ jobs:
run: |
python -m pip install --upgrade pip
python -m pip install setuptools
pip install pytest
pip install pytest-qt
pip install pytest-xvfb
pip install coverage
pip install -e ".[testing]"
pip install -e ".[dev]"
pip install matplotlib
working-directory: src/client

- name: Install server dependencies (for communication tests)
run: |
pip install -e ".[testing]"
pip install -e ".[dev]"
working-directory: src/server

- name: Test with pytest
Expand Down Expand Up @@ -94,10 +92,9 @@ jobs:
python -m pip install --upgrade pip
python -m pip install --upgrade setuptools
pip install numpy
pip install pytest
pip install wheel
pip install coverage
pip install -e ".[testing]"
pip install -e ".[dev]"
working-directory: src/server

- name: Test with pytest
Expand All @@ -114,4 +111,43 @@ jobs:
files: src/server/coverage.xml
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

deploy:
# this will run when you have tagged a commit, starting with "v*"
# and requires that you have put your twine API key in your
# github secrets (see readme for details)
needs: [test_client, test_server]
runs-on: ubuntu-latest
if: contains(github.ref, 'tags')
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: "3.x"
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install twine
pip install build
- name: Build and publish dcp_client
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.TWINE_API_KEY }}
run: |
git tag
python -m build .
twine upload dist/*
working-directory: src/client

- name: Build and publish dcp_server
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.TWINE_API_KEY }}
run: |
git tag
python -m build .
twine upload dist/*
working-directory: src/server

8 changes: 4 additions & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,14 @@
data/
in_progress/
curated/
uncurated/

# model dir
*mytrainedmodel/

#configs
src/client/dcp_client/config.cfg
src/server/dcp_server/config.cfg

# Byte-compiled / optimized / DLL files
__pycache__/
Expand Down Expand Up @@ -80,7 +82,7 @@ instance/
.scrapy

# Sphinx documentation
docs/_build/
# docs/build/

# PyBuilder
target/
Expand Down Expand Up @@ -151,8 +153,6 @@ dmypy.json
.idea/

.DS_Store
docs/
test-napari.pub
data/
BentoML/
models/

30 changes: 30 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# .readthedocs.yaml
# Read the Docs configuration file
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details

# Required
version: 2

# Set the version of Python and other tools you might need
build:
os: ubuntu-22.04
tools:
python: "3.10"
# You can also specify other tool versions:
# nodejs: "19"
# rust: "1.64"
# golang: "1.19"

# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: docs/source/conf.py

# Optionally declare the Python requirements required to build your docs
python:
# Install both Python packages before building the docs
install:
- method: pip
path: src/client
- method: pip
path: src/server
- requirements: docs/requirements.txt
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
![stability-wip](https://img.shields.io/badge/stability-work_in_progress-lightgrey.svg)
![tests](https://github.com/HelmholtzAI-Consultants-Munich/data-centric-platform/actions/workflows/test.yml/badge.svg?event=push)
[![codecov](https://codecov.io/gh/HelmholtzAI-Consultants-Munich/data-centric-platform/branch/main/graph/badge.svg)](https://codecov.io/gh/HelmholtzAI-Consultants-Munich/data-centric-platform)

[![Documentation Status](https://readthedocs.org/projects/data-centric-platform/badge/?version=latest)](https://data-centric-platform.readthedocs.io/en/latest/?badge=latest)


## How to use this?
Expand All @@ -16,7 +16,7 @@ To run the client GUI follow the instructions described in [DCP Client Installat
DCP handles all kinds of **segmentation tasks**! Try it out if you need to do:
* **Instance** segmentation
* **Semantic** segmentation
* **Panoptic** segmentation
* **Multi-class instance** segmentation

### Toy data
This repo includes the ```data/``` directory with some toy data which you can use as the *Uncurated dataset* folder. You can create (empty) folders for the other two directories required in the welcome window and start playing around.
Expand All @@ -29,3 +29,4 @@ Our platform encourages the use of data centric practices. With the user friendl
- Focus on data curation: no interaction with model parameters during training and inference

#### *Get more with less!*
<img src="https://github.com/HelmholtzAI-Consultants-Munich/data-centric-platform/blob/main/src/client/readme_figs/dcp_pipeline.png" width="200" height="200">
20 changes: 20 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line, and also
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = source
BUILDDIR = build

# Put it first so that "make" without argument is like "make help".
help:
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

.PHONY: help Makefile

# Catch-all target: route all unknown targets to Sphinx using the new
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
35 changes: 35 additions & 0 deletions docs/make.bat
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=source
set BUILDDIR=build

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.https://www.sphinx-doc.org/
exit /b 1
)

if "%1" == "" goto help

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%

:end
popd
2 changes: 2 additions & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
sphinx
sphinx-rtd-theme
48 changes: 48 additions & 0 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Configuration file for the Sphinx documentation builder.
#
# For the full list of built-in configuration values, see the documentation:
# https://www.sphinx-doc.org/en/master/usage/configuration.html

# -- Project information -----------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information

project = 'DCP'
copyright = '2024, Christina Bukas, Mariia Koren, Helena Pelin'
author = 'Christina Bukas, Mariia Koren, Helena Pelin'
release = '0.1'

# -- General configuration ---------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration

extensions = []

templates_path = ['_templates']
exclude_patterns = []

language = 'English'

# -- Options for HTML output -------------------------------------------------
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output

html_theme = 'alabaster'
#html_static_path = ['_static']

import os
import sys
from pathlib import Path
import sphinx_rtd_theme

# Add parent dir to known paths
p = Path(__file__).parents[2]
sys.path.insert(0, os.path.abspath(p))
sys.path.insert(0, os.path.join(p, 'src/server/dcp_server'))
# Add the following extensions
extensions = [
'sphinx.ext.autodoc',
'sphinx.ext.autosummary',
'sphinx.ext.napoleon',
'sphinx_rtd_theme'
]

# Use RTD theme
html_theme = "sphinx_rtd_theme"
34 changes: 34 additions & 0 deletions docs/source/dcp_client.gui.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
dcp\_client.gui package
=======================

.. automodule:: dcp_client.gui
:members:
:undoc-members:
:show-inheritance:

Submodules
----------

dcp\_client.gui.main\_window module
-----------------------------------

.. automodule:: dcp_client.gui.main_window
:members:
:undoc-members:
:show-inheritance:

dcp\_client.gui.napari\_window module
-------------------------------------

.. automodule:: dcp_client.gui.napari_window
:members:
:undoc-members:
:show-inheritance:

dcp\_client.gui.welcome\_window module
--------------------------------------

.. automodule:: dcp_client.gui.welcome_window
:members:
:undoc-members:
:show-inheritance:
52 changes: 52 additions & 0 deletions docs/source/dcp_client.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
dcp\_client package
===================

The dcp_client package contains modules and subpackages for interacting with a server for model inference and training. It provides functionalities for managing GUI windows, handling image storage, and connecting to the server for model operations.

dcp_client.app
Defines the core application class and related functionalities.
- ``dcp_client.app.Application``: Represents the main application and provides methods for image management, model interaction, and server connectivity.
- ``dcp_client.app.DataSync``: Abstract base class for data synchronization operations.
- ``dcp_client.app.ImageStorage``: Abstract base class for image storage operations.
- ``dcp_client.app.Model``: Abstract base class for model operations.

dcp_client.gui
Contains modules for GUI components.
- ``dcp_client.gui.main_window``: Defines the main application window and associated event functions.
- ``dcp_client.gui.napari_window``: Manages the Napari window and its functionalities.
- ``dcp_client.gui.welcome_window``: Implements the welcome window and its interactions.

dcp_client.utils
Contains utility modules for various tasks.
- ``dcp_client.utils.bentoml_model``: Handles interactions with BentoML for model inference and training.
- ``dcp_client.utils.fsimagestorage``: Provides functions for managing images stored in the filesystem.
- ``dcp_client.utils.settings``: Defines initialization functions and settings.
- ``dcp_client.utils.sync_src_dst``: Implements data synchronization between source and destination.
- ``dcp_client.utils.utils``: Offers various utility functions for common tasks.


Submodules
----------

dcp\_client.app module
----------------------

.. automodule:: dcp_client.app
:members:
:undoc-members:
:show-inheritance:

dcp\_client.gui module
----------------------
.. toctree::
:maxdepth: 4

dcp_client.gui

dcp\_client.utils module
------------------------
.. toctree::
:maxdepth: 4

dcp_client.utils

Loading

0 comments on commit 773df7e

Please sign in to comment.