Skip to content

Commit

Permalink
Cleaned
Browse files Browse the repository at this point in the history
  • Loading branch information
Veronika Kondratenko committed Sep 11, 2024
1 parent f17bf09 commit 593e09a
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions src/json_interface.jl
Original file line number Diff line number Diff line change
Expand Up @@ -122,13 +122,11 @@ function save_model(model, filename;
errors = nothing,
verbose = true,
meta = Dict(),
save_project = true) # Added save_project flag with default value true
save_project = true)

# Initialize the data dictionary
D = Dict("model_parameters" => model.ps,
"meta" => meta)

# Handle make_model_args
if isnothing(make_model_args)
if verbose
@warn("Only model parameters are saved but no information to reconstruct the model.")
Expand All @@ -137,12 +135,10 @@ function save_model(model, filename;
D["make_model_args"] = make_model_args
end

# Add errors if present
if !isnothing(errors)
D["errors"] = errors
end

# Read Manifest.toml if save_project is true
if save_project
manifest_path = find_manifest()
if manifest_path !== nothing
Expand All @@ -161,7 +157,6 @@ function save_model(model, filename;
end
end

# Save the data to the specified filename
open(filename, "w") do io
write(io, JSON.json(D, 3))
end
Expand Down

0 comments on commit 593e09a

Please sign in to comment.