Skip to content

Commit

Permalink
Refactor morphology to metrics and add gh workflow to publish docs
Browse files Browse the repository at this point in the history
  • Loading branch information
BC-Chang committed Feb 19, 2024
1 parent 479e2ae commit 7c724f9
Show file tree
Hide file tree
Showing 12 changed files with 84 additions and 42 deletions.
43 changes: 43 additions & 0 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
# This is a basic workflow to help you get started with Actions

name: Build-sphinx-docs

# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the main branch
push:
branches: [ master ]
pull_request:
branches: [ master ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2

- name: Set up Python 3.10
uses: actions/setup-python@v2
with:
python-version: "3.10"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Build HTML
run: |
cd docs/
make html
- name: Run ghp-import
run: |
ghp-import -n -p -f docs/_build/html
4 changes: 2 additions & 2 deletions docs/dpm_tools.morphology.rst → docs/dpm_tools.metrics.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,15 @@ Submodules
dpm\_tools.morphology.features module
-------------------------------------

.. automodule:: dpm_tools.morphology.features
.. automodule:: dpm_tools.metrics.features
:members:
:undoc-members:
:show-inheritance:

Module contents
---------------

.. automodule:: dpm_tools.morphology
.. automodule:: dpm_tools.metrics
:members:
:undoc-members:
:show-inheritance:
2 changes: 1 addition & 1 deletion docs/dpm_tools.rst
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ Subpackages
:maxdepth: 4

dpm_tools.io
dpm_tools.morphology
dpm_tools.metrics
dpm_tools.visualization

Module contents
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
dpm\_tools.morphology.features
==============================
dpm\_tools.metrics.features
===========================

.. automodule:: dpm_tools.morphology.features
.. automodule:: dpm_tools.metrics.features



Expand Down
31 changes: 31 additions & 0 deletions docs/modules/generated/dpm_tools.metrics.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
dpm\_tools.metrics
==================

.. automodule:: dpm_tools.metrics



















.. rubric:: Modules

.. autosummary::
:toctree:
:recursive:

dpm_tools.metrics.features

31 changes: 0 additions & 31 deletions docs/modules/generated/dpm_tools.morphology.rst

This file was deleted.

2 changes: 1 addition & 1 deletion docs/modules/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@ Modules
:recursive:

dpm_tools.io
dpm_tools.morphology
dpm_tools.metrics
dpm_tools.visualization
2 changes: 1 addition & 1 deletion dpm_tools/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from time import perf_counter_ns

from . import morphology
from . import metrics
from . import io
from . import visualization

Expand Down
File renamed without changes.
File renamed without changes.
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@
from typing import Tuple, Literal

def slicewise_edt(data) -> np.ndarray:
"""
Compute the Euclidean distance transform map of each slice individually and stacks them into a single 3D array.
""" Compute the Euclidean distance transform map of each slice individually and stacks them into a single 3D array.
:param data: Image dataclass
:return: Euclidean distance transform map of each slice
:rtype: numpy.ndarray
Expand Down
2 changes: 1 addition & 1 deletion examples/morphological_features.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import numpy as np
from dpm_tools.morphology import chords
from dpm_tools.metrics import chords
from dpm_tools.io import ImageFromFile

0 comments on commit 7c724f9

Please sign in to comment.