Skip to content

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
kbarros committed Jan 18, 2025
1 parent fc7461f commit a6f7515
Show file tree
Hide file tree
Showing 6 changed files with 26 additions and 25 deletions.
8 changes: 4 additions & 4 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,15 @@ WGLMakiePrecompilesExt = ["Makie", "WGLMakie"]

[compat]
Brillouin = "0.5.19"
CrystalInfoFramework = "0.7.0"
CrystalInfoFramework = "0.8"
DynamicPolynomials = "0.6.0"
ElasticArrays = "1.2.12"
FFTW = "1.4.5"
GLMakie = "0.9, 0.10"
GLMakie = "0.9, 0.10, 0.11"
HCubature = "1.7.0"
JLD2 = "0.5.4"
LinearAlgebra = "1.10"
Makie = "0.20, 0.21.1"
Makie = "0.20, 0.21.1, 0.22"
OffsetArrays = "1.10.8"
Optim = "1.7.6"
PrecompileTools = "1.2.0"
Expand All @@ -56,6 +56,6 @@ SpecialFunctions = "2.1.0"
Spglib = "0.9.4"
StaticArrays = "1.9.1"
Statistics = "1.10"
WGLMakie = "0.9, 0.10"
WGLMakie = "0.9, 0.10, 0.11"
WriteVTK = "1.18.0"
julia = "1.10"
1 change: 1 addition & 0 deletions docs/src/versions.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
* The `regularization` parameter in [`SpinWaveTheory`](@ref) is reduced by half,
and now corresponds to an effective energy shift. This may affect intensities,
especially at small excitation energies.
* Update dependencies and in particular fix `color` compile error.

