chore/update-solver-submodule
10 Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
944188790d | CI: abandon PySide6 pip approach, try KDE Neon repos | ||
|
|
d3629472d6 | CI: upgrade Ubuntu native build to 24.04 | ||
|
|
d55d8d1dac |
BIM: Report command MVP (#24078)
* BIM: BIM Report MVP
* BIM: add Arch.selectObjects() API call and tests
* BIM: adopted ArchSchedule spreadsheet update and linking patterns
* BIM: SELECT with dynamic headers and dynamic data population
* BIM: fix deletion, dependencies, and serialization issues
* BIM: transition from individual query to multiple-query statements
* BIM: Mostly fix serialization issues
* BIM: Report editor UI/UX improvements
- Make edits directly on table (Description field only, for now)
- Sync table edits with query editor (Description field only, for now)
- Fix Property group name for spreadsheet object
- Add tooltips for all task panel widgets
- Put Description input and label on the same row
- Edit statement is now a static title
- Open report editor upon creation
- Remove overview table's redundant edit button
- Put report query options in a box
- Open spreadsheet after accepting report changes
* BIM: Aggregarion and grouping - implement GROUP BY with COUNT(*)
* BIM: Aggregation and grouping - implement SUM, MIN, MAX functions
* BIM: Aggregation and grouping - implement validation
* BIM: add reporting presets support
* BIM: align description and query preset inputs vertically
* BIM: write units on their own spreadsheet cell
* BIM: update test suite to new SQL engine behaviour
* BIM: fix various bugs: return values should not be stringized, non-grouped query with mixed extractors, handle nested properties
* BIM: expand Report test suite, fix property count vs count all bug
* BIM: add report engine SQL's IN clause support
* BIM: enable running Report presets tests from the build directory
* BIM: make spreadsheet more useful for analysis, units on headers
* BIM: update BIM Report icons
* BIM: Add key option columns to report overview table
* BIM: add syntax highlighting support to report query editor
* BIM: Add lark build dependency for SQL parser generator
* BIM: Install the generated parser
* BIM: implement TYPE() function
* BIM: simplify function registry, make it OOP
* BIM: add CHILDREN function
* BIM: improve SQL engine error descriptions
* BIM: Implement ORDER BY clause
* BIM: Implement column aliasing (AS...)
* BIM: improve error reporting to pinpoint exact token names
* BIM: implement CONCAT, LOWER, UPPER functions. Improve exception handling
* BIM: refactor to improve initialization readability and maintenance
* BIM: Improve query editor syntax highlighting
* BIM: Address CodeQL warnings
* BIM: Enable scalar functions in WHERE clause and refactor transformer
- Enable the use of scalar functions (e.g., `LOWER`, `TYPE`) in `WHERE` clause comparisons.
- Refactor the Lark transformer to correctly handle `NUMBER`, `NULL`, and `ASTERISK` terminals using dedicated methods.
- Refactor error handling to raise a custom `BimSqlSyntaxError` exception instead of returning values on failure.
- Improve syntax error messages to be more specific and user-friendly by inspecting the failing token.
- Fix regressions in `AggregateFunction` and `TypeFunction` handling that were introduced during the refactoring.
- Update the test suite to assert for specific exceptions, aligning with the new error handling API.
* BIM: Implement arithmetic operations in SELECT clause
- Update grammar with `expr`, `term`, and `factor` rules to support operator precedence.
- Introduce `ArithmeticOperation` class to represent calculations as a recursive tree.
- Add transformer methods to build the calculation tree from the grammar rules.
- Implement recursive evaluation that correctly normalizes `Quantity` and `float` types before calculation.
* BIM: Add CONVERT() function for unit conversions
- Implement a new ConvertFunction class to handle unit conversions in the SELECT clause.
- Leverage the core Quantity.getValueAs() FreeCAD API method to perform the conversion logic.
- Add a unit test to verify both successful conversions and graceful failure on incompatible units.
* BIM: add self-documenting supported SQL syntax helper
* BIM: document internal and external API functions
* BIM: Finalize and rename public ArchSql API, update all consumers
- Rename public API functions for clarity and consistency
(run_query_for_objects -> select, get_sql_keywords -> getSqlKeywords,
etc.).
- Establish Arch.py as the official API facade by exposing all public
SQL functions and exceptions via a safe wildcard import from ArchSql,
governed by __all__.
- Refactor all consumers (ArchReport.py, bimtests/TestArchReport.py) to
use the new function names and access the API exclusively through the
Arch facade (e.g., Arch.select).
- Finalize the error handling architecture:
- Arch.select now logs and re-raises exceptions for consumers to
handle.
- Arch.count remains "safe," catching exceptions and returning an
error tuple for the UI.
- Refactor the test suite to correctly assert the behavior of the new
"unsafe" (select) and "safe" (count) APIs, including verifying
specific exception messages.
* BIM: add results preview on demand on the query editor
* BIM: add documentation quick reference button
* BIM: Handle query errors gracefully in Report preview UI
Refactor the SQL engine's error handling to improve the Report preview
UI. Invalid queries from the "Preview Results" button no longer print
tracebacks to the console. Instead, errors are now caught and displayed
contextually within the preview table, providing clear feedback without
console noise.
- `ArchSql.select()` no longer logs errors to the console; it now only
raises a specific exception on failure, delegating handling to the
caller.
- The `ReportTaskPanel`'s preview button handler now wraps its call to
`Arch.select()` in a `try...except` block.
- Caught exceptions are formatted and displayed in the preview table
widget.
- Add new unit test
* BIM: consolidate internal API into a more semantically and functionally meaningful function
* BIM: Implement two-phase execution for SQL engine performance
Refactors the ArchSql engine to improve performance and internal API
semantics. The `Arch.count()` function, used for UI validation, now
executes faster by avoiding unnecessary data extraction.
This is achieved by splitting query execution into two phases. The first
phase performs fast filtering and grouping (`FROM`/`WHERE`/`GROUP BY`).
The second, slower phase processes the `SELECT` columns. The
`Arch.count()` function now only runs the first phase, while
`Arch.select()` runs both.
- Introduces `_run_query(query_string, mode)` as the mode-driven
internal entry point for the SQL engine
- The `SelectStatement` class is refactored with new internal methods:
`_get_grouped_data()` (Phase 1) and `_process_select_columns()`
(Phase 2).
- `Arch.count()` now uses a fast path that includes a "sample execution"
on a single object to correctly validate the full query without
performance loss.
- The internal `execute()` method of `SelectStatement` is now a
coordinator for the two-phase process.
* BIM: Implement autocompletion in Report SQL editor
Introduces an autocompletion feature for the SQL query editor in the BIM
Report task panel. The completer suggests SQL keywords, functions, and
property names to improve query writing speed and accuracy.
- Adds a custom `SqlQueryEditor` subclass that manages all
autocompletion logic within its `keyPressEvent`.
- The completion model is populated with static SQL keywords and
functions, plus all unique top-level property names dynamically
scanned from every object in the document.
- A blocklist is used to filter out common non-queryable properties
(e.g., `Visibility`, `Proxy`) from the suggestions.
- The editor manually calculates the completer popup's width based on
content (`sizeHintForColumn`) to resolve a Qt rendering issue and
ensure suggestions are always visible.
- The first suggestion is now pre-selected, allowing a single `Tab`
press to accept the completion.
* BIM: remove unused import
* BIM: support SQL comments in queries
* BIM: support non-ASCII characters in queries
* BIM: Allow ORDER BY to accept a comma-separated list of columns for multi-level sorting.
* BIM: fix two-way overview/editor sync
* BIM: refactor to simplify editor modification events
* BIM: add tooltips to overview table
* BIM: add tooltips to query editor, enrich syntax data with signature and snippets
* BIM: implement PARENT function
* BIM: Enable property access on SQL function results
Previously, the SQL engine could only access properties directly from
the main object in a given row. This made it impossible to query
attributes of objects returned by functions, such as getting the name of
a parent with PARENT(*). This commit evolves the SQL grammar to handle
chained member access (.) with correct operator precedence. The parser's
transformer and execution logic were updated to recursively resolve
these chains, enabling more intuitive queries like SELECT
PARENT(*).Label and standard nested property access like Shape.Volume.
* BIM: refactor function registration, internationalize API metadata
* BIM: remove outdated Report alias
* BIM: refactor selectObjects to use latest API, move implementation to ArchSql
* BIM: improve friendly token names for error reporting
* BIM: implement chained functions e.g. PARENT(*).PARENT(*)
* BIM: add further tests for property access, fix bug with non-literal AS clause argument
* BIM: Implement full expression support for GROUP BY
The SQL engine's GROUP BY clause was previously limited to simple
property names, failing on queries that used functions (e.g., `GROUP BY
TYPE(*)`). This has been fixed by allowing the SQL transformer and
validator to correctly process function expressions.
The `SelectStatement.validate()` method now uses a canonical signature
to compare SELECT columns against GROUP BY expressions, ensuring
correctness for both simple properties and complex functions.
New regression tests have also been added to validate `GROUP BY`
functionality with chained functions (PPA) and multiple columns.
* BIM: Make arithmetic engine robust against missing properties
Previously, a query containing an arithmetic expression in the `WHERE`
clause would cause a fatal error if it processed an object that was
missing one of the properties used in the calculation.
This has been fixed by making the `ArithmeticOperation` class NULL-safe.
The engine now correctly handles `None` values returned by property
lookups, propagating them through the calculation as per standard SQL
behavior.
As a result, the engine no longer crashes on such queries. It now
gracefully evaluates all objects, simply filtering out those for which
the arithmetic expression cannot be resolved to a valid number. This
significantly improves the robustness of the query engine.
* BIM: Finalize ORDER BY logic and fix query regressions
- The `ORDER BY` clause is now governed by a single, predictable rule:
it can only refer to column names or aliases that exist in the final
`SELECT` list. The engine's transformer and execution logic have been
updated to enforce and correctly implement this, fixing several test
failures related to sorting by aliases and expressions.
- Updated test suite to align with the new engine rules. Add new
dedicated unit tests that explicitly document the supported (aliased
expression) and unsupported (raw expression) syntax for the `ORDER BY`
clause.
* BIM: Implement backend for pipelined report execution
Adds the backend architecture for multi-step, pipelined queries. The
core SQL engine can now execute a statement against the results of a
previous one, enabling complex sequential filtering.
- The internal `_run_query` function was refactored to be
pipeline-aware, allowing it to operate on a pre-filtered list of
source objects.
- A new `execute_pipeline` orchestrator was added to manage the data
flow between statements, controlled by a new `is_pipelined` flag in
the `ReportStatement` data model.
- The public API was extended with `selectObjectsFromPipeline` for
scripting, and `count()` was enhanced to support contextual validation
for the UI.
Pipelines phase 2
Pipelines phase 3
* BIM: refactor to avoid circular imports
* BIM: Address key CodeQl check errors/notes
* BIM: Refactor Task Panel UI/UX with explicit editing workflow
Refactor the report editor UI to improve usability and prevent data
loss. Editing a statement is now an explicit action, triggered by a new
"Edit Selected" button. This prevents accidental changes and enables a
new transactional workflow with "Save" and "Discard" buttons for each
edit session. A checkbox for "Apply & Next" has been added to streamline
editing multiple statements.
The results preview feature has been redesigned into a self-contained,
closable pane controlled by a "Show Preview" toggle. This pane includes
its own contextual "Refresh" button, reducing UI clutter. All action
button groups have been consistently right-aligned to improve layout and
workflow.
* BIM: Integrate pipeline execution and stabilize UI workflow
Completes the implementation of the pipelined statements feature by
integrating the new backend orchestrator with the ArchReport object. It
also includes a series of critical bug fixes that were discovered during
end-to-end testing, resulting in a more stable user experience.
The primary feature integration consists of refactoring the
_ArchReport.execute method. It now uses the ArchSql.execute_pipeline
generator, enabling the report to correctly process multi-step pipelines
and honor the user-configured data flow.
Severalbugs and regressions were fixed:
- Backend: A major flaw was fixed where FROM-clause functions (like
CHILDREN) were not pipeline-aware. The engine's GROUP BY validator was
also corrected to enforce its original, safer design of not supporting
aliases.
- UI Workflow: A feedback loop that caused the editor cursor to reset
was resolved. The transactional logic for the Save, Discard, and "Save
& Add New" actions was corrected to prevent data loss and ensure
predictable behavior. The Add and Duplicate actions no longer auto-open
the editor, creating a more consistent workflow.
- UI State: Fixed regressions related to the explicit editing model,
including incorrect statement loading (Edit Selected) and state
management when a report is reloaded from a file.
* BIM: add presets manager
* BIM: Fix 'still touched after recompute' bug in some of the tests
* BIM: cleanup tests, fixed presets tests to new presets locations
* BIM: Move test model to its own module for reusability
* BIM: Move GUI tests to their own module
- Disable two of the tests: they pass, but cause a segmentation fault on
teardown. They need to be investigated before enabling them on CI.
* BIM: fix bug in interpreting CONVERT string from GROUP BY
* BIM: Migrate signal connections from lambdas to Qt slots
Refactors all signal connections in the `ReportTaskPanel` to use the
`@QtCore.Slot()` decorator instead of lambda wrappers.
- Resolves CodeQL warning "Unnecessary lambda".
- Adheres to PySide/Qt best practices for signal/slot handling.
- Improves code clarity by using explicit, named methods for
connections.
- Prevents potential runtime `TypeError` exceptions by correctly
managing slot signatures for signals that emit arguments (e.g.,
`clicked(bool)`).
- Introduces simple slot wrappers where necessary to cleanly separate UI
event handling from core logic.
* BIM: Address CodeQl warnings
* BIM: Add CHILDREN_RECURSIVE(subquery, max_depth) SQL function to find all descendants of an object set.
- Create internal _get_bim_type and _is_bim_group helpers to remove all Draft module dependencies from the SQL engine.
- Implement a new _traverse_architectural_hierarchy function using a deque-based BFS algorithm to prevent infinite loops.
- The CHILDREN and CHILDREN_RECURSIVE functions now use the new traversal engine.
- The traversal engine now transparently navigates generic groups but excludes them from the results.
- Correct ParentFunction logic to validate containment by checking the parent's .Group list instead of the child's .InList.
- Add unit tests for recursive traversal, depth limiting, and transparent group handling.
- Update test_group_by_multiple_mixed_columns to match the corrected behavior of the TYPE(*) function.
* BIM: Add __repr__ and __str__ for the ArchReport proxy
* BIM: Align report quantity headers with internal units
- Change default `Quantity` headers to use the property's internal unit
(e.g., `mm`) instead of the user's global preferred unit (e.g., `m`).
- Fixes inconsistency where the header unit (e.g., `m²`) did not match
the raw data's unit (e.g., `mm²`), making the default behavior
predictable.
- Implement by parsing `str(Quantity)` as a workaround for the C++
`Unit::getString()` method not being exposed to the Python API.
- Add a unit test that temporarily changes the global schema to verify
the fix is independent of user preferences.
* BIM: remove dual import ArchSql and from ArchSql import
* BIM: Fix IfcRole => IfcType
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* CI: add Lark as a build dependency
* BIM: Replace QRegExp with QRegularExpression for regex patterns
QRegExp is no longer available in PySide6. Make the code compatible with
both PySide2/Qt5 and PySide6/Qt6.
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
* CI: move lark dependency to pixi's requirements.host
* BIM: Correct numeric comparisons in SQL WHERE clause
Refactor the `BooleanComparison.evaluate` method to handle numeric and
string-based comparisons separately. Previously, all comparisons were
being performed on string-converted values, causing numerically
incorrect results for `Quantity` objects formatted with "smart" units
(e.g., `"10.0 m"` was incorrectly evaluated as less than `"8000"`).
- The `evaluate` method now normalizes `Quantity` objects to their raw
`.Value` first.
- If both operands are numeric, a direct numerical comparison is
performed for all operators (`=`, `!=`, `>`, `<`, `>=`, `<=`).
- String-based comparisons (for `like`, or as a fallback for other
types) are handled in a separate path.
- Add unit test to lock down this behavior.
* BIM: autocompleter improvements
- Add a trailing space when autocompleting the keywords that need it
- Autocomplete multi-word keywords as a unit
* BIM: Improve live validation user experience
- Do not throw syntax error when in the middle of autocompleting a
keyword
- Introduce typing state and show incomplete query status
* BIM: change double-click action to edit in statements overview
Also allow quick editing the statement description with F2
* BIM: Improve user strings for consistency
* BIM: show count of returned objects in statements table
* BIM: disable preview on invalid queries
* BIM: define slot so that tests can run headless
* BIM: Update unit test to adapt to new behaviour
* [pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
|
||
|
|
9d232222df | Addon Manager: Add defusedxml dependency | ||
|
|
b8031f9205 | Add cmake to Ubuntu package dependencies. (#20578) | ||
|
|
065c1fe0fd | Enable pcl by default on non windows systems | ||
|
|
d09d2c02bb |
Merge pull request #17779 from wwmayer/noboostpy
Remove support for Boost.Python |
||
|
|
17fc5b5bc7 | Package: Fix apt install script to handle VTK for newer Ubuntu releases. | ||
|
|
1489015caf | ci: Add python3-pybind11 to Ubuntu CI | ||
|
|
a9b7490a82 |
CI: Extract apt packages installation into a script.
This provides a few benefits, as regular users can just call this script as well and not need to copy this from the CI files to know which files to install. |