This guide provides comprehensive information for developers working on CAsMan.
git clone https://github.com/Coherent-All-Sky-Monitor/CAsMan.git
cd CAsMan
pip install -e .
pip install -r requirements-dev.txt
python -m pytest
CAsMan follows a modular architecture with clear separation of concerns:
casman/
├── __init__.py # Main package exports
├── assembly/ # Assembly management (modularized package)
│ ├── __init__.py # Assembly package exports
│ ├── connections.py # Recording assembly connections
│ ├── data.py # Data retrieval and statistics
│ ├── chains.py # Connection chain analysis
│ └── interactive.py # Interactive assembly operations
├── cli/ # Command-line interface (modularized package)
│ ├── __init__.py # CLI package exports
│ ├── main.py # Main CLI entry point
│ ├── parts_commands.py # Parts management commands
│ ├── assembly_commands.py # Assembly commands
│ ├── barcode_commands.py # Barcode generation commands
│ ├── visualization_commands.py # Visualization commands
│ └── utils.py # CLI utility functions
├── parts/ # Parts management (modularized package)
│ ├── __init__.py # Parts package exports
│ ├── part.py # Part class and validation
│ ├── part_number.py # Part number management
│ └── validation.py # Part validation logic
├── barcode_utils.py # Barcode generation and printing
├── config.py # Configuration management
├── database.py # Database operations
└── visualization.py # ASCII visualization
git checkout -b feature/your-feature-name
# Add tests to appropriate test_*.py file
python -m pytest tests/test_your_module.py -v
python -m pytest
python docs/generate_docs.py
When modularizing large modules:
__init__.py
__init__.py
# Run all tests
python -m pytest
# Run specific test file
python -m pytest tests/test_assembly.py -v
# Run with coverage
python -m pytest --cov=casman
# Run specific test
python -m pytest tests/test_assembly.py::TestAssembly::test_record_connection -v
CAsMan uses SQLite databases with the following structure:
parts.db
)assembled_casm.db
)from casman.database import get_database_path, init_parts_db, init_assembled_db
# Initialize databases
init_parts_db("/path/to/db/dir")
init_assembled_db("/path/to/db/dir")
# Get database paths
parts_db = get_database_path("parts.db", "/path/to/db/dir")
Documentation is automatically generated from source code:
python docs/generate_docs.py
python -m pytest
python docs/generate_docs.py
Update version in setup.py
Create and merge pull request
git tag v1.x.x
git push origin v1.x.x
*_commands.py
filecli/main.py
tests/test_cli.py
parts/validation.py
__init__.py
exports and Python pathRun with debug logging:
CASMAN_DEBUG=1 python -m casman.cli --help
For questions or issues, please open a GitHub issue or contact the development team.