Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New indexing and simulation input tests #805

Merged
merged 6 commits into from
Apr 10, 2024

Conversation

TorkelE
Copy link
Member

@TorkelE TorkelE commented Apr 8, 2024

Reupload from #761 (where git could not keep track with all the various branches).

Adds various tests for indexing and creating problems.

@TorkelE TorkelE changed the base branch from master to Catalyst_version_14 April 8, 2024 02:08
@@ -1,35 +0,0 @@
### Not currently run by runtests

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These tests where not run, and are superseded by new indexing tests, which does this but are also more extensive

XProblem(rn, u0, (0.0, 1.0), ps); @test true;
else
# Several of these cases do not throw errors (https://github.com/SciML/ModelingToolkit.jl/issues/2624).
@test_broken false
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Basically a hack so that we get test broken results in the log (since some tests in the loop passes and some fail, cannot just use test_broken


# Test remake function.
let
@test_broken false # Currently cannot be run for Ensemble problems: https://github.com/SciML/SciMLBase.jl/issues/661 (as indexing cannot be used to check values).
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added a test_broken false as a reminder that there is a missing case to be added to the loop.

# Checks that updating an integrators parameter values does not affect mass action rate until after
# `reset_aggregated_jumps!` have been applied as well (wt which point the correct rate is achieved).
jint.ps[p1] = 4.0
@test jint.cb.condition.ma_jumps.scaled_rates[1] != 8.0
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be a bit better to check the previous value is unchanged, so we know the exact expected behavior is happening.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, that makes sense. I will update it to do that.

test/runtests.jl Outdated
Comment on lines 60 to 61
@time @safetestset "MTK Structure Indexing" begin include("meta/mtk_structure_indexing.jl") end
@time @safetestset "MTK Problem Inputs" begin include("meta/mtk_problem_inputs.jl") end
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd put these higher up in the listing; after we test solution accuracy maybe?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, I will move them up there

@TorkelE TorkelE merged commit 63ffa92 into Catalyst_version_14 Apr 10, 2024
3 checks passed
@TorkelE TorkelE deleted the new_indexing_and_sim_tests branch June 8, 2024 18:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants