Skip to content

Commit bdfb0c7

Browse files
authored
Merge pull request #967 from vaerksted/master
fix typos
2 parents 284e108 + b777f52 commit bdfb0c7

File tree

11 files changed

+53
-53
lines changed

11 files changed

+53
-53
lines changed

src/dsl.jl

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -269,7 +269,7 @@ function processmult(op, mult, stoich)
269269
end
270270
end
271271

272-
# Finds the metadata from a metadata expresion (`[key=val, ...]`) and returns as a Vector{Pair{Symbol,ExprValues}}.
272+
# Finds the metadata from a metadata expression (`[key=val, ...]`) and returns as a Vector{Pair{Symbol,ExprValues}}.
273273
function extract_metadata(metadata_line::Expr)
274274
metadata = :([])
275275
for arg in metadata_line.args
@@ -471,7 +471,7 @@ function push_reactions!(reactions::Vector{ReactionStruct}, sub_line::ExprValues
471471
push!(metadata_i.args, :(only_use_rate = $(in(arrow, pure_rate_arrows))))
472472
end
473473

474-
# Checks that metadata fields are unqiue.
474+
# Checks that metadata fields are unique.
475475
if !allunique(arg.args[1] for arg in metadata_i.args)
476476
error("Some reaction metadata fields where repeated: $(metadata_entries)")
477477
end
@@ -602,7 +602,7 @@ end
602602
# default metadata value to the `default_reaction_metadata` vector.
603603
function check_default_noise_scaling!(default_reaction_metadata, options)
604604
if haskey(options, :default_noise_scaling)
605-
if (length(options[:default_noise_scaling].args) != 3) # Becasue of how expressions are, 3 is used.
605+
if (length(options[:default_noise_scaling].args) != 3) # Because of how expressions are, 3 is used.
606606
error("@default_noise_scaling should only have a single input, this appears not to be the case: \"$(options[:default_noise_scaling])\"")
607607
end
608608
push!(default_reaction_metadata.args,
@@ -612,7 +612,7 @@ end
612612

613613
# When compound species are declared using the "@compound begin ... end" option, get a list of the compound species, and also the expression that crates them.
614614
function read_compound_options(opts)
615-
# If the compound option is used retrive a list of compound species (need to be added to the reaction system's species), and the option that creates them (used to declare them as compounds at the end).
615+
# If the compound option is used retrieve a list of compound species (need to be added to the reaction system's species), and the option that creates them (used to declare them as compounds at the end).
616616
if haskey(opts, :compounds)
617617
compound_expr = opts[:compounds]
618618
# Find compound species names, and append the independent variable.
@@ -625,7 +625,7 @@ function read_compound_options(opts)
625625
return compound_expr, compound_species
626626
end
627627

628-
# Read the events (continious or discrete) provided as options to the DSL. Returns an expression which evalutes to these.
628+
# Read the events (continuous or discrete) provided as options to the DSL. Returns an expression which evaluates to these.
629629
function read_events_option(options, event_type::Symbol)
630630
# Prepares the events, if required to, converts them to block form.
631631
if event_type [:continuous_events, :discrete_events]
@@ -635,7 +635,7 @@ function read_events_option(options, event_type::Symbol)
635635
MacroTools.striplines(:(begin end))
636636
events_input = option_block_form(events_input)
637637

638-
# Goes throgh the events, checks for errors, and adds them to the output vector.
638+
# Goes through the events, checks for errors, and adds them to the output vector.
639639
events_expr = :([])
640640
for arg in events_input.args
641641
# Formatting error checks.
@@ -646,7 +646,7 @@ function read_events_option(options, event_type::Symbol)
646646
end
647647
if (arg isa Expr) && (arg.args[2] isa Expr) && (arg.args[2].head != :vect) &&
648648
(event_type == :continuous_events)
649-
error("The condition part of continious events (the left-hand side) must be a vector. This is not the case for: $(arg).")
649+
error("The condition part of continuous events (the left-hand side) must be a vector. This is not the case for: $(arg).")
650650
end
651651
if (arg isa Expr) && (arg.args[3] isa Expr) && (arg.args[3].head != :vect)
652652
error("The affect part of all events (the righ-hand side) must be a vector. This is not the case for: $(arg).")
@@ -661,10 +661,10 @@ end
661661

662662
# Reads the variables options. Outputs:
663663
# `vars_extracted`: A vector with extracted variables (lhs in pure differential equations only).
664-
# `dtexpr`: If a differentialequation is defined, the default derrivative (D ~ Differential(t)) must be defined.
664+
# `dtexpr`: If a differential equation is defined, the default derivative (D ~ Differential(t)) must be defined.
665665
# `equations`: a vector with the equations provided.
666666
function read_equations_options(options, variables_declared)
667-
# Prepares the equations. First, extracts equations from provided option (converting to block form if requried).
667+
# Prepares the equations. First, extracts equations from provided option (converting to block form if required).
668668
# Next, uses MTK's `parse_equations!` function to split input into a vector with the equations.
669669
eqs_input = haskey(options, :equations) ? options[:equations].args[3] : :(begin end)
670670
eqs_input = option_block_form(eqs_input)
@@ -718,12 +718,12 @@ function create_differential_expr(options, add_default_diff, used_syms, tiv)
718718
(dexpr.args[1] isa Symbol) ||
719719
error("Differential left-hand side must be a single symbol, instead \"$(dexpr.args[1])\" was given.")
720720
in(dexpr.args[1], used_syms) &&
721-
error("Differential name ($(dexpr.args[1])) is also a species, variable, or parameter. This is ambigious and not allowed.")
721+
error("Differential name ($(dexpr.args[1])) is also a species, variable, or parameter. This is ambiguous and not allowed.")
722722
in(dexpr.args[1], forbidden_symbols_error) &&
723723
error("A forbidden symbol ($(dexpr.args[1])) was used as a differential name.")
724724
end
725725

726-
# If the default differential D has been used, but not pre-declared using the @differenitals
726+
# If the default differential D has been used, but not pre-declared using the @differentials
727727
# options, add this declaration to the list of declared differentials.
728728
if add_default_diff && !any(diff_dec.args[1] == :D for diff_dec in diffexpr.args)
729729
push!(diffexpr.args, :(D = Differential($(tiv))))
@@ -732,11 +732,11 @@ function create_differential_expr(options, add_default_diff, used_syms, tiv)
732732
return diffexpr
733733
end
734734

735-
# Reads the observables options. Outputs an expression ofr creating the obervable variables, and a vector of observable equations.
735+
# Reads the observables options. Outputs an expression ofr creating the observable variables, and a vector of observable equations.
736736
function read_observed_options(options, species_n_vars_declared, ivs_sorted)
737737
if haskey(options, :observables)
738738
# Gets list of observable equations and prepares variable declaration expression.
739-
# (`options[:observables]` inlucdes `@observables`, `.args[3]` removes this part)
739+
# (`options[:observables]` includes `@observables`, `.args[3]` removes this part)
740740
observed_eqs = make_observed_eqs(options[:observables].args[3])
741741
observed_vars = Expr(:block, :(@variables))
742742
obs_syms = :([])
@@ -753,11 +753,11 @@ function read_observed_options(options, species_n_vars_declared, ivs_sorted)
753753

754754
# Error checks.
755755
if (obs_name in species_n_vars_declared) && is_escaped_expr(obs_eq.args[2])
756-
error("An interpoalted observable have been used, which has also been explicitly delcared within the system using eitehr @species or @variables. This is not permited.")
756+
error("An interpolated observable have been used, which has also been explicitly declared within the system using either @species or @variables. This is not permitted.")
757757
end
758758
if ((obs_name in species_n_vars_declared) || is_escaped_expr(obs_eq.args[2])) &&
759759
!isnothing(metadata)
760-
error("Metadata was provided to observable $obs_name in the `@observables` macro. However, the obervable was also declared separately (using either @species or @variables). When this is done, metadata should instead be provided within the original @species or @variable declaration.")
760+
error("Metadata was provided to observable $obs_name in the `@observables` macro. However, the observable was also declared separately (using either @species or @variables). When this is done, metadata should instead be provided within the original @species or @variable declaration.")
761761
end
762762

763763
# This bits adds the observables to the @variables vector which is given as output.
@@ -789,7 +789,7 @@ function read_observed_options(options, species_n_vars_declared, ivs_sorted)
789789

790790
# Adds the observable to the list of observable names.
791791
# This is required for filtering away so these are not added to the ReactionSystem's species list.
792-
# Again, avoid this check if we have interpoalted the variable.
792+
# Again, avoid this check if we have interpolated the variable.
793793
is_escaped_expr(obs_eq.args[2]) || push!(obs_syms.args, obs_name)
794794
end
795795

@@ -805,7 +805,7 @@ function read_observed_options(options, species_n_vars_declared, ivs_sorted)
805805
end
806806

807807
# From the input to the @observables options, creates a vector containing one equation for each observable.
808-
# Checks separate cases for "@obervables O ~ ..." and "@obervables begin ... end". Other cases errors.
808+
# Checks separate cases for "@observables O ~ ..." and "@observables begin ... end". Other cases errors.
809809
function make_observed_eqs(observables_expr)
810810
if observables_expr.head == :call
811811
return :([$(observables_expr)])

src/expression_utils.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ function forbidden_symbol_check(v)
2727
error("The following symbol(s) are used as species or parameters: " *
2828
((map(s -> "'" * string(s) * "', ",
2929
intersect(forbidden_symbols_error, v))...)) *
30-
"this is not permited.")
30+
"this is not permitted.")
3131
nothing
3232
end
3333

@@ -37,7 +37,7 @@ function forbidden_variable_check(v)
3737
error("The following symbol(s) are used as variables: " *
3838
((map(s -> "'" * string(s) * "', ",
3939
intersect(forbidden_variables_error, v))...)) *
40-
"this is not permited.")
40+
"this is not permitted.")
4141
end
4242

