Skip to content

Commit

Permalink
Added save plot ability
Browse files Browse the repository at this point in the history
  • Loading branch information
markowkes committed Apr 19, 2024
1 parent a1e18e6 commit 8cbd7a2
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "Biofilm"
uuid = "210d8ceb-62d9-4e79-bbbd-4c6870635f0a"
authors = ["Mark Owkes <[email protected]> and contributors"]
version = "1.0.3"
version = "1.1.0"

[deps]
Accessors = "7d9f7c33-5ae7-4f3b-8dc6-eff91059b697"
Expand Down
15 changes: 12 additions & 3 deletions src/outputs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,21 @@ function outputs(integrator)
printBiofilmValues(t[end],Xt[:,end],St[:,end],Pb,Sb,Lf[end],p)

# Plot results
if p.makePlots && (mod(sol.t[end],plotPeriod)0.0 || mod(sol.t[end],plotPeriod)plotPeriod)
plt = biofilm_plot(sol,p)
display(plt)
if (mod(sol.t[end],plotPeriod)0.0 || mod(sol.t[end],plotPeriod)plotPeriod)
if p.makePlots || p.savePlots
plt = biofilm_plot(sol,p)
end
if p.makePlots
display(plt)
end
if p.savePlots
ispath("savePlots") || mkpath("savePlots")
savefig(String("savePlots/plot_$(integrator.t).png"))
end
end

end
return
end

"""
Expand Down
1 change: 1 addition & 0 deletions src/parameters.jl
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ function checkTypes_setDefs(d; verbose=false)
d,err = checkType_setDef(err,d,Float64, :tol )
d,err = checkType_setDef(err,d,Float64, :plotPeriod, default=d[:outPeriod] )
d,err = checkType_setDef(err,d,Bool, :makePlots, default=true )
d,err = checkType_setDef(err,d,Bool, :savePlots, default=false )
d,err = checkType_setDef(err,d,Float64, :discontinuityPeriod,default=d.tFinal )
d,err = checkType_setDef(err,d,String, :optionalPlot, default="growthrate" )
d,err = checkType_setDef(err,d,Tuple{Int64, Int64}, :plotSize, default=(1600,1000) )
Expand Down

2 comments on commit 8cbd7a2

@markowkes
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JuliaRegistrator register()

@JuliaRegistrator
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Registration pull request created: JuliaRegistries/General/105679

Tip: Release Notes

Did you know you can add release notes too? Just add markdown formatted text underneath the comment after the text
"Release notes:" and it will be added to the registry PR, and if TagBot is installed it will also be added to the
release that TagBot creates. i.e.

@JuliaRegistrator register

Release notes:

## Breaking changes

- blah

To add them here just re-invoke and the PR will be updated.

Tagging

After the above pull request is merged, it is recommended that a tag is created on this repository for the registered package version.

This will be done automatically if the Julia TagBot GitHub Action is installed, or can be done manually through the github interface, or via:

git tag -a v1.1.0 -m "<description of version>" 8cbd7a25c3c28d09a065fb74b6b03d6f5eb8f6e4
git push origin v1.1.0

Please sign in to comment.