|
26 | 26 | @equations D(V) ~ 1 - V
|
27 | 27 | d, X --> 0
|
28 | 28 | end
|
29 |
| - save_reaction_network("test_serialisation_annotated.jl", rn; safety_check = false) |
30 |
| - save_reaction_network("test_serialisation.jl", rn; annotate = false, safety_check = false) |
| 29 | + save_reactionsystem("test_serialisation_annotated.jl", rn; safety_check = false) |
| 30 | + save_reactionsystem("test_serialisation.jl", rn; annotate = false, safety_check = false) |
31 | 31 |
|
32 | 32 | # Checks equivalence.
|
33 | 33 | file_string_annotated = read("test_serialisation_annotated.jl", String)
|
|
159 | 159 | rs = complete(rs1)
|
160 | 160 |
|
161 | 161 | # Loads the model and checks that it is correct. Removes the saved file
|
162 |
| - save_reaction_network("serialised_rs.jl", rs; safety_check = false) |
| 162 | + save_reactionsystem("serialised_rs.jl", rs; safety_check = false) |
163 | 163 | rs_loaded = include("../serialised_rs.jl")
|
164 | 164 | @test rs == rs_loaded
|
165 | 165 | rm("serialised_rs.jl")
|
|
247 | 247 |
|
248 | 248 | # Creates model and checks it against serialised version.
|
249 | 249 | @named rs = ReactionSystem([], τ, [X, Y, Z, U, V, W, A, B, C, D, E, F, G], [a, b, c, d, e, f])
|
250 |
| - save_reaction_network("serialised_rs.jl", rs; safety_check = false) |
| 250 | + save_reactionsystem("serialised_rs.jl", rs; safety_check = false) |
251 | 251 | @test rs == include("../serialised_rs.jl")
|
252 | 252 | rm("serialised_rs.jl")
|
253 | 253 | end
|
|
348 | 348 | rs = complete(rs_1)
|
349 | 349 |
|
350 | 350 | # Checks that the correct system is saved (both complete and incomplete ones).
|
351 |
| - save_reaction_network("serialised_rs_incomplete.jl", rs_1; safety_check = false) |
| 351 | + save_reactionsystem("serialised_rs_incomplete.jl", rs_1; safety_check = false) |
352 | 352 | @test isequal(rs_1, include("../serialised_rs_incomplete.jl"))
|
353 |
| - save_reaction_network("serialised_rs_complete.jl", rs; safety_check = false) |
| 353 | + save_reactionsystem("serialised_rs_complete.jl", rs; safety_check = false) |
354 | 354 | @test isequal(rs, include("../serialised_rs_complete.jl"))
|
355 | 355 | rm("serialised_rs_incomplete.jl")
|
356 | 356 | rm("serialised_rs_complete.jl")
|
|
379 | 379 | end
|
380 | 380 |
|
381 | 381 | # Checks that serialisation works.
|
382 |
| - save_reaction_network("serialised_rs.jl", rs; safety_check = false) |
| 382 | + save_reactionsystem("serialised_rs.jl", rs; safety_check = false) |
383 | 383 | @test_broken isequal(rs, include("../serialised_rs.jl"))
|
384 | 384 | rm("serialised_rs.jl")
|
385 | 385 | end
|
|
400 | 400 |
|
401 | 401 | @named osys = ODESystem([eq], t)
|
402 | 402 | @named rs = ReactionSystem(rxs, t; systems = [osys])
|
403 |
| - @test_throws Exception save_reaction_network("failed_serialisation.jl", rs) |
| 403 | + @test_throws Exception save_reactionsystem("failed_serialisation.jl", rs) |
404 | 404 | end
|
405 | 405 |
|
406 | 406 | # Checks that completeness is recorded correctly.
|
|
410 | 410 | rs_complete = @reaction_network begin
|
411 | 411 | (p,d), 0 <--> X
|
412 | 412 | end
|
413 |
| - save_reaction_network("serialised_rs_complete.jl", rs_complete) |
| 413 | + save_reactionsystem("serialised_rs_complete.jl", rs_complete) |
414 | 414 | rs_complete_loaded = include("../serialised_rs_complete.jl")
|
415 | 415 | @test ModelingToolkit.iscomplete(rs_complete_loaded)
|
416 | 416 | rm("serialised_rs_complete.jl")
|
|
419 | 419 | rs_incomplete = @network_component begin
|
420 | 420 | (p,d), 0 <--> X
|
421 | 421 | end
|
422 |
| - save_reaction_network("serialised_rs_incomplete.jl", rs_incomplete) |
| 422 | + save_reactionsystem("serialised_rs_incomplete.jl", rs_incomplete) |
423 | 423 | rs_incomplete_loaded = include("../serialised_rs_incomplete.jl")
|
424 | 424 | @test !ModelingToolkit.iscomplete(rs_incomplete_loaded)
|
425 | 425 | rm("serialised_rs_incomplete.jl")
|
|
0 commit comments