Skip to content

Commit fe86662

Browse files
peng.li24claude
andcommitted
feat: add open-source community standards — LICENSE, templates, docs
Add MIT LICENSE, .gitignore, CONTRIBUTING.md, SECURITY.md, CODE_OF_CONDUCT.md, issue/PR templates, and enhanced README with badges and project structure. Enable GitHub Discussions and set repository topics. Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
1 parent d00620b commit fe86662

9 files changed

Lines changed: 266 additions & 9 deletions

File tree

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
name: Bug Report
3+
about: Report a bug in numpcpp
4+
title: "[Bug] "
5+
labels: bug
6+
assignees: ""
7+
---
8+
9+
## Description
10+
11+
A clear description of the bug.
12+
13+
## Steps to Reproduce
14+
15+
1.
16+
2.
17+
3.
18+
19+
## Expected Behavior
20+
21+
What should have happened.
22+
23+
## Actual Behavior
24+
25+
What actually happened, including any error messages.
26+
27+
## Environment
28+
29+
- OS: [e.g. Ubuntu 22.04]
30+
- Compiler: [e.g. GCC 12, Clang 16]
31+
- CMake version:
32+
- Eigen3 version:
33+
- Python version:
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
name: Feature Request
3+
about: Suggest a new feature or enhancement
4+
title: "[Feature] "
5+
labels: enhancement
6+
assignees: ""
7+
---
8+
9+
## Problem
10+
11+
What problem would this feature solve?
12+
13+
## Proposed Solution
14+
15+
Describe the feature or API you'd like to see.
16+
17+
## Alternatives Considered
18+
19+
Any alternative approaches you've thought about.
20+
21+
## Additional Context
22+
23+
Any other context, references, or use cases.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
## Summary
2+
3+
<!-- Briefly describe what this PR does. -->
4+
5+
## Related Issues
6+
7+
<!-- Link any related issues: Fixes #123, Related to #456 -->
8+
9+
## Checklist
10+
11+
- [ ] Code follows project style conventions
12+
- [ ] Tests added/updated for new functionality
13+
- [ ] Build succeeds locally (`cmake --build build`)
14+
- [ ] Documentation updated if needed

.gitignore

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
# Build directories
2+
build/
3+
cmake-build-*/
4+
5+
# Compiled output
6+
*.o
7+
*.so
8+
*.dylib
9+
*.dll
10+
*.a
11+
*.lib
12+
*.exe
13+
14+
# Python
15+
__pycache__/
16+
*.py[cod]
17+
*$py.class
18+
*.egg-info/
19+
dist/
20+
.eggs/
21+
22+
# IDE
23+
.vscode/
24+
.idea/
25+
*.swp
26+
*.swo
27+
*~
28+
.DS_Store
29+
30+
# CMake generated
31+
CMakeCache.txt
32+
CMakeFiles/
33+
cmake_install.cmake
34+
Makefile
35+
CTestTestfile.cmake
36+
compile_commands.json
37+
38+
# Packaging
39+
*.deb
40+
*.rpm

CODE_OF_CONDUCT.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
We as members, contributors, and leaders pledge to make participation in our
6+
community a harassment-free experience for everyone, regardless of age, body
7+
size, visible or invisible disability, ethnicity, sex characteristics, gender
8+
identity and expression, level of experience, education, socio-economic status,
9+
nationality, personal appearance, race, religion, or sexual identity
10+
and orientation.
11+
12+
We pledge to act and interact in ways that contribute to an open, welcoming,
13+
diverse, inclusive, and healthy community.
14+
15+
## Our Standards
16+
17+
Examples of behavior that contributes to a positive environment:
18+
19+
- Demonstrating empathy and kindness toward other people
20+
- Being respectful of differing opinions, viewpoints, and experiences
21+
- Giving and gracefully accepting constructive feedback
22+
- Accepting responsibility and apologizing to those affected by our mistakes
23+
- Focusing on what is best for the overall community
24+
25+
## Enforcement
26+
27+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
28+
reported to the community leaders responsible for enforcement.
29+
All complaints will be reviewed and investigated promptly and fairly.
30+
31+
## Attribution
32+
33+
This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org),
34+
version 2.0, available at
35+
https://www.contributor-covenant.org/version/2/0/code_of_conduct.html.

CONTRIBUTING.md

