Skip to content

Commit b2cb103

Browse files
committed
restore usage of t in the error messages
1 parent 22d7d94 commit b2cb103

File tree

2 files changed

+13
-14
lines changed

2 files changed

+13
-14
lines changed

docs/src/index.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,10 @@ telling us exactly which variable is missing, and because of which processes it
111111
model = processes_to_mtkmodel(processes[[1, 3]])
112112
```
113113
```
114-
ERROR: ArgumentError: Variable x was introduced in process of variable z(t).
115-
However, a process for x was not provided,
116-
there is no default process for x, and x doesn't have a default value.
117-
Please provide a process for variable x.
114+
ERROR: ArgumentError: Variable x(t) was introduced in process of variable z(t).
115+
However, a process for x(t) was not provided,
116+
there is no default process for x(t), and (t)x doesn't have a default value.
117+
Please provide a process for variable x(t).
118118
```
119119

120120
If instead we "forgot" the ``y`` process, **PBM** will not error, but warn, and make ``y`` equal to a named parameter, since ``y`` has a default value:
@@ -129,8 +129,8 @@ parameters(model)
129129

130130
and the warning thrown was:
131131
```julia
132-
┌ Warning: Variable y was introduced in process of variable x(t).
133-
│ However, a process for y was not provided,
132+
┌ Warning: Variable y(t) was introduced in process of variable x(t).
133+
│ However, a process for y(t) was not provided,
134134
│ and there is no default process for it either.
135135
│ Since it has a default value, we make it a parameter by adding a process:
136136
`ParameterProcess(y)`.

src/make.jl

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -61,24 +61,23 @@ function processes_to_mtkmodel(_processes, _default = [];
6161
append_incomplete_variables!(incomplete, introduced, lhs_vars, def_proc)
6262
else
6363
def_val = default_value(added_var) # utilize default value (if possible)
64-
varstr = ModelingToolkit.getname(added_var)
6564
if !isnothing(def_val)
6665
@warn("""
67-
Variable $(varstr) was introduced in process of variable $(introduced[added_var]).
68-
However, a process for $(varstr) was not provided,
66+
Variable $(added_var) was introduced in process of variable $(introduced[added_var]).
67+
However, a process for $(added_var) was not provided,
6968
and there is no default process for it either.
7069
Since it has a default value, we make it a parameter by adding a process:
71-
`ParameterProcess($(varstr))`.
70+
`ParameterProcess($(ModelingToolkit.getname(added_var)))`.
7271
""")
7372
parproc = ParameterProcess(added_var)
7473
push!(eqs, lhs(parproc) ~ rhs(parproc))
7574
push!(lhs_vars, added_var)
7675
else
7776
throw(ArgumentError("""
78-
Variable $(varstr) was introduced in process of variable $(introduced[added_var]).
79-
However, a process for $(varstr) was not provided,
80-
there is no default process for $(varstr), and $(varstr) doesn't have a default value.
81-
Please provide a process for variable $(varstr).
77+
Variable $(added_var) was introduced in process of variable $(introduced[added_var]).
78+
However, a process for $(added_var) was not provided,
79+
there is no default process for $(added_var), and $(added_var) doesn't have a default value.
80+
Please provide a process for variable $(added_var).
8281
"""))
8382
end
8483
end

0 commit comments

Comments
 (0)