Skip to content

Commit 5963725

Browse files
Merge pull request #191 from StructuralEquationModels/reformat
Reformat
2 parents 57c2339 + ae6e408 commit 5963725

76 files changed

Lines changed: 2850 additions & 2037 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.JuliaFormatter.toml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
always_for_in = true
2+
align_assignment = true
3+
align_struct_field = true
4+
align_conditional = true
5+
align_pair_arrow = true
6+
align_matrix = true
7+
remove_extra_newlines = true
8+
whitespace_typedefs = true

.github/workflows/FormatCheck.yml

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: Format suggestions
2+
on:
3+
pull_request:
4+
# this argument is not required if you don't use the `suggestion-label` input
5+
types: [ opened, reopened, synchronize, labeled, unlabeled ]
6+
jobs:
7+
code-style:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: julia-actions/julia-format@v2
11+
with:
12+
version: '1'
13+
suggestion-label: 'format-suggest'

docs/make.jl

Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
using Documenter, StructuralEquationModels
22

33
makedocs(
4-
sitename="StructuralEquationModels.jl",
4+
sitename = "StructuralEquationModels.jl",
55
pages = [
66
"index.md",
77
"Tutorials" => [
@@ -11,67 +11,62 @@ makedocs(
1111
"tutorials/specification/specification.md",
1212
"tutorials/specification/graph_interface.md",
1313
"tutorials/specification/ram_matrices.md",
14-
"tutorials/specification/parameter_table.md"
14+
"tutorials/specification/parameter_table.md",
1515
],
1616
"Model Construction" => [
1717
"tutorials/construction/construction.md",
1818
"tutorials/construction/outer_constructor.md",
19-
"tutorials/construction/build_by_parts.md"
20-
],
21-
"Optimization Backends" => [
22-
"tutorials/backends/optim.md",
23-
"tutorials/backends/nlopt.md"
19+
"tutorials/construction/build_by_parts.md",
2420
],
21+
"Optimization Backends" =>
22+
["tutorials/backends/optim.md", "tutorials/backends/nlopt.md"],
2523
"Model Fitting" => "tutorials/fitting/fitting.md",
2624
"Model Inspection" => "tutorials/inspection/inspection.md",
2725
"Mean Structures" => "tutorials/meanstructure.md",
2826
"Collections" => [
2927
"tutorials/collection/collection.md",
30-
"tutorials/collection/multigroup.md"
28+
"tutorials/collection/multigroup.md",
3129
],
32-
"Constraints" => "tutorials/constraints/constraints.md"
30+
"Constraints" => "tutorials/constraints/constraints.md",
3331
],
3432
"Developer documentation" => [
3533
"Extending the package" => "developer/extending.md",
3634
"Custom loss functions" => "developer/loss.md",
3735
"Custom imply types" => "developer/imply.md",
3836
"Custom optimizer types" => "developer/optimizer.md",
3937
"Custom observed types" => "developer/observed.md",
40-
"Custom model types" => "developer/sem.md"
41-
],
42-
"Advanced tutorials" => [
43-
"Regularization" => "tutorials/regularization/regularization.md"
38+
"Custom model types" => "developer/sem.md",
4439
],
40+
"Advanced tutorials" =>
41+
["Regularization" => "tutorials/regularization/regularization.md"],
4542
"Performance tips" => [
4643
"Model sorting" => "performance/sorting.md",
4744
"MKL" => "performance/mkl.md",
4845
"Simulation studies" => "performance/simulation.md",
4946
"Symbolic precomputation" => "performance/symbolic.md",
5047
"Starting values" => "performance/starting_values.md",
51-
"Parametric Types" => "performance/parametric.md"
48+
"Parametric Types" => "performance/parametric.md",
5249
],
5350
"Internals and design" => [
5451
"Internals and design" => "internals/internals.md",
5552
"files" => "internals/files.md",
56-
"types" => "internals/types.md"
53+
"types" => "internals/types.md",
5754
],
58-
"Complementary material" => [
59-
"Mathematical appendix" => "complementary/maths.md"
60-
]
55+
"Complementary material" => ["Mathematical appendix" => "complementary/maths.md"],
6156
],
6257
format = Documenter.HTML(
6358
prettyurls = get(ENV, "CI", nothing) == "true",
6459
assets = ["assets/favicon_zeta.ico"],
6560
ansicolor = true,
66-
collapselevel = 1
61+
collapselevel = 1,
6762
),
68-
doctest = false
63+
doctest = false,
6964
)
7065

7166
# doctest(StructuralEquationModels, fix=true)
7267

7368
deploydocs(
7469
repo = "github.com/StructuralEquationModels/StructuralEquationModels.jl",
7570
devbranch = "devel",
76-
push_preview = "push_preview=true" ARGS
71+
push_preview = "push_preview=true" ARGS,
7772
)

src/StructuralEquationModels.jl

Lines changed: 100 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,18 @@
11
module StructuralEquationModels
22

3-
using LinearAlgebra, Optim,
4-
NLSolversBase, Statistics, SparseArrays, Symbolics,
5-
NLopt, FiniteDiff, PrettyTables,
6-
Distributions, StenoGraphs, LazyArtifacts, DelimitedFiles,
3+
using LinearAlgebra,
4+
Optim,
5+
NLSolversBase,
6+
Statistics,
7+
SparseArrays,
8+
Symbolics,
9+
NLopt,
10+
FiniteDiff,
11+
PrettyTables,
12+
Distributions,
13+
StenoGraphs,
14+
LazyArtifacts,
15+
DelimitedFiles,
716
DataFrames
817

