Skip to content
Open
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
210 changes: 210 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,210 @@
# Byte-compiled / optimized / DLL files
__pycache__/
*.py[cod]
*$py.class

# C extensions
*.so

# Distribution / packaging
.Python
build/
develop-eggs/
dist/
downloads/
eggs/
.eggs/
lib/
lib64/
parts/
sdist/
var/
wheels/
share/python-wheels/
*.egg-info/
.installed.cfg
*.egg
MANIFEST

# PyInstaller
*.manifest
*.spec

# Installer logs
pip-log.txt
pip-delete-this-directory.txt

# Unit test / coverage reports
htmlcov/
.tox/
.nox/
.coverage
.coverage.*
.cache
nosetests.xml
coverage.xml
*.cover
*.py,cover
.hypothesis/
.pytest_cache/
cover/

# Translations
*.mo
*.pot

# Django stuff:
*.log
local_settings.py
db.sqlite3
db.sqlite3-journal

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/

# PyBuilder
.pybuilder/
target/

# Jupyter Notebook
.ipynb_checkpoints

# IPython
profile_default/
ipython_config.py

# pyenv
.python-version

# pipenv
Pipfile.lock

# poetry
# Note: Do not ignore poetry.lock - it should be committed
# poetry.lock is intentionally not ignored

# pdm
.pdm.toml
.pdm-python
.pdm-build/

# PEP 582
__pypackages__/

# Celery stuff
celerybeat-schedule
celerybeat.pid

# SageMath parsed files
*.sage.py

# Environments
.env
.venv
env/
venv/
ENV/
env.bak/
venv.bak/

# Spyder project settings
.spyderproject
.spyproject

# Rope project settings
.ropeproject

# mkdocs documentation
/site

# mypy
.mypy_cache/
.dmypy.json
dmypy.json

# Pyre type checker
.pyre/

# pytype static type analyzer
.pytype/

# Cython debug symbols
cython_debug/

# PyCharm
.idea/

# Visual Studio Code
.vscode/

# Claude settings and history
.claude/*

# macOS
.DS_Store

# Windows
Thumbs.db
ehthumbs.db
Desktop.ini

# Linux
*~

# Temporary files
*.tmp
*.temp
*.swp
*.swo
*.bak

# Model weights and checkpoints (usually large files)
*.pth
*.pt
*.h5
*.ckpt
*.safetensors
checkpoints/
weights/
models/

# Data files (often large)
data/raw/
data/processed/
datasets/

# Output and results
outputs/
results/
runs/
logs/
tensorboard/

# CUDA build artifacts
*.cu.o
*.cu.cpp
model/cuda/build/
model/cuda/*.so

# Testing artifacts
test_output/
test_results/
.benchmarks/

# Documentation build
docs/build/
docs/_generated/

# Secrets and credentials
*.key
*.pem
*.crt
secrets/
credentials/
2,134 changes: 2,134 additions & 0 deletions poetry.lock

Large diffs are not rendered by default.

169 changes: 169 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,169 @@
[tool.poetry]
name = "restore-rwkv"
version = "0.1.0"
description = "Medical Image Restoration with RWKV"
authors = ["Your Name <you@example.com>"]
readme = "README.md"
license = "MIT"
packages = [{include = "."}]

[tool.poetry.dependencies]
python = "^3.9"
torch = "^2.0.0"
torchvision = "^0.15.0"
numpy = "^1.24.0"
tqdm = "^4.66.0"
pillow = "^10.0.0"
scipy = "^1.10.0"
scikit-image = "^0.21.0"
matplotlib = "^3.7.0"
einops = "^0.7.0"
simpleitk = "^2.3.0"
pandas = "^2.0.0"
setuptools = "^69.0.0"

[tool.poetry.group.dev.dependencies]
pytest = "^8.0.0"
pytest-cov = "^5.0.0"
pytest-mock = "^3.12.0"
pytest-xdist = "^3.5.0"
black = "^24.0.0"
isort = "^5.13.0"
flake8 = "^7.0.0"
mypy = "^1.8.0"
pre-commit = "^3.6.0"


[tool.pytest.ini_options]
minversion = "8.0"
addopts = [
"-ra",
"--strict-markers",
"--strict-config",
"--cov=.",
"--cov-branch",
"--cov-report=term-missing:skip-covered",
"--cov-report=html:htmlcov",
"--cov-report=xml:coverage.xml",
"--cov-fail-under=0",
"-vv",
]
testpaths = ["tests"]
python_files = ["test_*.py", "*_test.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]
markers = [
"unit: Unit tests",
"integration: Integration tests",
"slow: Slow running tests",
"skip: Skip test",
]
filterwarnings = [
"error",
"ignore::UserWarning",
"ignore::DeprecationWarning",
]
norecursedirs = [
".git",
".tox",
"dist",
"build",
"*.egg",
"__pycache__",
".pytest_cache",
"htmlcov",
]

[tool.coverage.run]
source = ["."]
branch = true
parallel = true
omit = [
"*/tests/*",
"*/test_*.py",
"*/__pycache__/*",
"*/site-packages/*",
"*/dist-packages/*",
"*/venv/*",
"*/.venv/*",
"*/setup.py",
"*/conftest.py",
"*/.pytest_cache/*",
"*/htmlcov/*",
"*/model/cuda/*",
]

[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"def __repr__",
"def __str__",
"raise AssertionError",
"raise NotImplementedError",
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
"if typing.TYPE_CHECKING:",
"@abstractmethod",
"@abc.abstractmethod",
"except ImportError",
"pass",
]
precision = 2
show_missing = true
skip_covered = false
skip_empty = true
sort = "Cover"
fail_under = 80

[tool.coverage.html]
directory = "htmlcov"
title = "Restore RWKV Coverage Report"

[tool.coverage.xml]
output = "coverage.xml"

[tool.isort]
profile = "black"
multi_line_output = 3
include_trailing_comma = true
force_grid_wrap = 0
use_parentheses = true
ensure_newline_before_comments = true
line_length = 88
skip_gitignore = true

[tool.black]
line-length = 88
target-version = ['py38', 'py39', 'py310', 'py311']
include = '\.pyi?$'
extend-exclude = '''
/(
# directories
\.eggs
| \.git
| \.hg
| \.mypy_cache
| \.tox
| \.venv
| _build
| buck-out
| build
| dist
| model/cuda
)/
'''

[tool.mypy]
python_version = "3.8"
warn_return_any = true
warn_unused_configs = true
disallow_untyped_defs = false
ignore_missing_imports = true
exclude = [
"tests/",
"model/cuda/",
]

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"
10 changes: 10 additions & 0 deletions run_tests.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash
# Test runner script for the project

# Run all tests
if [ "$1" == "" ]; then
poetry run pytest
# Run specific test file or directory
else
poetry run pytest "$@"
fi
Empty file added tests/__init__.py
Empty file.
Loading