Skip to content

Commit

Permalink
Merge pull request #26 from rafaelbailo/main
Browse files Browse the repository at this point in the history
Migrate plot_CBO to ConsensusBasedXPlots.jl
  • Loading branch information
rafaelbailo authored Mar 12, 2024
2 parents 77c00f8 + 0d1e2de commit 29b6d8a
Show file tree
Hide file tree
Showing 6 changed files with 5 additions and 340 deletions.
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.

0 comments on commit 29b6d8a

Please sign in to comment.