Files
speckle-automate-checker/hooks
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
..
2025-02-17 23:50:34 +00:00