2
2
3
3
module Sunny
4
4
5
+ using Requires
5
6
using LinearAlgebra
6
7
using StaticArrays
7
8
using OffsetArrays
@@ -17,15 +18,6 @@ using FilePaths: Path
17
18
using CrystalInfoFramework
18
19
import Spglib
19
20
20
- # Make best effort to determine if this is a headless machine -- A non-Apple
21
- # Unix (e.g. Linux) without the DISPLAY environment variable set.
22
- const _headless = Sys. isunix () && ! Sys. isapple () && ! haskey (ENV , " DISPLAY" )
23
- @static _headless ? (
24
- check_graphics_available () = error (" Graphics functions are unavailable on a headless machine." )
25
- ) : (
26
- using GLMakie; check_graphics_available () = nothing
27
- )
28
-
29
21
# TODO : Remove in Julia 1.7
30
22
using Parameters: @unpack
31
23
@@ -73,15 +65,20 @@ include("StructureFactors.jl")
73
65
export StructureFactor, update!, apply_dipole_factor, zero!
74
66
export dynamic_structure_factor, static_structure_factor
75
67
76
- include (" Plotting.jl" )
77
- export plan_spintraj_fft!
78
- export plot_lattice, plot_spins, plot_bonds, plot_all_bonds
79
- export anim_integration, live_integration, live_langevin_integration
80
68
81
69
include (" WangLandau/BinnedArray.jl" )
82
70
export BinnedArray, filter_visited, reset!
83
71
84
72
include (" WangLandau/WangLandau.jl" )
85
73
export WangLandau, spherical_cap_update, init_bounded!, run!
86
74
75
+ function __init__ ()
76
+ @require GLMakie= " e9467ef8-e4e7-5192-8a1a-b1aee30e663a" begin
77
+ include (" Plotting.jl" )
78
+ export plan_spintraj_fft!
79
+ export plot_lattice, plot_spins, plot_bonds, plot_all_bonds
80
+ export anim_integration, live_integration, live_langevin_integration
81
+ end
82
+ end
83
+
87
84
end
0 commit comments