4343
function unique_symbol_check(syms)

src/network_analysis.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -709,7 +709,7 @@ conservedquantities(state, cons_laws) = cons_laws * state
709709
# If u0s are not given while conservation laws are present, throws an error.
710710
# Used in HomotopyContinuation and BifurcationKit extensions.
711711
# Currently only checks if any u0s are given
712-
# (not whether these are enough for computing conserved quantitites, this will yield a less informative error).
712+
# (not whether these are enough for computing conserved quantities, this will yield a less informative error).
713713
function conservationlaw_errorcheck(rs, pre_varmap)
714714
vars_with_vals = Set(p[1] for p in pre_varmap)
715715
any(s -> s in vars_with_vals, species(rs)) && return

src/reaction.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -445,10 +445,10 @@ end
445445
"""
446446
getmetadata_dict(reaction::Reaction)
447447
448-
Retrives the `ImmutableDict` containing all of the metadata associated with a specific reaction.
448+
Retrieves the `ImmutableDict` containing all of the metadata associated with a specific reaction.
449449
450450
Arguments:
451-
- `reaction`: The reaction for which we wish to retrive all metadata.
451+
- `reaction`: The reaction for which we wish to retrieve all metadata.
452452
453453
Example:
454454
```julia
@@ -482,11 +482,11 @@ end
482482
"""
483483
getmetadata(reaction::Reaction, md_key::Symbol)
484484
485-
Retrives a certain metadata value from a `Reaction`. If the metadata does not exists, throws an error.
485+
Retrieves a certain metadata value from a `Reaction`. If the metadata does not exist, throws an error.
486486
487487
Arguments:
488-
- `reaction`: The reaction for which we wish to retrive a specific metadata value.
489-
- `md_key`: The metadata for which we wish to retrive.
488+
- `reaction`: The reaction for which we wish to retrieve a specific metadata value.
489+
- `md_key`: The metadata for which we wish to retrieve.
490490
491491
Example:
492492
```julia
@@ -622,7 +622,7 @@ getmisc(reaction)
622622
623623
Notes:
624624
- The `misc` field can contain any valid Julia structure. This mean that Catalyst cannot check it
625-
for symbolci variables that are added here. This means that symbolic variables (e.g. parameters of
625+
for symbolic variables that are added here. This means that symbolic variables (e.g. parameters of
626626
species) that are stored here are not accessible to Catalyst. This can cause troubles when e.g.
627627
creating a `ReactionSystem` programmatically (in which case any symbolic variables stored in the
628628
`misc` metadata field should also be explicitly provided to the `ReactionSystem` constructor).

0 commit comments

Comments
 (0)