Skip to content

Commit 3c26918

Browse files
authored
Merge pull request #1213 from SciML/add_Catalyst_version_in_serialization
Add catalys version to serialisation function
2 parents e07599f + 14e9059 commit 3c26918

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

src/reactionsystem_serialisation/serialise_reactionsystem.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,13 +85,14 @@ function get_full_system_string(rn::ReactionSystem, annotate::Bool, top_level::B
8585
top_level, CONNECTION_TYPE_FS)
8686

8787
# Finalise the system. Creates the final `ReactionSystem` call.
88-
# Enclose everything in a `let ... end` block.
88+
# Enclose everything in a `let ... end` block. Potentially add Catalyst version number.
8989
rs_creation_code = make_reaction_system_call(
9090
rn, annotate, top_level, has_sivs, has_species,
9191
has_variables, has_parameters, has_reactions,
9292
has_equations, has_observed, has_defaults, has_continuous_events,
9393
has_discrete_events, has_systems, has_connection_type)
9494
annotate || (@string_prepend! "\n" file_text)
95+
annotate && top_level && @string_prepend! "\n# Serialised using Catalyst version v$(Catalyst.VERSION)." file_text
9596
@string_prepend! "let" file_text
9697
@string_append! file_text "\n\n" rs_creation_code "\n\nend"
9798

test/miscellaneous_tests/reactionsystem_serialisation.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ let
3434
file_string_annotated = read("test_serialisation_annotated.jl", String)
3535
file_string = read("test_serialisation.jl", String)
3636
file_string_annotated_real = """let
37+
# Serialised using Catalyst version v$(Catalyst.VERSION).
3738
3839
# Independent variable:
3940
@parameters t

0 commit comments

Comments
 (0)