Skip to content

[Python] Add checks when parsing RegressionStateScenes.regression-tests file - #121

Merged
alxbilger merged 1 commit into
sofa-framework:masterfrom
fredroy:check_regressionfile_validity
Jul 29, 2026
Merged

[Python] Add checks when parsing RegressionStateScenes.regression-tests file#121
alxbilger merged 1 commit into
sofa-framework:masterfrom
fredroy:check_regressionfile_validity

Conversation

@fredroy

@fredroy fredroy commented Jul 28, 2026

Copy link
Copy Markdown
Contributor

On the SOFA codebase, the regression was crashing for FEMBAR_ShewchukPCGLinearSolver.scn because the RegressionStateScenes.regression-tests is missing an argument (nb of steps) for this scene. Apparently the C++ version is not bothered....

@alxbilger

Copy link
Copy Markdown
Contributor

Check for conflicts with #118. I made this PR also to handle the FEMBAR_ShewchukPCGLinearSolver scene.

@fredroy

fredroy commented Jul 29, 2026

Copy link
Copy Markdown
Contributor Author

Akshually, it is #118 which makes FEMBAR_ShewchukPCGLinearSolver.scn regression test crash 🫢
It crashes because FEMBAR_ShewchukPCGLinearSolver has 4 fields (instead of the required 5)
and python throws an exception here

            if len(values) < 2:
                helper.writeWarning(f"Cannot evaluate steps from line: {line}. Default value {steps} will be used instead.")
            else:
                steps = int(values[1]) <---

because values[1] in this case instead of being a number of steps (as it should be) is an epsilon (1e-8). Python throws ValueError exception in this case.

@alxbilger

Copy link
Copy Markdown
Contributor

I suggest to go with json in the future

@alxbilger
alxbilger merged commit 35da2b3 into sofa-framework:master Jul 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants