Thank you for considering contributing to ActiveLearning4RA! We welcome contributions from the community.
If you find a bug, please open an issue with:
- A clear, descriptive title
- Steps to reproduce the issue
- Expected vs. actual behavior
- Your environment (Python version, OS, etc.)
- Minimal code example that demonstrates the problem
We welcome feature requests! Please open an issue with:
- Clear description of the proposed feature
- Use case / motivation
- Possible implementation approach (if you have ideas)
-
Fork the repository and create a new branch from
main -
Set up development environment:
git clone https://github.com/yourusername/ActiveLearning4RA.git cd ActiveLearning4RA pip install -e ".[dev]"
-
Make your changes:
- Follow the existing code style
- Add docstrings for all public functions
- Include type hints
- Add comments for complex logic
-
Test your changes:
# Run existing examples cd examples/component python main.py # If adding new features, add tests pytest tests/
-
Commit your changes:
git add . git commit -m "Add feature: description of your changes"
-
Push to your fork:
git push origin your-branch-name
-
Open a Pull Request:
- Provide a clear description of your changes
- Reference any related issues
- Ensure all CI checks pass
- Follow PEP 8
- Use 4 spaces for indentation
- Maximum line length: 100 characters (flexible for readability)
- Use meaningful variable names
def my_function(arg1: torch.Tensor, arg2: float) -> torch.Tensor:
"""
Brief description of what the function does.
Longer description if needed, explaining the algorithm,
mathematical formulas, or important implementation details.
Parameters:
arg1: Description of arg1, including shape if tensor (e.g., [N, D])
arg2: Description of arg2
Returns:
Description of return value, including shape if tensor
Example:
>>> x = torch.randn(10, 2)
>>> result = my_function(x, 1.0)
"""
# Implementation
passAlways use type hints for function signatures:
from typing import List, Tuple, Optional
import torch
def process_data(
samples: torch.Tensor,
threshold: float = 0.0
) -> Tuple[torch.Tensor, int]:
"""Process data and return results."""
# ...
return processed_samples, countWe especially welcome contributions in these areas:
- New learning functions (e.g., REIF, EGRA)
- Adaptive batch sizing
- Multi-fidelity methods
- Time-dependent reliability
- GPU parallelization for large MCS pools
- Sparse GP methods for scalability
- Faster DPP sampling algorithms
- Interactive 3D plots for 3D problems
- Animation of sampling process
- Dashboard for real-time monitoring
- Unit tests for core functions
- Integration tests for full workflows
- Benchmark suite for performance tracking
- Tutorial notebooks
- Video tutorials
- API documentation improvements
- Additional examples
- More DOE methods (Sobol, Halton, etc.)
- Sensitivity analysis tools
- Result export/import utilities
- Configuration file support (YAML/JSON)
feature/description- New featuresfix/description- Bug fixesdocs/description- Documentation updatesrefactor/description- Code refactoring
Use clear, descriptive commit messages:
Add batch DPP sampling for AK-MCS
- Implement greedy DPP-MAP algorithm
- Add ARD-based distance weighting
- Include tests for 2D and 10D cases
- Update documentation
Closes #42
If you're adding new features:
- Add unit tests in
tests/directory - Add integration tests if the feature affects multiple modules
- Test edge cases: empty inputs, extreme values, etc.
- Verify numerical stability with different random seeds
Example test structure:
import pytest
import torch
from ActiveLearning4RA.core.component import AK_MCS
def test_ak_mcs_basic():
"""Test basic AK-MCS functionality"""
# Setup
def simple_func(x):
return x[:, 0] + x[:, 1] - 2
# Run test
# ...
# Assertions
assert model is not None
assert len(pf_path) > 0
def test_ak_mcs_convergence():
"""Test convergence behavior"""
# ...All pull requests will be reviewed by maintainers. We look for:
- Correctness: Does the code work as intended?
- Quality: Is the code readable and maintainable?
- Testing: Are there adequate tests?
- Documentation: Are docstrings and comments clear?
- Style: Does it follow the project conventions?
Please be patient - we'll do our best to review PRs in a timely manner.
If you have questions about contributing, feel free to:
- Open an issue with the "question" label
- Start a discussion in GitHub Discussions
- Email the maintainers
We are committed to providing a welcoming and inclusive environment for all contributors.
- Be respectful and considerate
- Accept constructive criticism gracefully
- Focus on what's best for the community
- Show empathy towards others
- Harassment or discriminatory language
- Personal attacks or trolling
- Publishing others' private information
- Other conduct inappropriate in a professional setting
By contributing to ActiveLearning4RA, you agree that your contributions will be licensed under the MIT License.
Thank you for contributing to ActiveLearning4RA! 🎉