Skip to content

Commit 97673e4

Browse files
Alexey Stukalovalyst
authored andcommitted
move SemSpec methods from types.jl
1 parent 8019bbc commit 97673e4

File tree

2 files changed

+15
-14
lines changed

2 files changed

+15
-14
lines changed

src/frontend/specification/documentation.jl

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
params(spec::SemSpecification) = spec.params
2+
nparams(spec::SemSpecification) = length(params(spec))
3+
4+
# observed + latent
5+
vars(spec::SemSpecification) =
6+
error("vars(spec::$(typeof(spec))) is not implemented")
7+
observed_vars(spec::SemSpecification) =
8+
error("observed_vars(spec::$(typeof(spec))) is not implemented")
9+
latent_vars(spec::SemSpecification) =
10+
error("latent_vars(spec::$(typeof(spec))) is not implemented")
11+
12+
nvars(spec::SemSpecification) = length(vars(spec))
13+
nobserved_vars(spec::SemSpecification) = length(observed_vars(spec))
14+
nlatent_vars(spec::SemSpecification) = length(latent_vars(spec))
15+
116
"""
217
`ParameterTable`s contain the specification of a structural equation model.
318

src/types.jl

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -342,18 +342,4 @@ Base type for all SEM specifications.
342342
"""
343343
abstract type SemSpecification end
344344

345-
params(spec::SemSpecification) = spec.params
346-
nparams(spec::SemSpecification) = length(params(spec))
347-
348-
# observed + latent
349-
vars(spec::SemSpecification) = error("vars(spec::$(typeof(spec))) is not implemented")
350-
observed_vars(spec::SemSpecification) =
351-
error("observed_vars(spec::$(typeof(spec))) is not implemented")
352-
latent_vars(spec::SemSpecification) =
353-
error("latent_vars(spec::$(typeof(spec))) is not implemented")
354-
355-
nvars(spec::SemSpecification) = length(vars(spec))
356-
nobserved_vars(spec::SemSpecification) = length(observed_vars(spec))
357-
nlatent_vars(spec::SemSpecification) = length(latent_vars(spec))
358-
359345
abstract type AbstractParameterTable <: SemSpecification end

0 commit comments

Comments
 (0)