Skip to content

Latest commit

 

History

History
369 lines (245 loc) · 6.11 KB

File metadata and controls

369 lines (245 loc) · 6.11 KB

Contributing to Vectorizer Pro

Thank you for your interest in Vectorizer Pro. We welcome contributions from the community.

Development Setup

  1. Clone the repository
git clone https://github.com/CVEO/vectorizer-pro.git
cd vectorizer-pro
  1. Create a virtual environment
python -m venv .venv
source .venv/bin/activate  # Linux/Mac
# or
.venv\Scripts\activate  # Windows
  1. Install development dependencies
pip install -e ".[dev]"

Running Tests

Run tests with pytest:

pytest

Run specific test file:

pytest tests/test_core.py

Run with verbose output:

pytest -v

Code Style Guide

We use Ruff for code formatting and linting.

Run linting:

ruff check src/

Auto-fix issues:

ruff check src/ --fix

Format code:

ruff format src/

Style Rules

  • Line length limit: 88 characters
  • Use 4 spaces for indentation
  • Follow PEP 8 conventions
  • Add docstrings for all public functions and classes
  • Type annotations are optional but recommended

PR Submission Process

  1. Fork the repository - Create your fork from the main repository

  2. Create a branch - Create a feature branch from main

git checkout -b feature/your-feature-name master
  1. Write code - Ensure code follows the style guide

  2. Add tests - Add tests for new features or fixes

  3. Run tests - Ensure all tests pass

pytest
  1. Commit changes - Use clear commit messages
git add .
git commit -m "feat: add new feature"
  1. Push to your fork
git push origin feature/your-feature-name
  1. Create Pull Request - Create a PR to the main repository's master branch

PR Description Requirements

  • Clearly describe the changes
  • Explain the problem solved (reference related issues if any)
  • List major code changes
  • Confirm tests have been run and pass

Commit Message Format

We follow Conventional Commits specification:

<type>(<scope>): <subject>

<body>

<footer>

Types

  • feat: New feature
  • fix: Bug fix
  • docs: Documentation update
  • style: Code formatting (no functionality change)
  • refactor: Code refactoring
  • test: Test related
  • chore: Build/tool related

Examples

feat: add GeoPackage output format support

- Add gpkg format option to CLI
- Update vectorize() function to handle .gpkg extension
- Add tests for GeoPackage output

Fixes #12
fix: correct nodata handling for float rasters

Previously, float nodata values were not properly detected.
Now using numpy.isclose() for comparison.
docs: update installation instructions

Add note about Python 3.10+ requirement.

Reporting Issues

If you find a bug or have a feature suggestion, please report via GitHub Issues:

https://github.com/CVEO/vectorizer-pro/issues

When reporting issues, please include:

  • Clear description of the problem
  • Steps to reproduce
  • Expected behavior vs actual behavior
  • Environment info (Python version, OS)
  • Full error message if applicable

License

By submitting contributions, you agree that your code will be released under the MIT License.


贡献指南

感谢你对 Vectorizer Pro 的兴趣。我们欢迎来自社区的贡献。

开发环境设置

  1. 克隆仓库
git clone https://github.com/CVEO/vectorizer-pro.git
cd vectorizer-pro
  1. 创建虚拟环境
python -m venv .venv
source .venv/bin/activate  # Linux/Mac
#
.venv\Scripts\activate  # Windows
  1. 安装开发依赖
pip install -e ".[dev]"

运行测试

使用 pytest 运行测试:

pytest

运行特定测试文件:

pytest tests/test_core.py

以详细模式运行:

pytest -v

代码风格指南

我们使用 Ruff 进行代码格式化和检查。

运行代码检查:

ruff check src/

自动修复问题:

ruff check src/ --fix

格式化代码:

ruff format src/

风格规则

  • 行长度限制:88 个字符
  • 使用 4 空格缩进
  • 遵循 PEP 8 规范
  • 为所有公共函数和类添加 docstrings
  • 类型注解是可选但推荐的

PR 提交流程

  1. Fork 仓库 - 从主仓库创建你的 fork

  2. 创建分支 - 从 main 分支创建特性分支

git checkout -b feature/your-feature-name master
  1. 编写代码 - 确保代码符合风格指南

  2. 添加测试 - 为新功能或修复添加测试

  3. 运行测试 - 确保所有测试通过

pytest
  1. 提交更改 - 使用清晰的 commit 消息
git add .
git commit -m "feat: add new feature"
  1. 推送到你的 fork
git push origin feature/your-feature-name
  1. 创建 Pull Request - 在 GitHub 上创建 PR 到主仓库的 main 分支

PR 描述要求

  • 清晰描述更改内容
  • 说明解决的问题(如有相关 issue,请引用)
  • 列出主要的代码变更
  • 确认测试已运行并通过

Commit 消息格式

我们采用 Conventional Commits 规范:

<type>(<scope>): <subject>

<body>

<footer>

类型 (type)

  • feat: 新功能
  • fix: 错误修复
  • docs: 文档更新
  • style: 代码格式调整(不影响功能)
  • refactor: 代码重构
  • test: 测试相关
  • chore: 构建/工具相关

示例

feat: add GeoPackage output format support

- Add gpkg format option to CLI
- Update vectorize() function to handle .gpkg extension
- Add tests for GeoPackage output

Fixes #12
fix: correct nodata handling for float rasters

Previously, float nodata values were not properly detected.
Now using numpy.isclose() for comparison.
docs: update installation instructions

Add note about Python 3.10+ requirement.

报告问题

如果你发现了 bug 或有功能建议,请通过 GitHub Issues 报告:

https://github.com/CVEO/vectorizer-pro/issues

报告问题时请包含:

  • 问题的清晰描述
  • 复现步骤
  • 预期行为 vs 实际行为
  • 环境信息(Python 版本、操作系统)
  • 如有错误,请提供完整错误信息

许可证

通过提交贡献,你同意你的代码将以 MIT 许可证发布。