This repository provides a Speckle Automate function crafted specifically for the AEC industry, demonstrating the power
of data validation using the specklepy
SDK.
Our function showcases both loose and tight coupling methodologies between check rules (conditions we validate) and actions (responses based on conditions). This balance ensures adaptability and reliability in our validation framework.
-
Use this Template: Click on "Use this template" to create a new repository with this structure.
-
Register the Function: [Describe how to register the function with Speckle.]
-
Add Dependencies: Use
$ poetry add [package_name]
to add new Python package dependencies. -
Edit Launch Variables: [Briefly describe how the
launch.json
should be edited for custom configurations.] -
Local Development: For a local dev setup, [provide steps].
-
GitHub Codespaces: Quickly set up a dev environment using GitHub Codespaces.
In the AEC domain, data validation isn't merely about ensuring data integrity. It's about comprehending the intricate relationships between data points, especially when diving into BIM (Building Information Modelling). This function demonstrates the traversal through and manipulation of this complex web of relationships while preserving the integrity of the overall data structure.
Our system's core is the dynamic relationship between check rules (conditions we validate against) and actions ( operations we conduct based on these conditions). This relationship can be:
-
Loosely Coupled: In this method, checks and actions remain modular and distinct. This flexibility allows checks to be paired with diverse actions depending on specific needs.
-
Tightly Coupled: Here, specific checks are intrinsically linked to distinct actions. This ensures a predictable validation trajectory.
Our function manifests both methods. While the ParameterRules
class provides modular checks, the subclasses
of ParameterAction
, such as PrefixRemovalAction
, embrace the tight coupling principle, offering specific responses
to set conditions.
The traversal methodology found in both the speckle-sharp and specklepy SDKs, which we refer to as the TraversalRule
pattern, is integral to our validation process. Its utility is manifold:
-
Preserve Hierarchical Relationships: BIM data is all about hierarchy - a door hosted by a wall, situated in a room, and so on. Using the traversal methodology, while elements can be changed, their relationships with other elements stay intact.
-
In-place Data Mutation: Rather than spawning entirely new data structures, the traversal method champions in-place data mutation. This approach is not only efficient but also minimizes data loss risks.
-
Maintain Original Constructs: This becomes pivotal when examining elements like family instances in Revit. A single alteration can ripple through the data. The traversal methodology ensures that while data undergoes validation or changes, original structural relationships are upheld.
In the AEC landscape, data validation transcends data integrity; it's about safeguarding relationships and data hierarchies. With a robust blend of check rules, actions, and the traversal methodology, our function stands as a testament to handling intricate AEC data with finesse, balancing both data accuracy and structural authenticity.
-
Create a New Speckle Automation: Navigate to the Speckle dashboard.
-
Select the Speckle Project & Model: Choose the relevant project and model.
-
Select the Function: Opt for the function named "Data Validation in AEC."
-
Configure & Create: Adjust settings as needed and click "Create Automation."
-
Fork & Clone: Fork this repository and clone it or use GitHub CodeSpaces.
-
Function Registration: After registration, save the Function Publish Token and ID as GitHub Action Secrets.
-
Edit: Make modifications in
main.py
. -
Automatic Versioning: Every commit to the main branch auto-creates a new version.
-
Requirements: Install Python 3 and Poetry. Run
poetry shell && poetry install
for required packages. -
Building & Testing: Test locally using
poetry run pytest
. Also, package the code as a Docker Container Image for Speckle Automate.
- SpecklePy: Dive deeper into
SpecklePy
and harness the power of Speckle from Python.