Lines changed: 42 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
# Contributing to numpcpp
2+
3+
Thanks for your interest in contributing!
4+
5+
## Getting Started
6+
7+
1. Fork the repository and clone it locally.
8+
2. Install dependencies: C++20 compiler, CMake >= 3.16, Eigen3 >= 3.3, pybind11.
9+
3. Build the project:
10+
11+
```bash
12+
mkdir build && cd build
13+
cmake .. -DCMAKE_BUILD_TYPE=Release
14+
make -j$(nproc)
15+
```
16+
17+
## Development Workflow
18+
19+
- Create a branch for your change.
20+
- Make your changes, following the existing code style.
21+
- Add tests in `tests/` for new functionality.
22+
- Verify the build succeeds before submitting.
23+
24+
## Pull Requests
25+
26+
- Keep PRs focused on a single change.
27+
- Reference any related issues in the PR description.
28+
- Ensure all tests pass.
29+
30+
## Code Style
31+
32+
- C++20, no compiler extensions.
33+
- Follow existing naming conventions in the codebase.
34+
- Header-only where practical for pybind11 integration.
35+
36+
## Reporting Issues
37+
38+
Use the [issue tracker](https://github.com/array2d/numpycpp/issues) and include:
39+
40+
- Steps to reproduce
41+
- Expected vs actual behavior
42+
- Compiler version, OS, and dependency versions

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2026 numpcpp contributors
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 40 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,62 @@
11
# numpcpp
22

3-
C++ pixel-level alignment of Python numpy, powered by Eigen.
3+
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
4+
[![C++20](https://img.shields.io/badge/C%2B%2B-20-blue.svg)](https://en.cppreference.com/w/cpp/20)
5+
[![CMake](https://img.shields.io/badge/CMake-%3E%3D3.16-green.svg)](https://cmake.org/)
6+
[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](CONTRIBUTING.md)
7+
8+
C++ pixel-level alignment of Python numpy, powered by [Eigen](https://eigen.tuxfamily.org/).
49

510
## Overview
611

7-
`numpycpp` provides a C++ implementation of numpy's core API (`numpy.*`, `numpy.linalg.*`, `numpy.einsum`), designed for seamless pybind11 integration. Every function mirrors Python numpy's signature and semantics.
12+
`numpycpp` provides a C++ implementation of numpy's core API (`numpy.*`, `numpy.linalg.*`, `numpy.einsum`), designed for seamless [pybind11](https://github.com/pybind/pybind11) integration. Every function mirrors Python numpy's signature and semantics — what you write in Python, you get in C++.
13+
14+
## Quick Start
815

9-
## Dependencies
16+
### Dependencies
1017

11-
- C++20
12-
- [pybind11](https://github.com/pybind/pybind11)
13-
- [Eigen3](https://eigen.tuxfamily.org/) >= 3.3
18+
- **C++20** compiler (GCC >= 11, Clang >= 14, MSVC >= 2022)
19+
- **[Eigen3](https://eigen.tuxfamily.org/)** >= 3.3
20+
- **[pybind11](https://github.com/pybind/pybind11)**
21+
- **CMake** >= 3.16
1422

15-
## Build
23+
### Build
1624

1725
```bash
1826
mkdir build && cd build
1927
cmake .. -DCMAKE_BUILD_TYPE=Release
2028
make -j$(nproc)
2129
```
2230

23-
## Usage
31+
### Usage
2432

2533
```python
2634
import numpcpp
2735
```
2836

37+
## Project Structure
38+
39+
```
40+
numpycpp/
41+
├── numpy/ # C++ source and headers
42+
│ ├── core.h/.cpp # numpy.* equivalents
43+
│ ├── linalg.h/.cpp# numpy.linalg.* equivalents
44+
│ └── einsum.h/.cpp# numpy.einsum
45+
├── tests/ # Python test suite
46+
├── CMakeLists.txt # Build configuration
47+
└── README.md
48+
```
49+
50+
## Contributing
51+
52+
Contributions are welcome! See [CONTRIBUTING.md](CONTRIBUTING.md) for development setup and guidelines.
53+
54+
Please read our [Code of Conduct](CODE_OF_CONDUCT.md) before participating.
55+
56+
## Security
57+
58+
See [SECURITY.md](SECURITY.md) for our security policy and vulnerability reporting process.
59+
2960
## License
3061

31-
MIT
62+
[MIT](LICENSE)

SECURITY.md

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# Security Policy
2+
3+
## Reporting a Vulnerability
4+
5+
If you discover a security vulnerability, please **do not** open a public issue.
6+
7+
Instead, email the maintainers directly. We will respond as quickly as possible and work with you on a fix.
8+
9+
## Supported Versions
10+
11+
| Version | Supported |
12+
| ------- | ------------------ |
13+
| 0.1.x | :white_check_mark: |
14+
15+
## Security Considerations
16+
17+
- This library performs numerical computation; it does not handle authentication, network I/O, or user data.
18+
- Report any buffer overflows, memory safety issues, or undefined behavior immediately.

0 commit comments

Comments
 (0)