44 Commits

Author SHA1 Message Date
Jonathon Broughton 38d2073dbb Refactor footgun (#57)
build and deploy Speckle functions / publish-automate-function-version (push) Has been cancelled
- Added traceback import for better error logging.
- Enhanced exception handling to include traceback details.
- Commented out non-integer rule number checks for now.
0.3.9
2025-02-21 13:21:08 +00:00
Jonathon Broughton 091a272185 Add new predicates for value checks (#54)
build and deploy Speckle functions / publish-automate-function-version (push) Has been cancelled
- Removed "matches" and "not equal" predicates.
- Added "not equal to" and "does not contain" predicates.
- Introduced a method to check if a parameter value does not contain a substring.
0.3.8
2025-02-20 18:30:05 +00:00
Jonathon Broughton 0e95f3998a Update rules.py (#53)
build and deploy Speckle functions / publish-automate-function-version (push) Has been cancelled
0.3.7
2025-02-20 17:32:29 +00:00
Jonathon Broughton 05a5383060 Add 'contains' predicate method (#52)
- Introduced a new predicate for checking if a parameter value contains a substring.
- Added the corresponding method to handle the logic and error management.
2025-02-20 17:22:02 +00:00
Jonathon Broughton f3c56a48b5 Rule numbers and metdata validation (#51)
build and deploy Speckle functions / publish-automate-function-version (push) Has been cancelled
* Update Python version and clean up dependencies

- Bumped required Python version from 3.12 to 3.13.
- Removed the lock file for dependency management.
- Cleaned up unnecessary dependency groups in the configuration.

* Refine rule number processing and type conversion

- Updated rule number handling to preserve original identifiers.
- Improved logic for generating missing rule numbers.
- Changed duplicate handling to keep original values intact.
- Adjusted column type conversion to replace NaN with empty strings.

* Refactor message handling in rule processor

- Introduced a new function to format rule messages.
- Replaced direct access to the message with the new formatting function.
- Cleaned up metadata creation for better readability.

* Enhance metadata generation with JSON validation

- Added JSON serialisability check for generated metadata
- Included error handling to log issues during creation
- Updated docstring to clarify function purpose and arguments
0.3.6
2025-02-20 15:41:33 +00:00
Jonathon Broughton a704aded80 Refactor parameter value checks to use float conversion (#49)
build and deploy Speckle functions / publish-automate-function-version (push) Has been cancelled
- Updated methods to convert parameter values to float.
- Removed type checks and exceptions for non-numeric types.
- Simplified return logic for invalid conversions.
0.3.5
2025-02-20 12:23:43 +00:00
Jonathon Broughton 90c5051fc6 Update test_user_entry.py (#44) 2025-02-18 20:37:06 +00:00
Jonathon Broughton ec6bdf3485 Update requirements.txt (#43)
build and deploy Speckle functions / publish-automate-function-version (push) Has been cancelled
0.3.4
2025-02-18 19:15:21 +00:00
Jonathon Broughton ceaa75d40a Update requirements.txt (#41) 2025-02-18 19:12:26 +00:00
renovate[bot] 0566f7d890 Update python Docker tag to v3.13 (#38)
build and deploy Speckle functions / publish-automate-function-version (push) Has been cancelled
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
0.3.3
2025-02-18 19:09:55 +00:00
Jonathon Broughton b431662031 Update rule_processor.py (#39) 2025-02-18 19:08:25 +00:00
renovate[bot] e520d9bc91 Update python Docker tag to v3.13 (#37)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-02-18 18:59:18 +00:00
renovate[bot] b6dcfe57df Update dependency httpx to v0.28.1 (#26)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-02-18 18:58:52 +00:00
renovate[bot] ba8443ce92 Update dependency pydantic-core to v2.29.0 (#27)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-02-18 18:58:36 +00:00
renovate[bot] 0bab18d2f2 Update python Docker tag to v3.13 (#28)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-02-18 18:58:21 +00:00
renovate[bot] dffb7ea7ba Update dependency attrs to v25 (#29)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-02-18 18:57:59 +00:00
renovate[bot] 4420fd31f4 Update dependency websockets to v15 (#30)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-02-18 18:57:42 +00:00
Jonathon Broughton 168a1f517a Robust rule validation and UX (#36)
build and deploy Speckle functions / publish-automate-function-version (push) Has been cancelled
* Add minimum severity and hide skipped options

- Introduced `minimum_severity` to filter reported results.
- Added `hide_skipped` option to control visibility of skipped tests.
- Updated rule application logic to respect new parameters.

* Improve rule processing and validation

- Enhanced rule reading to group rules and handle validation messages.
- Added functions to process and validate rule numbers in the spreadsheet.
- Improved error handling when reading TSV files.

* Improve docstrings and clean up code

- Added docstring for `PropertyMatchMode` enum.
- Removed unnecessary blank lines in `FunctionInputs`.
- Commented out unused `property_match_mode` field with explanation.

* Improve rule validation logic

Added a new function to validate the structure of rule groups. Key updates include:
- Checks for required columns and conditions.
- Ensures rules start with "WHERE" and have at most one "CHECK".
- Validates that "CHECK" is the last condition if present.
- Raises descriptive errors for invalid structures.

* Refactor rule processing logic

- Added a new function to separate filters and final checks.
- Simplified condition evaluation by using the new function.
- Improved handling of empty rule groups and speckle objects.
- Enhanced clarity in filtering logic for better maintainability.

* Refactor number conversion logic in comparison

- Updated boolean comparison method call for clarity.
- Introduced a helper function to safely convert strings to numbers, handling whitespace and negative values.
- Simplified the type-checking process for string-to-float conversion.

* Update comparison logic in parameter checks

Flipped the comparison logic to match user expectations for parameter value checks. Updated docstrings for better clarity on UX perspective. Added error handling for non-numeric values to improve robustness.

* Refactor method names for clarity

Updated method names to remove leading underscores for better readability and consistency. Added a docstring to describe the purpose of the rules module.

* Add tests for comparison and rule processing

- Introduced a new test suite for value comparisons, covering numeric strings, boolean strings, case sensitivity in string comparisons, and float comparison with tolerance.
- Created a test suite for parameter handling functionality to validate the existence and retrieval of parameters in v2 and v3 objects.
- Added tests for rule processing functionality using both explicit CHECK format and legacy format rules.
0.3.2
2025-02-18 18:56:02 +00:00
Jonathon Broughton e49bf225ec Update main.yml (#35) 2025-02-18 09:23:57 +00:00
Jonathon Broughton f3987fced9 Update main.yml (#34) 2025-02-18 08:21:30 +00:00
Jonathon Broughton 1ae3372f42 Update main.yml (#33)
* Update main.yml

* Update Dockerfile
2025-02-18 08:07:09 +00:00
Jonathon Broughton b071380a4f Update main.yml (#32) 2025-02-18 00:07:30 +00:00
Jonathon Broughton 460b21772a Update Dockerfile (#31)
build and deploy Speckle functions / publish-automate-function-version (push) Has been cancelled
0.3.1
2025-02-17 23:57:56 +00:00
renovate[bot] bb40f185b5 Update dependency numpy to v2.2.3 (#24)
build and deploy Speckle functions / publish-automate-function-version (push) Has been cancelled
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
0.3.0
2025-02-17 23:52:05 +00:00
renovate[bot] ee12143504 Update dependency specklepy to v2.21.3 (#25)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-02-17 23:51:50 +00:00
Jonathon Broughton 8582444e56 Add V3 compatibility (#23)
* Update project configuration and name

- Excluded virtual environment folder from module content.
- Changed JDK name to "WSL Checker" for clarity.
- Updated project name in the configuration file.

* Update project configuration and dependencies

- Added source folders for `src` and `tests`.
- Excluded `.devcontainer` and `.idea` directories.
- Updated Black settings in the project configuration.
- Changed Ruff version from 0.9.5 to 0.9.6.
- Enhanced rule processing by grouping rules before application.
- Introduced a new property match mode for better parameter matching.
- Removed unused test files and configurations to clean up the codebase.

* Shifting to local uv - editing toml

* Update CI workflow and project dependencies

- Added steps to the CI workflow for better clarity.
- Switched from Poetry to pip for dependency management.
- Removed poetry.lock file as it's no longer needed.
- Updated Python version specification to 3.12.
- Adjusted project configuration files for new environment settings.

* Update dependencies for pydantic and related packages

- Added pydantic version 2.11.0a2 to dependencies.
- Updated pydantic-core to version 2.29.0.
- Adjusted URLs and hashes for the new package versions in lock file.
- Ensured compatibility with existing requirements in project configuration.

* Update dependencies to stable versions

- Downgraded Pydantic from 2.11.0a2 to 2.10.6
- Updated Pydantic-core version from 2.29.0 to 2.27.2
- Adjusted URLs and hashes for the new package versions in lock file

* Update dependencies to latest versions

- Upgraded Pydantic from 2.10.6 to 2.11.0a2
- Updated Pydantic Core from 2.27.2 to 2.29.0
- Adjusted source URLs and hashes for new package versions

* Update dependencies to stable versions

- Downgraded Pydantic from 2.11.0a2 to 2.10.6
- Updated Pydantic-core version from 2.29.0 to 2.27.2
- Adjusted URLs and hashes for the new package versions in lock file

* Add pre-commit hook and setup script

- Introduced a pre-commit hook to manage dependencies.
- Automatically installs and exports requirements before commits.
- Added a setup script to copy the hook and set permissions.

* Update project config and clean up unused files

- Removed Black configuration options from the project settings.
- Changed Ruff to run on save instead of reformat.
- Deleted example function inputs JSON file.
- Removed flatten helper module as it's no longer needed.
- Updated pyproject.toml with new line length and ignore rules.
- Cleaned up import statements in local test file.

* Update line length and tidy up code comments

- Increased the maximum line length from 100 to 120.
- Cleaned up import statements for better readability.
- Improved docstrings for clarity and consistency.
- Removed unnecessary blank lines and commented-out code.

* Refactor rules handling and improve documentation

- Updated class names from `RevitRules` to `PropertyRules`.
- Adjusted method calls to reflect the new class structure.
- Cleaned up code formatting for better readability.
- Enhanced developer README with clearer setup instructions.

* Add filtering and rule processing features

- Introduced a new filter function to sort objects by category.
- Created a predicates module for mapping spreadsheet predicates to rule methods.
- Refactored rules handling, simplifying parameter checks and value retrievals.
- Enhanced the main automation function with improved input handling and context management.

* Past WIP rules for processing Speckle parameters

- Introduced a new class to manage parameter rules.
- Added methods to check and retrieve display values from Speckle objects.
- Implemented filtering for displayable objects based on defined criteria.
- Created functions to handle Revit parameter checks and value retrievals.
- Included various utility methods for comparing parameter values against thresholds, ranges, and lists.

* Add new JSON test data for building elements

- Introduced a new JSON file containing detailed specifications for various building elements.
- Included parameters such as ID, type, level details, and multiple attributes related to structural components.
- Added information on dimensions, materials, and classifications relevant to the construction context.

* Rename test files and add new parameter tests

- Renamed localtest.py to test_function.py for clarity.
- Added a new test file for parameter checks, covering:
  - Object deserialization structure
  - Parameter existence and value retrieval in v2 and v3 objects
  - Numeric comparisons and pattern matching on parameters
  - List-based and boolean parameter checks

* Enhance helper functions and add rule processing

- Updated helper functions for better item retrieval and checks.
- Added new functions to evaluate conditions and process rules against Speckle objects.
- Improved logging with a dedicated print function.
- Streamlined flattening logic in existing methods.

* Add test runner config and new web resources

- Added pytest as the project test runner.
- Created a new XML file for web resource paths.
- Included pytest-assertcount in development dependencies.

* Add robust value comparison methods

- Introduced new static methods for comparing values:
  - `is_equal_value`: Compares two values with type handling and optional case sensitivity.
  - `is_not_equal_value`: Checks if two values are not equal.
  - `is_identical_value`: Verifies if two values are exactly identical, considering case sensitivity and no tolerance for floats.
  - `is_not_identical_value`: Checks if two values are not identical.
- Enhanced handling of strings that represent numbers.

* Refactor rules and parameter handling

- Commented out large sections of code for clarity

* Update predicates and enhance tests

- Renamed equality-related methods for clarity.
- Added new methods for "not equal" and "not identical" checks.
- Updated test to return specific objects instead of walls.
- Changed property access in tests to use `.keys()`.
- Introduced multiple tests for stringified number comparisons, case sensitivity, and floating-point precision.

* Add tests for severity level conversion

Created a new test file to validate the `get_severity` function.
- Added parameterised tests for various input cases including valid and invalid severity strings, empty inputs, and non-string types.
- Ensured that all edge cases default to the correct enum value.

* Refactor parameter tests for clarity and efficiency

- Simplified assertions in parameter existence tests.
- Added parameterisation to reduce redundancy across tests.
- Enhanced error messages for better debugging.
- Consolidated similar test cases for v2 and v3 objects.
- Improved structure of boolean and numeric comparison tests.

* Enhance spreadsheet data handling

- Added a function to convert mixed column types.
- Updated the main reading function to use this new conversion.
- Improved error handling for reading TSV files.

* Update version handling in automation function

- Added a global VERSION variable for tracking.
- Updated comments to reflect changes from 'version' to 'VERSION'.
- Adjusted logic to retrieve the version from the root object.
- Enhanced success message to include the current version.

* Improve boolean handling and property search

- Added None handling in boolean conversion.
- Enhanced `find_property` to return raw values if needed.
- Updated traversal logic to avoid revisiting objects.
- Refined comparison methods for better type handling and tolerance.
- Introduced new methods for strict value comparisons with detailed arguments.

* Update predicate method mappings

Switched from string references to actual method names in the predicate mapping. This improves clarity and reduces errors by directly linking predicates to their corresponding methods in PropertyRules. Adjusted some predicate phrases for consistency as well.

* Enhance rule evaluation with severity handling

- Added optional parameters for rule and case numbers in condition evaluation.
- Introduced an Enum for severity levels to standardise reporting.
- Created a function to convert string severities into the SeverityLevel enum, handling various input formats.
- Refactored metadata generation to use the new severity function.
2025-02-17 23:50:34 +00:00
Jonathon Broughton f2e06f165e Update Result Annotations (#20)
build and deploy Speckle functions / publish-automate-function-version (push) Has been cancelled
* 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.

* Update import paths for consistency

- Changed relative imports to absolute imports for clarity.
- Ensured all module references are consistent across files.

* Update package versions and add new dependencies

Bumped several package versions to their latest releases:
- Updated `anyio` to 4.8.0
- Updated `certifi` to 2025.1.31
- Updated `charset-normalizer` to 3.4.1
- Updated `click` to 8.1.8
- Updated `deprecated` to 1.2.18
- Updated `graphql-core` to 3.2.6

Added a new dependency:
- Introduced `levenshtein` version 0.26.1.

Removed some unnecessary extras from the dev dependencies for cleaner management.

* Add Ruff configuration file

Set up a new configuration for Ruff with options to run on save and use the server.

* Refactor rules processing for Data Analysis

- Enhanced the metadata structure in the results attachment function for better data analysis.
- Improved logic handling in result attachment based on rule pass/fail status.
0.2.0
2025-02-07 19:22:14 +00:00
Jonathon Broughton ced25f38dd dependencies (#19)
build and deploy Speckle functions / publish-automate-function-version (push) Has been cancelled
* 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.

* Update import paths for consistency

- Changed relative imports to absolute imports for clarity.
- Ensured all module references are consistent across files.

* Update package versions and add new dependencies

Bumped several package versions to their latest releases:
- Updated `anyio` to 4.8.0
- Updated `certifi` to 2025.1.31
- Updated `charset-normalizer` to 3.4.1
- Updated `click` to 8.1.8
- Updated `deprecated` to 1.2.18
- Updated `graphql-core` to 3.2.6

Added a new dependency:
- Introduced `levenshtein` version 0.26.1.

Removed some unnecessary extras from the dev dependencies for cleaner management.
0.1.9
2025-02-06 21:54:13 +00:00
Jonathon Broughton 2ef5ee8146 Imports (#18)
* 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.

* Update import paths for consistency

- Changed relative imports to absolute imports for clarity.
- Ensured all module references are consistent across files.
2025-02-06 21:42:32 +00:00
renovate[bot] e930ea9763 Update dependency ruff to v0.9.5 (#16)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-02-06 21:37:56 +00:00
Jonathon Broughton b7ff0137b1 Split Readmes (#15)
* 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.
2025-02-06 21:33:18 +00:00
Jonathon Broughton a0bbb0cc30 Add project configuration and refactor logic (#14)
- 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.
2025-02-06 16:02:34 +00:00
renovate[bot] a4fe292b94 Update dependency mypy to v1.15.0 (#13)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-02-06 16:01:31 +00:00
renovate[bot] 10800ee047 Update dependency ruff to ^0.9.0 (#8)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-31 09:29:47 +01:00
renovate[bot] b9a45b2791 Update dependency pytest to v8 (#11)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-31 09:28:40 +01:00
renovate[bot] a54de2dcb6 Update python Docker tag to v3.13 (#9)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-31 09:27:52 +01:00
renovate[bot] c71a5f15b3 Update dependency black to v25 (#12)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-31 09:27:12 +01:00
renovate[bot] c25f770749 Update dependency pydantic-settings to v2.7.1 (#7)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-31 09:26:58 +01:00
renovate[bot] 0502af40a1 Update dependency mypy to v1.14.1 (#5)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-24 15:53:16 +00:00
renovate[bot] b504b03b6b Update dependency specklepy to v2.21.2 (#4)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-24 15:53:02 +00:00
dependabot[bot] 5b2a31852e Bump specklesystems/speckle-automate-github-composite-action (#3)
Bumps [specklesystems/speckle-automate-github-composite-action](https://github.com/specklesystems/speckle-automate-github-composite-action) from 0.8.1 to 0.9.0.
- [Release notes](https://github.com/specklesystems/speckle-automate-github-composite-action/releases)
- [Commits](https://github.com/specklesystems/speckle-automate-github-composite-action/compare/0.8.1...0.9.0)

---
updated-dependencies:
- dependency-name: specklesystems/speckle-automate-github-composite-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-24 15:41:19 +00:00
dependabot[bot] ac0859eaff Bump actions/checkout from 4.1.7 to 4.2.2 (#2)
Bumps [actions/checkout](https://github.com/actions/checkout) from 4.1.7 to 4.2.2.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v4.1.7...v4.2.2)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-01-24 15:41:06 +00:00
renovate[bot] 49a070143a Add renovate.json (#1)
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
2025-01-24 15:40:51 +00:00
Jonathon Broughton b910180773 Initial commit 2025-01-24 15:39:21 +00:00