@@ -1274,6 +1274,12 @@ function parameters(sys::AbstractSystem; initial_parameters = false)
1274
1274
end
1275
1275
1276
1276
function dependent_parameters (sys:: AbstractSystem )
1277
+ if ! iscomplete (sys)
1278
+ throw (ArgumentError ("""
1279
+ `dependent_parameters` requires that the system is marked as complete. Call
1280
+ `complete` or `mtkcompile` on the system.
1281
+ """ ))
1282
+ end
1277
1283
return map (eq -> eq. lhs, parameter_dependencies (sys))
1278
1284
end
1279
1285
@@ -1290,23 +1296,22 @@ function parameters_toplevel(sys::AbstractSystem)
1290
1296
end
1291
1297
1292
1298
"""
1293
- $(TYPEDSIGNATURES)
1294
- Get the parameter dependencies of the system `sys` and its subsystems.
1299
+ $(TYPEDSIGNATURES)
1295
1300
1296
- See also [`defaults`](@ref) and [`ModelingToolkit.get_parameter_dependencies`](@ref).
1301
+ Get the parameter dependencies of the system `sys` and its subsystems. Requires that the
1302
+ system is `complete`d.
1297
1303
"""
1298
1304
function parameter_dependencies (sys:: AbstractSystem )
1305
+ if ! iscomplete (sys)
1306
+ throw (ArgumentError ("""
1307
+ `parameter_dependencies` requires that the system is marked as complete. Call \
1308
+ `complete` or `mtkcompile` on the system.
1309
+ """ ))
1310
+ end
1299
1311
if ! has_parameter_dependencies (sys)
1300
1312
return Equation[]
1301
1313
end
1302
- pdeps = get_parameter_dependencies (sys)
1303
- systems = get_systems (sys)
1304
- # put pdeps after those of subsystems to maintain topological sorted order
1305
- namespaced_deps = mapreduce (
1306
- s -> map (eq -> namespace_equation (eq, s), parameter_dependencies (s)), vcat,
1307
- systems; init = Equation[])
1308
-
1309
- return vcat (namespaced_deps, pdeps)
1314
+ get_parameter_dependencies (sys)
1310
1315
end
1311
1316
1312
1317
function full_parameters (sys:: AbstractSystem )
0 commit comments