918
import DataFrames: DataFrame
@@ -76,41 +85,90 @@ include("frontend/fit/fitmeasures/fit_measures.jl")
7685
include("frontend/fit/standard_errors/hessian.jl")
7786
include("frontend/fit/standard_errors/bootstrap.jl")
7887

79-
80-
81-
export AbstractSem,
82-
AbstractSemSingle, AbstractSemCollection, Sem, SemFiniteDiff,
83-
SemEnsemble,
84-
SemImply,
85-
RAMSymbolic, RAMSymbolicZ, RAM, ImplyEmpty, imply,
86-
start_val,
87-
start_fabin3, start_simple, start_parameter_table,
88-
SemLoss,
89-
SemLossFunction, SemML, SemFIML, em_mvn, SemLasso, SemRidge,
90-
SemConstant, SemWLS, loss,
91-
SemOptimizer,
92-
SemOptimizerEmpty, SemOptimizerOptim, SemOptimizerNLopt, NLoptConstraint,
93-
optimizer, n_iterations, convergence,
94-
SemObserved,
95-
SemObservedData, SemObservedCovariance, SemObservedMissing, observed,
96-
sem_fit,
97-
SemFit,
98-
minimum, solution,
99-
sem_summary,
100-
objective!, gradient!, hessian!, objective_gradient!, objective_hessian!,
101-
gradient_hessian!, objective_gradient_hessian!,
102-
ParameterTable,
103-
EnsembleParameterTable, update_partable!, update_estimate!, update_start!,
104-
Fixed, fixed, Start, start, Label, label,
105-
get_identifier_indices,
106-
RAMMatrices,
107-
RAMMatrices!,
108-
identifier,
109-
fit_measures,
110-
AIC, BIC, χ², df, fit_measures, minus2ll, n_par, n_obs, p_value, RMSEA, n_man,
111-
EmMVNModel,
112-
se_hessian, se_bootstrap,
113-
example_data,
114-
swap_observed, update_observed,
115-
@StenoGraph, , , ,
116-
end
88+
export AbstractSem,
89+
AbstractSemSingle,
90+
AbstractSemCollection,
91+
Sem,
92+
SemFiniteDiff,
93+
SemEnsemble,
94+
SemImply,
95+
RAMSymbolic,
96+
RAM,
97+
ImplyEmpty,
98+
imply,
99+
start_val,
100+
start_fabin3,
101+
start_simple,
102+
start_parameter_table,
103+
SemLoss,
104+
SemLossFunction,
105+
SemML,
106+
SemFIML,
107+
em_mvn,
108+
SemRidge,
109+
SemConstant,
110+
SemWLS,
111+
loss,
112+
SemOptimizer,
113+
SemOptimizerEmpty,
114+
SemOptimizerOptim,
115+
SemOptimizerNLopt,
116+
NLoptConstraint,
117+
optimizer,
118+
n_iterations,
119+
convergence,
120+
SemObserved,
121+
SemObservedData,
122+
SemObservedCovariance,
123+
SemObservedMissing,
124+
observed,
125+
sem_fit,
126+
SemFit,
127+
minimum,
128+
solution,
129+
sem_summary,
130+
objective!,
131+
gradient!,
132+
hessian!,
133+
objective_gradient!,
134+
objective_hessian!,
135+
gradient_hessian!,
136+
objective_gradient_hessian!,
137+
ParameterTable,
138+
EnsembleParameterTable,
139+
update_partable!,
140+
update_estimate!,
141+
update_start!,
142+
Fixed,
143+
fixed,
144+
Start,
145+
start,
146+
Label,
147+
label,
148+
get_identifier_indices,
149+
RAMMatrices,
150+
identifier,
151+
fit_measures,
152+
AIC,
153+
BIC,
154+
χ²,
155+
df,
156+
fit_measures,
157+
minus2ll,
158+
n_par,
159+
n_obs,
160+
p_value,
161+
RMSEA,
162+
n_man,
163+
EmMVNModel,
164+
se_hessian,
165+
se_bootstrap,
166+
example_data,
167+
swap_observed,
168+
update_observed,
169+
@StenoGraph,
170+
,
171+
,
172+
,
173+
174+
end

src/additional_functions/artifacts.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ function example_data(name)
1919
data, header = readdlm(path, ',', header = true)
2020
data_raw = DataFrame(data, vec(header))
2121
for col in eachcol(data_raw)
22-
replace!(col,"NA" => missing)
22+
replace!(col, "NA" => missing)
2323
end
2424
data = identity.(data_raw)
2525
return data
@@ -31,11 +31,11 @@ function example_data(name)
3131
data, header = readdlm(path, ',', header = true)
3232
data_raw = DataFrame(data, vec(header))
3333
for col in eachcol(data_raw)
34-
replace!(col,"NA" => missing)
34+
replace!(col, "NA" => missing)
3535
end
3636
data = identity.(data_raw)
3737
push!(out, key => data)
3838
end
3939
return out
4040
end
41-
end
41+
end

0 commit comments

Comments
 (0)