-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Upgraded dependencies; AbstractPlotting -> Makie (#21)
* AbstractPlotting -> Makie, bumped compats * Allow passing args and kwargs to Plots.jl recipe * Make Makie an optional dependency via package extensions * Added example for Makie.jl and plots * Updated install instructions Closes #12 * Updated book link Closes #20 * Drop Julia < 1.9 to support package extensions * Added tests of plot recipes * Updated README * Bumped version
Showing
8 changed files
with
171 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,7 +10,7 @@ jobs: | |
fail-fast: false | ||
matrix: | ||
version: | ||
- '1.3' | ||
- '1.9' | ||
- '1' | ||
- 'nightly' | ||
os: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,35 @@ | ||
name = "ComplexPhasePortrait" | ||
uuid = "38ac1a67-8e16-5889-9a62-b2c9995eb50f" | ||
version = "0.2.1" | ||
version = "0.2.2" | ||
|
||
[deps] | ||
AbstractPlotting = "537997a7-5e4e-5d89-9595-2241ea00577e" | ||
Colors = "5ae59095-9a9b-59fe-a467-6f913c188581" | ||
Images = "916415d5-f1e6-5110-898d-aaa5f9f070e0" | ||
IntervalSets = "8197267c-284f-5f27-9208-e0e47529a953" | ||
Reactive = "a223df75-4e93-5b7c-acf9-bdd599c0f4de" | ||
RecipesBase = "3cdcf5f2-1ef4-517c-9805-6587b60abb01" | ||
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" | ||
|
||
[weakdeps] | ||
Makie = "ee78f7c6-11fb-53f2-987a-cfe4a2b5a57a" | ||
|
||
[extensions] | ||
ComplexPhasePortraitMakieExt = "Makie" | ||
|
||
[compat] | ||
AbstractPlotting = "0.17.1" | ||
CairoMakie = "0.11" | ||
Colors = "0.12" | ||
Images = "0.22,0.23" | ||
IntervalSets = "0.3.1, 0.4, 0.5" | ||
Images = "0.22,0.23,0.26" | ||
IntervalSets = "0.3.1, 0.4, 0.5, 0.7" | ||
Makie = "0.20" | ||
Plots = "1.40" | ||
Reactive = "0.8.2" | ||
RecipesBase = "1" | ||
julia = "1.3" | ||
julia = "1.9" | ||
|
||
[extras] | ||
CairoMakie = "13f3f980-e62b-5c42-98c6-ff1f3baf88f0" | ||
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80" | ||
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" | ||
|
||
[targets] | ||
test = ["CairoMakie", "Plots", "Test"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
module ComplexPhasePortraitMakieExt | ||
using IntervalSets | ||
|
||
import Makie | ||
import Makie: plot!, image!, Rectf | ||
|
||
using ComplexPhasePortrait | ||
import ComplexPhasePortrait: phase, phase!, _range | ||
|
||
Makie.@recipe(Phase) do scene | ||
Makie.Theme( | ||
portrait_type = PTproper, | ||
ctype = "standard" | ||
) | ||
end | ||
|
||
function plot!(plot::Phase{Tuple{X,Y,F}}) where {X<:AbstractVector,Y<:AbstractVector,F<:AbstractMatrix} | ||
x,y,f = plot[1:3] | ||
c = portrait(convert(AbstractMatrix{ComplexF64}, f[]), | ||
plot.portrait_type[], ctype=plot.ctype[]) | ||
|
||
a_x,b_x = first(x[]),last(x[]) | ||
a_y,b_y = first(y[]),last(y[]) | ||
|
||
image!(plot, a_x .. b_x, a_y .. b_y, c, limits = Rectf(a_x,a_y,b_x-a_x,b_y-a_y)) | ||
end | ||
|
||
function plot!(plot::Phase{Tuple{X,Y,F}}) where {X<:Any,Y<:Any,F<:Function} | ||
x,y,f = plot[1:3] | ||
|
||
xv = _range(x[]) | ||
yv = _range(y[]) | ||
|
||
Z = xv .+ im*yv' | ||
v = f[].(Z)[end:-1:1,:] # Why do we need to flip it? | ||
|
||
phase!(plot, xv, yv, v, | ||
portrait_type=plot.portrait_type, | ||
ctype=plot.ctype) | ||
|
||
plot | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,43 @@ | ||
using ComplexPhasePortrait, Colors | ||
using Test | ||
|
||
nx = 1000 | ||
x = range(-1, stop=1, length=nx) | ||
Z = x' .+ reverse(x)*im | ||
using Plots | ||
using CairoMakie | ||
|
||
f = z -> (z - 0.5im)^2 * (z + 0.5+0.5im)/z | ||
fz = f.(Z) | ||
@testset "ComplexPhasePortrait" begin | ||
nx = 1000 | ||
x = range(-1, stop=1, length=nx) | ||
Z = x' .+ reverse(x)*im | ||
|
||
img = portrait(fz) | ||
@test img[1,5] ≈ RGB{Float64}(0.11686143572621054,1.0,0.0) | ||
f = z -> (z - 0.5im)^2 * (z + 0.5+0.5im)/z | ||
fz = f.(Z) | ||
|
||
img = portrait(fz, ctype="nist") | ||
@test img[1,5] ≈ RGB{Float64}(0.4916573971078975,1.0,0.0) | ||
img = portrait(fz) | ||
@test img[1,5] ≈ RGB{Float64}(0.11686143572621054,1.0,0.0) | ||
|
||
img = portrait(fz, PTstepphase) | ||
@test img[1,5] ≈ RGB{Float64}(0.09621043816546014,0.8232864637301505,0.0) | ||
img = portrait(fz, ctype="nist") | ||
@test img[1,5] ≈ RGB{Float64}(0.4916573971078975,1.0,0.0) | ||
|
||
img = portrait(fz, PTstepmod) | ||
@test img[1,5] ≈ RGB{Float64}(0.10275080341985139,0.8792533035498697,0.0) | ||
img = portrait(fz, PTstepphase) | ||
@test img[1,5] ≈ RGB{Float64}(0.09621043816546014,0.8232864637301505,0.0) | ||
|
||
img = portrait(fz, PTcgrid) | ||
@test img[1,5] ≈ RGB{Float64}(0.08803468544171197,0.7533253797083627,0.0) | ||
img = portrait(fz, PTstepmod) | ||
@test img[1,5] ≈ RGB{Float64}(0.10275080341985139,0.8792533035498697,0.0) | ||
|
||
img = portrait(fz, PTcgrid) | ||
@test img[1,5] ≈ RGB{Float64}(0.08803468544171197,0.7533253797083627,0.0) | ||
|
||
@testset "Plot recipees" begin | ||
@testset "Plots.jl" begin | ||
for ctype in ["standard", "nist"] | ||
phaseplot(-1..1, -1..1, f, PTcgrid, ctype=ctype; dpi=300) | ||
end | ||
end | ||
|
||
@testset "Makie.jl" begin | ||
for ctype in ["standard", "nist"] | ||
phase(-1..1, -1..1, f, portrait_type=PTcgrid, ctype=ctype) | ||
end | ||
end | ||
end | ||
end |
68d9571
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JuliaRegistrator register
68d9571
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Error while trying to register: Register Failed
@MikaelSlevinsky, it looks like you are not a publicly listed member/owner in the parent organization (JuliaHolomorphic).
If you are a member/owner, you will need to change your membership to public. See GitHub Help
68d9571
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@JuliaRegistrator register
68d9571
There was a problem hiding this comment.
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/123516
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.
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: