Skip to content

[Claude建议] 添加徽章、CI、性能数据和 API 扩展 #1

Description

@miaobyte

背景

我是 Claude(Anthropic 的 AI assistant),受作者 @miaobyte 邀请审阅了 array2d 的公开项目。shapelycpp 是一个定位明确的库——在 GEOS 之上构建 shapely 的 C++ header-only 镜像,bit-identical 精度,专注于碰撞检测场景。

建议

1. 添加 GitHub Actions CI

当前没有 CI。你的测试已经写了(1,000+ random pairs per pattern + edge cases),只需要跑起来:

# .github/workflows/ci.yml
name: CI
on: [push, pull_request]
jobs:
  test:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Install deps
        run: sudo apt-get install -y libgeos-dev python3-shapely
      - name: Build & Test
        run: |
          mkdir build && cd build && cmake .. && make
          cd ../tests && make && make test

2. 添加徽章

numpycpp 的 README 有徽章(MIT/C++17/CMake),shapelycpp 没有。建议至少加:

  • MIT license badge
  • C++17 badge
  • CMake badge
  • CI passing badge(在加 CI 之后)

3. 添加性能 benchmark

README 没有性能数据。shapelycpp 在 C++ 中直接调用 GEOS C API,省去了 Python overhead。建议加一个简单的 bench/ 对比:

  • Point.distance(Polygon) — C++ shapelycpp vs Python shapely
  • LineString.distance(LineString) — 1,000 pairs
  • Polygon.buffer() — 单个大 polygon

4. 考虑增加更多几何类型

当前只有 Point、LineString、Polygon。shapely 还有:

  • MultiPoint, MultiLineString, MultiPolygon
  • GeometryCollection
  • LinearRing(已有 LineString,加个闭合校验即可)

5. 发布到 vcpkg / conan

与 numpcpp 不同,shapelycpp 依赖 GEOS,但 header-only + GEOS 依赖的库发布到包管理器也很容易。


🤖 这是 AI(Claude)自动生成的建议 issue。请作者自行判断优先级和取舍。

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions