From 854f1f71398198138fa73217dc1e404fea253e43 Mon Sep 17 00:00:00 2001 From: Kipton Barros Date: Fri, 6 Dec 2024 14:49:56 -0700 Subject: [PATCH] Refine documentation and prepare Sunny 0.7.4 release (#340) --- docs/make.jl | 2 +- docs/src/library.md | 8 ++++---- docs/src/structure-factor.md | 4 ++-- docs/src/versions.md | 14 ++++++++------ ext/PlottingExt/ViewQSpace.jl | 4 ++-- src/Sunny.jl | 5 +++-- src/Symmetry/BZPaths.jl | 6 +++--- 7 files changed, 23 insertions(+), 20 deletions(-) diff --git a/docs/make.jl b/docs/make.jl index 8cf93e318..cd9849998 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -126,7 +126,7 @@ Documenter.makedocs(; "Contributed" => contributed_mds, ], "library.md", - "Details" => [ + "Notes and Details" => [ "structure-factor.md", "renormalization.md", "parallelism.md", diff --git a/docs/src/library.md b/docs/src/library.md index baca8f825..e7ff1e891 100644 --- a/docs/src/library.md +++ b/docs/src/library.md @@ -116,12 +116,12 @@ Load a Makie graphics package (`GLMakie`, `WGLMakie`, or `CairoMakie`) to enable the following extensions: ```@docs -plot_spins -plot_spins! +view_bz +view_crystal plot_intensities plot_intensities! -view_crystal -view_qspace +plot_spins +plot_spins! ``` ## Optional WriteVTK extensions diff --git a/docs/src/structure-factor.md b/docs/src/structure-factor.md index 66bf079d3..600d946f1 100644 --- a/docs/src/structure-factor.md +++ b/docs/src/structure-factor.md @@ -142,12 +142,12 @@ where $\tilde{𝐪}$ expresses momentum in dimensionless reciprocal lattice unit ```math \begin{equation} -𝐪 = \tilde{k}_1 𝐛_1 + \tilde{k}_2 𝐛_2 + \tilde{k}_3 𝐛_3, +𝐪 = \tilde{q}_1 𝐛_1 + \tilde{q}_2 𝐛_2 + \tilde{q}_3 𝐛_3, \end{equation} ``` and $𝐛_{\{1,2,3\}}$ are the reciprocal lattice vectors. Equivalently, -$\tilde{k}_μ ≡ 𝐪 ⋅ 𝐚_μ / 2π$. +$\tilde{q}_μ ≡ 𝐪 ⋅ 𝐚_μ / 2π$. It will be convenient to introduce a dynamical correlation for the operators on sublattices $i$ and $j$ only, diff --git a/docs/src/versions.md b/docs/src/versions.md index 38bfd8264..438ef5124 100644 --- a/docs/src/versions.md +++ b/docs/src/versions.md @@ -1,18 +1,20 @@ # Version History ## v0.7.4 -(In development) +(Dec 6, 2024) * Higher-precision convergence in [`minimize_energy!`](@ref). * Make [`minimize_energy!`](@ref) compatible with [`set_vacancy_at!`](@ref). -* The `System` constructor now seeds its internal random number generator using - Julia's task-local random number generator. +* The [`System`](@ref) constructor now seeds its internal random number + generator using Julia's task-local random number generator. * Add [`print_irreducible_bz_paths`](@ref), which builds on [Brillouin.jl](https://github.com/thchr/Brillouin.jl) and [SeeK-path](http://www.materialscloud.org/tools/seekpath/). -* Add prototype function [`view_qspace`](@ref) for visualizing reciprocal-space - objects in the context of the first Brillouin zone. -* Fix `load_nxs` for compatibility with recent JLD2. +* Add function [`view_bz`](@ref) for visualizing reciprocal-space objects in the + context of the first Brillouin zone. +* Fix [`load_nxs`](@ref) for compatibility with recent JLD2. +* Fix Makie precompiles for faster time-to-first-plot in Julia 1.11 ([PR + #329](https://github.com/SunnySuite/Sunny.jl/pull/329)). ## v0.7.3 (Nov 12, 2024) diff --git a/ext/PlottingExt/ViewQSpace.jl b/ext/PlottingExt/ViewQSpace.jl index 0f0acc3a0..d9c89c2a3 100644 --- a/ext/PlottingExt/ViewQSpace.jl +++ b/ext/PlottingExt/ViewQSpace.jl @@ -45,7 +45,7 @@ end """ - view_qspace(crystal::Crystal, objs...; orthographic=false, compass=true) + view_bz(crystal::Crystal, objs...; orthographic=false, compass=true) **Experimental** @@ -59,7 +59,7 @@ visualize custom paths or grids in reciprocal space. - `orthographic`: Use orthographic camera perspective. - `compass`: If true, draw Cartesian axes in bottom left. """ -function Sunny.view_qspace(cryst::Crystal, objs...; orthographic=false, compass=true, size=(768, 512)) +function Sunny.view_bz(cryst::Crystal, objs...; orthographic=false, compass=true, size=(768, 512)) fig = Makie.Figure(; size) # Main scene diff --git a/src/Sunny.jl b/src/Sunny.jl index 6bee08d03..f6c655c30 100644 --- a/src/Sunny.jl +++ b/src/Sunny.jl @@ -150,7 +150,7 @@ end extension_fns = [ # ext/PlottingExt :Makie => [:plot_spins!, :plot_spins, :plot_intensities!, :plot_intensities, - :view_crystal, :view_qspace], + :view_crystal, :view_bz], # ext/ExportVTKExt :WriteVTK => [:export_vtk], ] @@ -169,7 +169,8 @@ function __init__() fn = Symbol(exc.f) for (pkg, fns) in extension_fns if in(fn, fns) && !is_pkg_loaded(pkg) - printstyled(io, "\nImport package $pkg to enable `$fn`.\n"; bold=true) + pkgstr = (pkg == :Makie) ? "a variant of Makie" : "package $pkg" + printstyled(io, "\nImport $pkgstr to enable `$fn`.\n"; bold=true) end end end diff --git a/src/Symmetry/BZPaths.jl b/src/Symmetry/BZPaths.jl index e10c78b9f..84e2abfc6 100644 --- a/src/Symmetry/BZPaths.jl +++ b/src/Symmetry/BZPaths.jl @@ -34,7 +34,7 @@ originally formulated in Ref. [1] and implemented in functionality from the [Brillouin.jl](https://github.com/thchr/Brillouin.jl) package. -See also [`view_qspace`](@ref) for an interactive visualization of these +See also [`view_bz`](@ref) for an interactive visualization of these high-symmetry paths. ## References @@ -44,8 +44,8 @@ high-symmetry paths. (2017)](https://doi.org/10.1016/j.commatsci.2016.10.015). """ function print_irreducible_bz_paths(cryst::Crystal) - try - (; points, paths) = irreducible_bz_paths(cryst) + (; points, paths) = try + irreducible_bz_paths(cryst) catch e if startswith(e.msg, "Triclinic") rethrow(ErrorException("""Triclinic lattice angles must currently be all-acute or all-obtuse.