Skip to content

Commit

Permalink
Remove Requires.jl (#169)
Browse files Browse the repository at this point in the history
* remove Requires statements in SummationByPartsOperators.jl ext

* remove requires statements in StartUpDG.jl

* add Plots extension

* remove unnecessary [extras] section (since we have test/Project.toml)

* remove unnecessary compat restriction on SummationByPartsOperators.jl

* add TriangulatePlotExt

* remove Requires.jl

* add to NEWS.md
  • Loading branch information
jlchan authored May 21, 2024
1 parent 192c7d0 commit bfa905c
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 46 deletions.
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ Most of the major changes are tracked in this [PR](https://github.com/jlchan/Sta
* Removed SimpleUnpack.jl as a dependency. Loading StartUpDG.jl will no longer reexport `@unpack`, since destructuring via `(; propertyname) = x` is supported natively in Julia 1.7 and up.
* Updated to NodesAndModes v1, which changed the ordering of triangle nodes to make them consistent with tet node ordering.
* We introduced a `MultidimensionalQuadrature` type. All `Polynomial` approximation types now utilize either `MultidimensionalQuadrature` or `TensorProductQuadrature` as a type parameter. The previous type parameter `DefaultPolynomialType` is now simply used to determine the default quadrature type parameter. Note that this is internal behavior and should not impact standard usage of StartUpDG.jl.
* Removed Requires.jl in favor of [package extensions](https://pkgdocs.julialang.org/v1/creating-packages/#Conditional-loading-of-code-in-packages-(Extensions)) for Plots.jl and SummationByPartsOperators.jl dependencies.



## Changes when updating to v0.17
Expand Down
11 changes: 4 additions & 7 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,18 +15,19 @@ Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
RecipesBase = "3cdcf5f2-1ef4-517c-9805-6587b60abb01"
RecursiveArrayTools = "731186ca-8d62-57ce-b412-fbd966d074cd"
Reexport = "189a3867-3050-52da-a836-e630ba90ab69"
Requires = "ae029012-a4dd-5104-9daa-d747884805df"
Setfield = "efcf1570-3423-57d1-acb7-fd33fddbac46"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
Triangulate = "f7e6ffb2-c36d-4f8f-a77e-16e897189344"
WriteVTK = "64499a7a-5c06-52f2-abe2-ccb03c286192"

[weakdeps]
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
SummationByPartsOperators = "9f78cca6-572e-554e-b819-917d2f1cf240"

[extensions]
StartUpDGSummationByPartsOperatorsExt = "SummationByPartsOperators"
TriangulatePlotsExt = "Plots"

[compat]
ConstructionBase = "1"
Expand All @@ -38,14 +39,10 @@ PathIntersections = "0.1, 0.2"
RecipesBase = "1"
RecursiveArrayTools = "3"
Reexport = "1"
Requires = "1"
Setfield = "1"
SparseArrays = "1"
StaticArrays = "1"
SummationByPartsOperators = "0.5.52"
SummationByPartsOperators = "0.5"
Triangulate = "2"
WriteVTK = "1"
julia = "1.10"

[extras]
SummationByPartsOperators = "9f78cca6-572e-554e-b819-917d2f1cf240"
julia = "1.10"
28 changes: 8 additions & 20 deletions ext/StartUpDGSummationByPartsOperatorsExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,14 @@ using SparseArrays: sparse, droptol!, spzeros
using StartUpDG

# Required for visualization code
if isdefined(Base, :get_extension)
using SummationByPartsOperators:
SummationByPartsOperators,
DerivativeOperator,
grid,
AbstractDerivativeOperator,
AbstractNonperiodicDerivativeOperator,
PeriodicDerivativeOperator,
AbstractPeriodicDerivativeOperator
else
# Until Julia v1.9 is the minimum required version for Trixi.jl, we still support Requires.jl
using ..SummationByPartsOperators
using ..SummationByPartsOperators:
AbstractDerivativeOperator,
AbstractPeriodicDerivativeOperator,
AbstractNonperiodicDerivativeOperator,
DerivativeOperator,
PeriodicDerivativeOperator,
grid
end
using SummationByPartsOperators:
SummationByPartsOperators,
DerivativeOperator,
grid,
AbstractDerivativeOperator,
AbstractNonperiodicDerivativeOperator,
PeriodicDerivativeOperator,
AbstractPeriodicDerivativeOperator

function construct_1d_operators(D::AbstractDerivativeOperator, tol)
nodes_1d = collect(grid(D))
Expand Down
4 changes: 2 additions & 2 deletions src/TriangulatePlots.jl → ext/TriangulatePlotsExt.jl
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
module TriangulatePlots
module TriangulatePlotsExt

using StartUpDG: BoundaryTagPlotter, RecipesBase

using ..Plots: Plots
using Plots: Plots

RecipesBase.@recipe function f(m::BoundaryTagPlotter)
triout = m.triout
Expand Down
16 changes: 0 additions & 16 deletions src/StartUpDG.jl
Original file line number Diff line number Diff line change
Expand Up @@ -103,20 +103,4 @@ export CircularDomain, PartialCircularDomain
include("explicit_timestep_utils.jl")
export ck45 # LSERK 45


using Requires: @require

function __init__()
@require Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80" begin
include("TriangulatePlots.jl")
end

# Until Julia v1.9 is the minimum required version for StartUpDG.jl, we still support Requires.jl
@static if !isdefined(Base, :get_extension)
@require SummationByPartsOperators = "9f78cca6-572e-554e-b819-917d2f1cf240" begin
include("../ext/StartUpDGSummationByPartsOperatorsExt.jl")
end
end
end

end # module
2 changes: 1 addition & 1 deletion test/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,5 +13,5 @@ HOHQMesh = "0.2"
Plots = "1"
StaticArrays = "1"
StructArrays = "0.6"
SummationByPartsOperators = "0.5.52"
SummationByPartsOperators = "0.5"
Suppressor = "0.2"

0 comments on commit bfa905c

Please sign in to comment.