## v0.7.4
(Dec 6, 2024)
Expand Down
14 changes: 7 additions & 7 deletions ext/PlottingExt/PlotSpins.jl
Original file line number Diff line number Diff line change
Expand Up @@ -126,9 +126,9 @@ function Sunny.plot_spins!(ax, sys::System; notifier=Makie.Observable(nothing),
end

# These observables will be reanimated upon calling `notify(notifier)`.
vecs = Makie.Observable(Makie.Vec3f0[])
pts = Makie.Observable(Makie.Point3f0[])
pts_shifted = Makie.Observable(Makie.Point3f0[])
vecs = Makie.Observable(Makie.Vec3f[])
pts = Makie.Observable(Makie.Point3f[])
pts_shifted = Makie.Observable(Makie.Point3f[])
arrowcolor = Makie.Observable(Makie.RGBAf[])

Makie.on(notifier, update=true) do _
Expand All @@ -145,9 +145,9 @@ function Sunny.plot_spins!(ax, sys::System; notifier=Makie.Observable(nothing),
v = (lengthscale / s0) * vec(sys.dipoles[site])
pt = supervecs * (rs[site] + n)
pt_shifted = pt - arrow_fractional_shift * v
push!(vecs[], Makie.Vec3f0(v))
push!(pts[], Makie.Point3f0(pt))
push!(pts_shifted[], Makie.Point3f0(pt_shifted))
push!(vecs[], Makie.Vec3f(v))
push!(pts[], Makie.Point3f(pt))
push!(pts_shifted[], Makie.Point3f(pt_shifted))
push!(arrowcolor[], rgba_colors[site])
end
# Trigger Makie redraw
Expand All @@ -166,7 +166,7 @@ function Sunny.plot_spins!(ax, sys::System; notifier=Makie.Observable(nothing),
# Bounding box of original crystal unit cell in teal
if show_cell
Makie.linesegments!(ax, cell_wireframe(orig_crystal(sys).latvecs, ndims); color=:teal, linewidth=1.5)
pos = [(3/4)*Makie.Point3f0(p) for p in eachcol(orig_crystal(sys).latvecs)[1:ndims]]
pos = [(3/4)*Makie.Point3f(p) for p in eachcol(orig_crystal(sys).latvecs)[1:ndims]]
text = [Makie.rich("a", Makie.subscript(repr(i))) for i in 1:ndims]
Makie.text!(ax, pos; text, color=:black, fontsize=20, font=:bold, glowwidth=4.0,
glowcolor=(:white, 0.6), align=(:center, :center), depth_shift=-1f0)
Expand Down
12 changes: 6 additions & 6 deletions ext/PlottingExt/PlottingUtils.jl
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ function register_compass_callbacks(axcompass, lscene)
refcam = lscene.scene.camera_controls
Makie.onany(refcam.eyeposition, refcam.lookat, refcam.upvector; update=true) do cam_eye, cam_lookat, cam_upvector
eye = 4normalize(cam_eye - cam_lookat)
lookat = Makie.Point3f0(0, 0, 0)
lookat = Makie.Point3f(0, 0, 0)
Makie.update_cam!(axcompass.scene, eye, lookat, cam_upvector)
end
end
Expand All @@ -187,8 +187,8 @@ function add_cartesian_compass(fig, lscene; left=0, right=150, bottom=0, top=150
axcompass = Makie.LScene(fig, bbox=Makie.BBox(left, right, bottom, top), show_axis=false)

# Draw arrows at origin
pts = [Makie.Point3f0(0, 0, 0), Makie.Point3f0(0, 0, 0), Makie.Point3f0(0, 0, 0)]
vecs = [Makie.Point3f0(1, 0, 0), Makie.Point3f0(0, 1, 0), Makie.Point3f0(0, 0, 1)]
pts = [Makie.Point3f(0, 0, 0), Makie.Point3f(0, 0, 0), Makie.Point3f(0, 0, 0)]
vecs = [Makie.Point3f(1, 0, 0), Makie.Point3f(0, 1, 0), Makie.Point3f(0, 0, 1)]
Makie.arrows!(axcompass, pts, 0.8*vecs; color=[:red, :orange, :yellow], arrowsize=0.3, inspectable=false)

# Draw labels
Expand All @@ -213,10 +213,10 @@ function add_cartesian_compass(fig, lscene; left=0, right=150, bottom=0, top=150
end

function cell_wireframe(latvecs, ndims)
vecs = Makie.Point3f0.(eachcol(latvecs))
ret = Tuple{Makie.Point3f0, Makie.Point3f0}[]
vecs = Makie.Point3f.(eachcol(latvecs))
ret = Tuple{Makie.Point3f, Makie.Point3f}[]

origin = zero(Makie.Point3f0)
origin = zero(Makie.Point3f)

if ndims == 3
for j in 0:1, k in 0:1
Expand Down
6 changes: 3 additions & 3 deletions ext/PlottingExt/ViewCrystal.jl
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ function draw_exchange_geometries(; ax, obs, ionradius, pts, scaled_exchanges)
### we apply some heuristic amplification to the arrow size.

dmvecs = Sunny.extract_dmvec.(scaled_exchanges)
dirs = @. Makie.Vec3f0(normalize(dmvecs))
dirs = @. Makie.Vec3f(normalize(dmvecs))
# The largest possible ellipsoid occurs in the case of `scalings ==
# [1,1,1]`, yielding a sphere with size `ionradius`.
ellipsoid_radii = @. ionradius * norm(scalings) / 3
Expand All @@ -232,7 +232,7 @@ function draw_bonds(; ax, obs, ionradius, exchange_mag, cryst, interactions, bon
# Map each bond to line segments in global coordinates
segments = map(bonds) do b
(; ri, rj) = Sunny.BondPos(cryst, b)
Makie.Point3f0.(Ref(cryst.latvecs) .* (ri, rj))
Makie.Point3f.(Ref(cryst.latvecs) .* (ri, rj))
end

# If the bonds are distinct from the refbonds, then add periodic "ghost" images
Expand Down Expand Up @@ -602,7 +602,7 @@ function view_crystal_aux(cryst, sys; refbonds, orthographic, ghost_radius, ndim

# Show cell volume
Makie.linesegments!(ax, cell_wireframe(cryst.latvecs, ndims); color=:teal, linewidth=1.5, inspectable=false)
pos = [(3/4)*Makie.Point3f0(p) for p in eachcol(cryst.latvecs)[1:ndims]]
pos = [(3/4)*Makie.Point3f(p) for p in eachcol(cryst.latvecs)[1:ndims]]
text = [Makie.rich("a", Makie.subscript(repr(i))) for i in 1:ndims]
Makie.text!(ax, pos; text, color=:black, fontsize=20, font=:bold, glowwidth=4.0,
glowcolor=(:white, 0.6), align=(:center, :center), depth_shift=-1f0)
Expand Down
10 changes: 5 additions & 5 deletions ext/PlottingExt/ViewQSpace.jl
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ function Sunny.view_bz(cryst::Crystal, objs...; orthographic=false, compass=true
button = Makie.Button(fig; label="Reset", fontsize)
Makie.onany(button.clicks, menu.selection; update=true) do _, mselect
b1, b2, _ = eachcol(cryst.recipvecs)
lookat = zero(Makie.Point3f0)
lookat = zero(Makie.Point3f)
camshiftdir = normalize(b1 + b2)
upvector = normalize(b1 × b2)
camdist = 1.5 * maximum(norm.(eachcol(cryst.recipvecs)))
Expand All @@ -94,8 +94,8 @@ function Sunny.view_bz(cryst::Crystal, objs...; orthographic=false, compass=true
widget_list[widget_cnt+=1, 1] = Makie.hgrid!(menu, button)

# Show reciprocal vectors
bs = collect(Makie.Point3f0.(eachcol(cryst.recipvecs)))
b_segments = [(zero(Makie.Point3f0), b) for b in bs]
bs = collect(Makie.Point3f.(eachcol(cryst.recipvecs)))
b_segments = [(zero(Makie.Point3f), b) for b in bs]
Makie.linesegments!(ax, b_segments; color=:teal, linewidth=1.5, inspectable=false)

text = [Makie.rich("b", Makie.subscript(repr(i))) for i in 1:3]
Expand All @@ -104,11 +104,11 @@ function Sunny.view_bz(cryst::Crystal, objs...; orthographic=false, compass=true

# Calculate and show Brillouin zone
bzcell = Brillouin.cartesianize!(Brillouin.wignerseitz(eachcol(Sunny.prim_recipvecs(cryst))))
segments = Makie.Point3f0[]
segments = Makie.Point3f[]
for face in bzcell
append!(segments, face)
push!(segments, face[1]) # cycle to first point
push!(segments, Makie.Point3f0(NaN)) # separator between faces
push!(segments, Makie.Point3f(NaN)) # separator between faces
end
Makie.lines!(ax, segments; inspectable=false)

Expand Down

0 comments on commit a6f7515

Please sign in to comment.