2
2
3
3
# Checks if the reaction system has any independent variable. True for all valid reaction systems.
4
4
function seri_has_iv (rn:: ReactionSystem )
5
- true
5
+ return true
6
6
end
7
7
8
8
# Extract a string which declares the system's independent variable.
9
9
function get_iv_string (rn:: ReactionSystem )
10
10
iv_dec = MT. get_iv (rn)
11
- " @variables $(iv_dec) "
11
+ return " @variables $(iv_dec) "
12
12
end
13
13
14
14
# Creates an annotation for the system's independent variable.
15
15
function get_iv_annotation (rn:: ReactionSystem )
16
- " Independent variable:"
16
+ return " Independent variable:"
17
17
end
18
18
19
19
# Combines the 3 independent variable-related functions in a constant tuple.
@@ -23,17 +23,17 @@ IV_FS = (seri_has_iv, get_iv_string, get_iv_annotation)
23
23
24
24
# Checks if the reaction system has any spatial independent variables.
25
25
function seri_has_sivs (rn:: ReactionSystem )
26
- ! isempty (get_sivs (rn))
26
+ return ! isempty (get_sivs (rn))
27
27
end
28
28
29
29
# Extract a string which declares the system's spatial independent variables.
30
30
function get_sivs_string (rn:: ReactionSystem )
31
- " spatial_ivs = @variables$(syms_2_declaration_string (get_sivs (rn))) "
31
+ return " spatial_ivs = @variables$(syms_2_declaration_string (get_sivs (rn))) "
32
32
end
33
33
34
34
# Creates an annotation for the system's spatial independent variables.
35
35
function get_sivs_annotation (rn:: ReactionSystem )
36
- " Spatial independent variables:"
36
+ return " Spatial independent variables:"
37
37
end
38
38
39
39
# Combines the 3 independent variables-related functions in a constant tuple.
@@ -133,7 +133,7 @@ function handle_us_n_ps(file_text::String, rn::ReactionSystem, annotate::Bool,
133
133
end
134
134
135
135
# Merges the file text with `us_n_ps_string` and returns the final outputs.
136
- file_text * us_n_ps_string, has_ps, has_sps, has_vars
136
+ return file_text * us_n_ps_string, has_ps, has_sps, has_vars
137
137
end
138
138
139
139
# ## Handles Parameters ###
@@ -142,20 +142,20 @@ end
142
142
143
143
# Checks if the reaction system has any parameters.
144
144
function seri_has_parameters (rn:: ReactionSystem )
145
- ! isempty (get_ps (rn))
145
+ return ! isempty (get_ps (rn))
146
146
end
147
147
148
148
# Extract a string which declares the system's parameters. Uses multiline declaration (a
149
149
# `begin ... end` block) if more than 3 parameters have a "complicated" declaration (if they
150
150
# have metadata, default value, or type designation).
151
151
function get_parameters_string (ps)
152
152
multiline_format = count (complicated_declaration (p) for p in ps) > 3
153
- " @parameters$(syms_2_declaration_string (ps; multiline_format)) "
153
+ return " @parameters$(syms_2_declaration_string (ps; multiline_format)) "
154
154
end
155
155
156
156
# Creates an annotation for the system's parameters.
157
157
function get_parameters_annotation (rn:: ReactionSystem )
158
- " Parameters:"
158
+ return " Parameters:"
159
159
end
160
160
161
161
# ## Handles Species ###
@@ -164,20 +164,20 @@ end
164
164
165
165
# Checks if the reaction system has any species.
166
166
function seri_has_species (rn:: ReactionSystem )
167
- ! isempty (get_species (rn))
167
+ return ! isempty (get_species (rn))
168
168
end
169
169
170
170
# Extract a string which declares the system's species. Uses multiline declaration (a
171
171
# `begin ... end` block) if more than 3 species have a "complicated" declaration (if they
172
172
# have metadata, default value, or type designation).
173
173
function get_species_string (sps)
174
174
multiline_format = count (complicated_declaration (sp) for sp in sps) > 3
175
- " @species$(syms_2_declaration_string (sps; multiline_format)) "
175
+ return " @species$(syms_2_declaration_string (sps; multiline_format)) "
176
176
end
177
177
178
178
# Creates an annotation for the system's species.
179
179
function get_species_annotation (rn:: ReactionSystem )
180
- " Species:"
180
+ return " Species:"
181
181
end
182
182
183
183
# ## Handles Variables ###
0 commit comments