Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Migrate plot_CBO to ConsensusBasedXPlots.jl #26

Merged
merged 1 commit into from
Mar 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,14 @@ version = "1.1.0"
[deps]
DefaultKeywordArguments = "d739bc73-037a-4484-8212-e0e00e9ea6bf"
Distributions = "31c24e10-a181-5473-b8eb-7969acd0382f"
LaTeXStrings = "b964fa9f-0449-5b57-a5c2-d3ea65f4040f"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
LogExpFunctions = "2ab3a3ac-af41-5b50-aa03-7779005ae688"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"

[compat]
DefaultKeywordArguments = "1"
Distributions = "0.25"
LaTeXStrings = "1"
LogExpFunctions = "0.3"
Plots = "1"
Reexport = "1"
julia = "1.9"

Expand Down
9 changes: 3 additions & 6 deletions docs/src/output_visualisation.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,11 @@
# Output visualisation

ConsensusBasedX.jl offers the `ConsensusBasedXPlots` submodule, which provides routines to visualise the output of `minimise` for problems in one or two dimensions.
The auxiliary package [ConsensusBasedXPlots.jl](https://github.com/PdIPS/ConsensusBasedXPlots.jl) provides routines to visualise the output of `minimise` for problems in one or two dimensions. These routines are kept as a separate package in order to minimise the dependencies of ConsensusBasedX.jl, since not every user will require visualisation tools.

Simply run `minimise` with `extended_output = true` (see [Extended output](@ref)), and then call the `plot_CBO` method:
To plot the output of CBO, simply run `minimise` with `extended_output = true` (see [Extended output](@ref)), and then call the `plot_CBO` method:
```julia
out = minimise(f, D = 2, extended_output = true)
using ConsensusBasedX.ConsensusBasedXPlots
using ConsensusBasedXPlots
plot_CBO(out)
```
Full-code examples in [one dimension](https://github.com/PdIPS/ConsensusBasedX.jl/blob/main/examples/advanced_usage/output_visualisation_1D.jl) and [two dimensions](https://github.com/PdIPS/ConsensusBasedX.jl/blob/main/examples/advanced_usage/output_visualisation_2D.jl).

!!! compat
The developers of ConsensusBasedX.jl intend to segregate `ConsensusBasedXPlots` as a separate package in the future, in order to avoid having `Plots` as a dependency of `ConsensusBasedX`.
2 changes: 1 addition & 1 deletion examples/advanced_usage/output_visualisation_1D.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using ConsensusBasedX, ConsensusBasedX.ConsensusBasedXPlots
using ConsensusBasedX, ConsensusBasedXPlots

f(x) = ConsensusBasedX.Ackley(x, shift = 1)

Expand Down
2 changes: 1 addition & 1 deletion examples/advanced_usage/output_visualisation_2D.jl
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
using ConsensusBasedX, ConsensusBasedX.ConsensusBasedXPlots
using ConsensusBasedX, ConsensusBasedXPlots

f(x) = ConsensusBasedX.Ackley(x, shift = 1)

Expand Down
2 changes: 0 additions & 2 deletions src/ConsensusBasedX.jl
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,5 @@ include("./CBS/CBS_method.jl")

include("./ConsensusBasedXLowLevel.jl")
export ConsensusBasedXLowLevel
include("./ConsensusBasedXPlots.jl")
export ConsensusBasedXPlots

end
326 changes: 0 additions & 326 deletions src/ConsensusBasedXPlots.jl

This file was deleted.

Loading