-
Notifications
You must be signed in to change notification settings - Fork 15
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: add check that dimension matrix size matches result matrix size
No known issue where this happens but this will catch catch implementation flaws with matrix functions
- Loading branch information
1 parent
ee05d55
commit 29ffe31
Showing
1 changed file
with
7 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2761,6 +2761,12 @@ def evaluate_statements(statements: list[InputAndSystemStatement], | |
|
||
elif is_matrix(evaluated_expression) and (dimensional_analysis_expression is None or \ | ||
is_matrix(dimensional_analysis_expression)) and isinstance(symbolic_expression, list) : | ||
|
||
if dimensional_analysis_expression is not None and ( | ||
evaluated_expression.rows != dimensional_analysis_expression.rows and | ||
evaluated_expression.cols != dimensional_analysis_expression.cols ): | ||
Exception("Internal Error: Dimension matrix size does not match result matrix size. Report error to [email protected]") | ||
|
||
matrix_results = [] | ||
for i in range(evaluated_expression.rows): | ||
current_row = [] | ||
|
@@ -2786,7 +2792,7 @@ def evaluate_statements(statements: list[InputAndSystemStatement], | |
subQueryName=item["subQueryName"]) | ||
|
||
else: | ||
raise Exception("Dimension or symbolic result not a Matrix for an evaluated expression that is a Matrix") | ||
raise Exception("Internal Error: Dimension or symbolic result not a Matrix for an evaluated expression that is a Matrix. Report error to [email protected]") | ||
|
||
if item["isRange"] is True: | ||
current_result = item | ||
|