Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .flake8
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# .flake8
[flake8]
exclude = docs/
ignore = E501, W503, E203, E266, E402
max-line-length = 88
34 changes: 0 additions & 34 deletions .github/workflows/build-docs.yml

This file was deleted.

15 changes: 7 additions & 8 deletions .github/workflows/build-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install .[test]
pip install .[test] --verbose
- name: Test with pytest
run: |
pytest --cov-report xml --cov=vessel_analysis_3d vessel_analysis_3d/tests/
Expand All @@ -50,9 +50,9 @@ jobs:
- name: Lint with flake8
run: |
flake8 vessel_analysis_3d --count --verbose --show-source --statistics
- name: Check with black
run: |
black --check vessel_analysis_3d
#- name: Check with black
# run: |
# black --check vessel_analysis_3d

publish:
if: "contains(github.event.head_commit.message, 'Bump version')"
Expand All @@ -68,12 +68,11 @@ jobs:
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel
pip install build
- name: Build Package
run: |
python setup.py sdist bdist_wheel
run: python -m build
- name: Publish to PyPI
uses: pypa/gh-action-pypi-publish@master
with:
user: MMV-Lab
user: __token__
password: ${{ secrets.PYPI_TOKEN }}
10 changes: 5 additions & 5 deletions .github/workflows/test-and-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install .[test]
pip install .[test] --verbose
- name: Test with pytest
run: |
pytest vessel_analysis_3d/tests/
Expand All @@ -38,10 +38,10 @@ jobs:
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install .[test]
pip install .[test] --verbose
- name: Lint with flake8
run: |
flake8 vessel_analysis_3d --count --verbose --show-source --statistics
- name: Check with black
run: |
black --check vessel_analysis_3d
# - name: Check with black
# run: |
# black --check vessel_analysis_3d
52 changes: 43 additions & 9 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[build-system]
requires = ["setuptools>=61.0"]
requires = ["setuptools>=64", "wheel"]
build-backend = "setuptools.build_meta"

[project]
Expand All @@ -12,14 +12,13 @@ license = {file = "LICENSE"}
authors = [
{name = "Jianxu Chen", email = "jianxuchen.ai@gmail.com"},
]
keywords = ["vessel_analysis_3d"]
keywords = ["vessel analysis", "morphology", "topology"]
classifiers = [
"Development Status :: 2 - Pre-Alpha",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Natural Language :: English",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
]
dependencies = [
"bioio==1.6.1",
Expand Down Expand Up @@ -69,16 +68,51 @@ dev = [
"wheel>=0.34.2",
]

all = [
"vessel_analysis_3d[dev]",
"vessel_analysis_3d[test]",
"vessel_analysis_3d[setup]",
]

[project.urls]
Homepage = "https://github.com/MMV-Lab/vessel_analysis_3d"

[tool.setuptools]
include-package-data = true
zip-safe = false

[tool.setuptools.packages.find]
include = ["vessel_analysis_3d"]

[project.scripts]
run_vessel_analysis = "vessel_analysis_3d.bin.run_analysis:main"

[tool.pytest.ini_options]
collect_ignore = ["setup.py"]
addopts = "--cov=vessel_analysis_3d --no-cov-on-fail --cov-report=term-missing --cov-report=xml --cov-branch --durations=10"
testpaths = [
"vessel_analysis_3d/tests",
]
python_files = "test_*.py"


[tool.flake8]
exclude = ["docs/"]
ignore = ["E203", "E402", "W291", "W503", "E501"]
max-line-length = 88
exclude = [
"docs/",
".git/",
"__pycache__/",
"build/",
"dist/",
".venv/",
".tox/",
"*.egg-info/",
]
ignore = [
"E203",
"E402",
"W291",
"W503",
"W293",
"W292",
"E501",
]
max-line-length = 88
10 changes: 5 additions & 5 deletions setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ current_version = 0.0.1
commit = True
tag = True

[bumpversion:file:setup.py]
search = version="{current_version}"
replace = version="{new_version}"
[bumpversion:file:pyproject.toml]
search = version = "{current_version}"
replace = version = "{new_version}"

[bumpversion:file:vessel_analysis_3d/__init__.py]
search = {current_version}
replace = {new_version}
search = __version__ = "{current_version}"
replace = __version__ = "{new_version}"

ignore = E203, E402, W291, W503, W293, W292, E501
max-line-length = 88
Expand Down
20 changes: 0 additions & 20 deletions setup.py

This file was deleted.

4 changes: 1 addition & 3 deletions vessel_analysis_3d/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# -*- coding: utf-8 -*-

"""Top-level package for 3D Vascular Structure Analysis."""
from .processing_pipeline import Pipeline3D # noqa: F401

__author__ = "Jianxu Chen"
__email__ = "jianxuchen.ai@gmail.com"
Expand All @@ -11,6 +12,3 @@

def get_module_version():
return __version__


from .processing_pipeline import Pipeline3D # noqa: F401
18 changes: 9 additions & 9 deletions vessel_analysis_3d/graph/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -217,15 +217,15 @@ def prune_and_analyze(self, return_final_skel: bool = True):
# fill dictionaries containing all filament, segment and branch
# point statistics
self.segStatsDict[ithDisjointGraph] = filament.segmentStats
self.filStatsDict[ithDisjointGraph][
"TerminalPoints"
] = self.countEndPointsDict[ithDisjointGraph]
self.filStatsDict[ithDisjointGraph][
"BranchPoints"
] = self.countBranchPointsDict[ithDisjointGraph]
self.filStatsDict[ithDisjointGraph][
"Segments"
] = self.countSegmentsDict[ithDisjointGraph]
self.filStatsDict[ithDisjointGraph]["TerminalPoints"] = (
self.countEndPointsDict[ithDisjointGraph]
)
self.filStatsDict[ithDisjointGraph]["BranchPoints"] = (
self.countBranchPointsDict[ithDisjointGraph]
)
self.filStatsDict[ithDisjointGraph]["Segments"] = (
self.countSegmentsDict[ithDisjointGraph]
)
self.branchesBrPtDict[ithDisjointGraph] = filament.brPtsDict
else:
self.infoDict["filaments"] -= 1
Expand Down
12 changes: 6 additions & 6 deletions vessel_analysis_3d/graph/filament.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,13 +97,13 @@ def dfs_iterative(self):
): # cycle found
if len(self.graph[neighbor]) > 2: # neighbor is branch point
oldPred = self._predDict[neighbor]
self._predDict[
neighbor
] = vertex # change predecessor to get segment of cycle
self._predDict[neighbor] = (
vertex # change predecessor to get segment of cycle
)
segment = self._getSegment(neighbor)
self._predDict[
neighbor
] = oldPred # change back to old predecessor
self._predDict[neighbor] = (
oldPred # change back to old predecessor
)
self._setSegStats(segment, interpolate=self.interpolate)
if len(self.graph[vertex]) == 1: # end point found
self.endPtsList.append(vertex)
Expand Down
2 changes: 1 addition & 1 deletion vessel_analysis_3d/graph/stats_reporting.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def getAllStats(dictionary: Dict, imgName: str) -> List:
for segment in dictionary[filament]:
final = []
for element in segment:
element= tuple(int(x) for x in element)
element = tuple(int(x) for x in element)
final.append(element)
segment = tuple(final)
list_item = [imgName, filament, segment]
Expand Down