b7ff0137b1
* Add project configuration and refactor logic - Created .gitignore to exclude IDE files. - Added project module configuration for Python. - Set up inspection profiles for code quality checks. - Refactored main function logic into separate modules for better organisation. - Introduced helper functions for object manipulation and rule processing. - Implemented spreadsheet reading functionality to dynamically load rules. - Added tests for integration with the Speckle server. * Add developer guide - Introduced a new developer README with setup, project structure, testing, and deployment instructions. - Revised the primary README to reflect changes in functionality and usage instructions for the Checker function.
994 B
994 B
Checker Function Development Guide
Setup
- Install dependencies:
poetry shell && poetry install
- Configure
.env:
SPECKLE_TOKEN=your_speckle_token
SPECKLE_SERVER_URL=app.speckle.systems
Get test automation details from app.speckle.systems
Project Structure
function.py: Main business logicrules.py: Rule definitions and processinginputs.py: Function input schemahelpers.py: Utility functionsspreadsheet.py: TSV handling
Testing
poetry run pytest
Extending Rules
- Add new predicate to
input_predicate_mappinginrules.py - Create corresponding method in
RevitRulesclass - Update tests
Building
The function is packaged as a Docker container:
docker build -f ./Dockerfile -t checker .
Local Testing
docker run --rm checker python -u main.py run [automation_data] [parameters] [token]
Deployment
Create a GitHub release to trigger deployment to Speckle Automate.