First off, thank you for considering contributing to MathCore! It's people like you that make MathCore such a great tool.
This project and everyone participating in it is governed by our Code of Conduct. By participating, you are expected to uphold this code.
Before creating bug reports, please check existing issues as you might find out that you don't need to create one. When you are creating a bug report, please include as many details as possible using the issue template.
Great Bug Reports tend to have:
- A quick summary and/or background
- Steps to reproduce
- What you expected would happen
- What actually happens
- Notes (possibly including why you think this might be happening)
Enhancement suggestions are tracked as GitHub issues. When creating an enhancement suggestion, please include:
- Use a clear and descriptive title
- Provide a step-by-step description of the suggested enhancement
- Provide specific examples to demonstrate the steps
- Describe the current behavior and explain which behavior you expected to see instead
- Explain why this enhancement would be useful
Unsure where to begin contributing? You can start by looking through these issues:
good first issue- issues which should only require a few lines of codehelp wanted- issues which should be a bit more involved than beginner issues
- Fork the repo and create your branch from
main - If you've added code that should be tested, add tests
- If you've changed APIs, update the documentation
- Ensure the test suite passes (
cargo test) - Make sure your code follows the style guidelines (
cargo fmtandcargo clippy) - Issue that pull request!
# Clone your fork
git clone https://github.com/YOUR_USERNAME/mathcore.git
cd mathcore
# Add upstream remote
git remote add upstream https://github.com/Nonanti/mathcore.git
# Install Rust (if not already installed)
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
# Build the project
cargo build
# Run tests
cargo test
# Run benchmarks
cargo bench- Use
cargo fmtto format your code - Use
cargo clippyto catch common mistakes - Follow Rust naming conventions:
- Types:
PascalCase - Functions/methods:
snake_case - Constants:
SCREAMING_SNAKE_CASE - Modules:
snake_case
- Types:
- Write unit tests for new functionality
- Ensure all tests pass before submitting PR
- Add integration tests for complex features
- Include doc tests in your documentation
Example test:
#[cfg(test)]
mod tests {
use super::*;
#[test]
fn test_new_feature() {
// Test implementation
assert_eq!(2 + 2, 4);
}
}- Add documentation comments to all public items
- Include examples in documentation
- Update README.md if adding major features
- Update CHANGELOG.md following the Keep a Changelog format
Example documentation:
/// Computes the factorial of a number.
///
/// # Examples
///
/// ```
/// use mathcore::factorial;
///
/// assert_eq!(factorial(5), 120);
/// ```
pub fn factorial(n: u32) -> u32 {
// Implementation
}- Use the present tense ("Add feature" not "Added feature")
- Use the imperative mood ("Move cursor to..." not "Moves cursor to...")
- Limit the first line to 72 characters or less
- Reference issues and pull requests liberally after the first line
Format:
<type>(<scope>): <subject>
<body>
<footer>
Types:
feat: A new featurefix: A bug fixdocs: Documentation only changesstyle: Changes that don't affect the code meaningrefactor: Code change that neither fixes a bug nor adds a featureperf: Code change that improves performancetest: Adding missing testschore: Changes to the build process or auxiliary tools
- Benchmark performance-critical code
- Avoid unnecessary allocations
- Use iterators when possible
- Consider using
&strinstead ofStringfor function parameters - Profile your code if adding complex algorithms
mathcore/
├── src/
│ ├── lib.rs # Library root
│ ├── types/ # Core types and structures
│ ├── parser/ # Expression parser
│ ├── engine/ # Evaluation engine
│ ├── calculus/ # Calculus operations
│ ├── solver/ # Equation solvers
│ ├── matrix/ # Matrix operations
│ ├── precision/ # Arbitrary precision
│ ├── ml/ # Optimization algorithms
│ └── differential/ # ODE/PDE solvers
├── tests/ # Integration tests
├── benches/ # Benchmarks
├── examples/ # Example usage
└── docs/ # Additional documentation
- Check the documentation
- Search existing issues
- Ask in discussions
- Contact maintainers
Contributors will be recognized in:
- CONTRIBUTORS.md file
- Release notes
- Project documentation
Thank you for contributing!