Compare commits

..

28 Commits

Author SHA1 Message Date
Jonathon Broughton f9330d3112 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:43:43 +00:00
Jonathon Broughton 6d94a6c7e7 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.
2025-02-17 23:43:18 +00:00
Jonathon Broughton 5c48535177 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.
2025-02-17 23:42:58 +00:00
Jonathon Broughton d0c1ea7065 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.
2025-02-17 23:42:15 +00:00
Jonathon Broughton 897850197f 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.
2025-02-17 23:41:55 +00:00
Jonathon Broughton c92a751516 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.
2025-02-17 23:41:38 +00:00
Jonathon Broughton 3349a4c1b3 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.
2025-02-17 23:41:09 +00:00
Jonathon Broughton a81f7b14bc 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.
2025-02-11 09:56:15 +00:00
Jonathon Broughton 1b676ef6e0 Refactor rules and parameter handling
- Commented out large sections of code for clarity
2025-02-11 09:56:04 +00:00
Jonathon Broughton 37f6f4ba2e 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.
2025-02-11 09:55:51 +00:00
Jonathon Broughton bcc123cca4 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.
2025-02-11 04:32:50 +00:00
Jonathon Broughton 2a961ca6f3 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.
2025-02-11 04:32:18 +00:00
Jonathon Broughton 3f2ecb112f 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
2025-02-11 04:32:02 +00:00
Jonathon Broughton 37b3eddfd7 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.
2025-02-11 04:31:47 +00:00
Jonathon Broughton b6baa6b5ba 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.
2025-02-11 04:31:16 +00:00
Jonathon Broughton 88b5b1a3e6 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.
2025-02-11 04:30:52 +00:00
Jonathon Broughton 3717a8be45 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.
2025-02-10 19:03:31 +00:00
Jonathon Broughton b5e0f6f578 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.
2025-02-10 19:00:18 +00:00
Jonathon Broughton 20e8fc6fa3 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.
2025-02-10 18:54:34 +00:00
Jonathon Broughton e4016de01f 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.
2025-02-10 18:13:32 +00:00
Jonathon Broughton 637b7700d7 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
2025-02-10 18:01:50 +00:00
Jonathon Broughton 979615221a 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
2025-02-10 18:00:23 +00:00
Jonathon Broughton 654af4cfb2 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
2025-02-10 17:56:52 +00:00
Jonathon Broughton eefc9f8fe7 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.
2025-02-10 17:51:44 +00:00
Jonathon Broughton 44ac41363b 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.
2025-02-10 17:50:19 +00:00
Jonathon Broughton fe2437d110 Shifting to local uv - editing toml 2025-02-10 17:28:29 +00:00
Jonathon Broughton a0b92bd115 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.
2025-02-10 16:30:00 +00:00
Jonathon Broughton ccabdcb0a2 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.
2025-02-10 12:04:50 +00:00
2 changed files with 3 additions and 3 deletions
+1 -1
View File
@@ -1 +1 @@
3.13
3.12
+2 -2
View File
@@ -21,7 +21,7 @@ more-itertools==10.6.0
multidict==6.1.0
mypy==1.15.0
mypy-extensions==1.0.0
numpy==2.2.3
numpy==2.2.2
packaging==24.2
pandas==2.2.3
pathspec==0.12.1
@@ -43,7 +43,7 @@ requests-toolbelt==1.0.0
ruff==0.9.6
six==1.17.0
sniffio==1.3.1
specklepy==2.21.3
specklepy==2.21.2
stringcase==1.2.0
typing-extensions==4.12.2
tzdata==2025.1