Skip to content

Commit

Permalink
Merge branch 'main' into kaiming-weight-init
Browse files Browse the repository at this point in the history
  • Loading branch information
rhoadesScholar committed Feb 15, 2024
2 parents 31978ce + 4fdc297 commit f9a58bd
Show file tree
Hide file tree
Showing 9 changed files with 112 additions and 123 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
name: Generate Pages

on:
pull_request:
branches:
- main
push:
branches:
- main
Expand Down
9 changes: 2 additions & 7 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,9 @@ ci:
autofix_commit_msg: "style(pre-commit.ci): auto fixes [...]"
autoupdate_commit_msg: "ci(pre-commit.ci): autoupdate"

default_install_hook_types: [pre-commit, commit-msg]
default_install_hook_types: [pre-commit]

repos:
# - repo: https://github.com/compilerla/conventional-pre-commit
# rev: v2.1.1
# hooks:
# - id: conventional-pre-commit
# stages: [commit-msg]

- repo: https://github.com/charliermarsh/ruff-pre-commit
rev: v0.2.1
Expand All @@ -32,7 +27,7 @@ repos:
rev: v1.8.0
hooks:
- id: mypy
files: "^src/"
files: "^dacapo/"
# # you have to add the things you want to type check against here
# additional_dependencies:
# - numpy
25 changes: 15 additions & 10 deletions CONTRIBUTOR.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,27 @@
# Contributor Guide

## Development Installation
- currently, pip install -r requirements-dev.txt
and then pip install -e .
TODO: set up pip install -e .[dev]
`pip install -e .[dev,test]`

## Style and Pre-Commit
- TODO: pre-commit with black mypy
- do use ruff and black
- do have typing, developers should supply types
To set up pre-commit:
```
pre-commit autoupdate
pre-commit install
```
Then any time you write a commit, it will run ruff, black, mypy, and validate the pyproject.toml.
To skip the pre-commit step, use:
`git commit --no-verify`

Ruff, black, and mypy settings are specified in the pyproject.toml. Currently they are not very strict, but this may change in the future.

## Testing
- Unittest your functions
- Pytest run automatically on PR, and so is codcov (maybe)
TODO: codecov
To run tests with coverage locally:
`pytest tests --color=yes --cov --cov-report=term-missing`
This will also be run automatically when a PR is made to master and a codecov report will be generated telling you if your PR increased or decreased coverage.


## Branching and PRs
- Users that have been added to the CellMap organization and the DaCapo project should be able to develop directly into the CellMap fork of DaCapo. Other users will need to create a fork.
- For a completely new feature, make a branch off of the `main` branch of CellMap's fork of DaCapo with a name describing the feature. If you are collaborating on a feature that already has a branch, you can branch off that feature branch.
- Currently, you should make your PRs into the main branch of CellMap's fork, or the feature branch you branched off of. Once the PR is merged, the feature branch should be deleted.
- Currently, you should make your PRs into the main branch of CellMap's fork, or the feature branch you branched off of. PRs currently require one maintainer's approval before merging. Once the PR is merged, the feature branch should be deleted.
3 changes: 1 addition & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,7 @@ default:
pip install .

install-dev:
pip install -e .
pip install --upgrade -r requirements-dev.txt
pip install -e ".[dev]"

.PHONY: tests
tests:
Expand Down
14 changes: 9 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ framework, but currently only supports [`torch`](https://pytorch.org/) with
plans to support [`tensorflow`](https://www.tensorflow.org/).

## Installation and Setup
Currently, only python 3.10 is supported. We recommend creating a new conda environment for dacapo with python 3.10.
Currently, python>=3.10 is supported. We recommend creating a new conda environment for dacapo with python 3.10.
```
conda create -n dacapo python=3.10
```
Expand All @@ -30,12 +30,16 @@ git clone git@github.com:janelia-cellmap/dacapo.git
cd dacapo
pip install .
```
This will install the minimum required dependencies. However, having acess to a MongoDB server for storing outputs is strongly recommended for smoothest performance.
This will install the minimum required dependencies. However, having access to a MongoDB server for storing outputs is strongly recommended for smoothest performance.

To install and run MongoDB locally, refer to the MongoDB documentation [here](https://www.mongodb.com/docs/manual/installation/).

## Functionality Overview

Tasks we support

Networks we have for those tasks
Tasks we support and approaches for those tasks:
- Instance Segmentation
- Affinities
- Local Shape Descriptors
- Semantic segmentation
- Signed distances
- One-hot encoding of different types of objects
74 changes: 0 additions & 74 deletions mypy.ini

This file was deleted.

99 changes: 85 additions & 14 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ dev = [
"rich",
"ruff",
"pre-commit",
"jupyter",
]
docs = [
"sphinx-autodoc-typehints",
Expand Down Expand Up @@ -103,22 +104,27 @@ dacapo = "dacapo.cli:cli"
line-length = 88
target-version = "py310"
src = ["dacapo"]

[tool.ruff.lint]
# https://beta.ruff.rs/docs/rules/
# We may want to enable some of these options later
select = [
"E", # style errors
"W", # style warnings
# "W", # style warnings
"F", # flakes
"D", # pydocstyle
"I", # isort
"UP", # pyupgrade
"C4", # flake8-comprehensions
"B", # flake8-bugbear
"A001", # flake8-builtins
"RUF", # ruff-specific rules
# "D", # pydocstyle
# "I", # isort
# "UP", # pyupgrade
# "C4", # flake8-comprehensions
# "B", # flake8-bugbear
# "A001", # flake8-builtins
# "RUF", # ruff-specific rules
]
extend-ignore = ["E501"]

[tool.ruff.per-file-ignores]
[tool.ruff.lint.per-file-ignores]
"tests/*.py" = ["D", "S"]
"__init__.py" = ["F401"]

# https://docs.pytest.org/en/6.2.x/customize.html
[tool.pytest.ini_options]
Expand All @@ -129,20 +135,85 @@ filterwarnings = [
"ignore::DeprecationWarning",
]


# https://mypy.readthedocs.io/en/stable/config_file.html
[tool.mypy]
files = "dacapo/**/"
strict = true
strict = false
disallow_any_generics = false
disallow_subclassing_any = false
show_error_codes = true
pretty = true

# # module specific overrides
# [[tool.mypy.overrides]]
# module = ["numpy.*",]
# ignore_errors = true
[[tool.mypy.overrides]]
module = ["funlib.*",]
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = ["gunpowder.*"]
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = "scipy.*"
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = "augment.*"
ignore_missing_imports = true
[[tool.mypy.overrides]]
module="tifffile.*"
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = "daisy.*"
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = "lazy_property.*"
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = "skimage.*"
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = "fibsem_tools.*"
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = "neuroglancer.*"
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = "tqdm.*"
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = "zarr.*"
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = "pymongo.*"
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = "bson.*"
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = "affogato.*"
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = "SimpleITK.*"
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = "bokeh.*"
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = "lsd.*"
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = "yaml.*"
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = "pytest_lazyfixture.*"
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = "neuclease.dvid.*"
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = "mwatershed.*"
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = "numpy_indexed.*"
ignore_missing_imports = true


# https://coverage.readthedocs.io/en/6.4/config.html
Expand Down
5 changes: 0 additions & 5 deletions requirements-dev.txt

This file was deleted.

3 changes: 0 additions & 3 deletions ruff.toml

This file was deleted.

0 comments on commit f9a58bd

Please sign in to comment.