A template repository for Python projects using Hydra for configuration management, featuring data analysis, visualization capabilities, and a clean project structure.
- Configuration Management: Using Hydra for flexible and hierarchical configuration
- Data Analysis: Sample data analyzer implementation with numpy
- Visualization: Matplotlib-based visualization tools with multiple plot types
- Testing: Pytest setup with coverage reporting
- Code Quality: Pre-commit hooks for code formatting and quality checks
- Clean Project Structure: Organized directory layout for scalable projects
- Hierarchical Project Structure: Organized directory for project in which you first do some simulations with main_inner.py and then collect the results and analyze them with main_outer.py. Each level has its own config files. You can also simply use the inner level and delete main_outer.py and the config_outer folder.
├── config/ # Main configuration files
│ ├── model/ # Model-specific configs
│ ├── save/ # Save settings
│ └── visualizations/ # Visualization configs
├── config_outer/ # Outer loop configuration
├── src/ # Source code
│ ├── core.py # Core functionality
│ ├── main_inner.py # Inner loop main script
│ ├── main_outer.py # Outer loop main script
│ └── visualization.py # Visualization tools
├── tests/ # Test files
└── utils/ # Utility functions
- Python ≥ 3.10
- Dependencies listed in
pyproject.toml
- Clone the repository:
git clone https://github.com/yourusername/project-name.git
cd project-name- Create and activate a virtual environment:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate- Install the package and dependencies:
pip install -e ".[dev]"- Set up pre-commit hooks:
pre-commit installThe project uses Hydra for configuration management. To run the analysis:
python src/main_inner.pyThis will:
- Create necessary output directories
- Generate sample data matrices (Of course you will change this to your needs)
- Produce visualizations based on configuration
- Save results in the output directory
The project uses a hierarchical configuration system:
config/config.yaml: Main configuration fileconfig/model/model_default.yaml: Model-specific settingsconfig/save/save_default.yaml: Save settingsconfig/visualizations/visualizations.yaml: Visualization options
The project supports multiple visualization types, you can already see:
- Sample heatmaps
- Categorical distribution plots
- Binary classification maps
These plots are used in the repository related to the statistical analysis of my card game Mascarpone!
Run tests with coverage (when you will implement them):
pytestYou can share your own idea and customizations, feel free to
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
Daniele Lotito - name dot surname 1[at] gmail