-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
86 additions
and
58 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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
name = "BasisFunctions" | ||
uuid = "4343a256-5453-507d-8aad-01a9d7189916" | ||
authors = ["Daan Huybrechs <[email protected]>"] | ||
version = "0.6.4" | ||
version = "0.6.5" | ||
|
||
[deps] | ||
BlockArrays = "8e7c35d0-a365-5155-bbbb-fb81a777f24e" | ||
|
@@ -19,17 +19,23 @@ IterativeSolvers = "42fd0dbc-a981-5370-80f2-aaf504508153" | |
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e" | ||
MacroTools = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09" | ||
OrderedCollections = "bac558e1-5e72-5ebc-8fee-abe8a469f55d" | ||
PGFPlotsX = "8314cec4-20b6-5062-9cdb-752b83310925" | ||
Pkg = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f" | ||
QuadGK = "1fd47b50-473d-5c70-9696-f719f8f3bcdc" | ||
RecipesBase = "3cdcf5f2-1ef4-517c-9805-6587b60abb01" | ||
Reexport = "189a3867-3050-52da-a836-e630ba90ab69" | ||
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf" | ||
SpecialFunctions = "276daf66-3868-5448-9aa4-cd146d93841b" | ||
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182" | ||
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" | ||
ToeplitzMatrices = "c751599d-da0a-543b-9d20-d0a503d91d24" | ||
|
||
[weakdeps] | ||
PGFPlotsX = "8314cec4-20b6-5062-9cdb-752b83310925" | ||
RecipesBase = "3cdcf5f2-1ef4-517c-9805-6587b60abb01" | ||
|
||
[extensions] | ||
BasisFunctionsRecipesBaseExt = "RecipesBase" | ||
BasisFunctionsPGFPlotsXExt = "PGFPlotsX" | ||
|
||
[compat] | ||
BlockArrays = "0.16" | ||
CompositeTypes = "0.1.3" | ||
|
@@ -52,7 +58,7 @@ Reexport = "1.0" | |
SpecialFunctions = "1.0, 2.0" | ||
StaticArrays = "1.4" | ||
ToeplitzMatrices = "0.7" | ||
julia = "1.6" | ||
julia = "1.9" | ||
|
||
[extras] | ||
Calculus = "49dc2e85-a5d0-5ad3-a950-438e2897f1b9" | ||
|
@@ -61,4 +67,4 @@ Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80" | |
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" | ||
|
||
[targets] | ||
test = ["Plots", "Random", "Calculus", "DoubleFloats"] | ||
test = ["PGFPlotsX", "Plots", "Random", "RecipesBase", "Calculus", "DoubleFloats"] |
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
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 |
---|---|---|
@@ -0,0 +1,40 @@ | ||
|
||
"Return a grid suitable for plotting a function in the given dictionary." | ||
function plotgrid end | ||
"Process plotting data before it is visualized." | ||
function plot_postprocess end | ||
|
||
# For regular Expansions, no postprocessing is needed | ||
function plot_postprocess(S::Dictionary, grid, vals) | ||
D = support(S) | ||
I = grid .∉ Ref(D) | ||
vals[I] .= Inf | ||
vals | ||
end | ||
|
||
# For function subsets, revert to the underlying Dictionary for postprocessing | ||
plot_postprocess(S::Subdictionary, grid, vals) = plot_postprocess(superdict(S), grid, vals) | ||
plot_postprocess(φ::AbstractBasisFunction, grid, vals) = plot_postprocess(dictionary(φ), grid, vals) | ||
|
||
## Plotting grids | ||
# Always plot on equispaced grids for the best plotting resolution | ||
plotgrid(S::Dictionary1d, n) = EquispacedGrid(n, support(S)) | ||
# look at first element by default | ||
plotgrid(S::MultiDict, n) = plotgrid(component(S,1), n) | ||
plotgrid(S::DerivedDict, n) = plotgrid(superdict(S),n) | ||
# NOTE: This only supports multi-dimensional tensor product dicts. | ||
plotgrid(F::TensorProductDict2, n) = plotgrid(component(F,1),n)×plotgrid(component(F,2),n) | ||
plotgrid(F::OperatedDict, n) = plotgrid(superdict(F), n) | ||
plotgrid(F::Subdictionary, n) = plotgrid(superdict(F), n) | ||
plotgrid(φ::AbstractBasisFunction, n) = plotgrid(dictionary(φ), n) | ||
|
||
# generic fallback for suitable plotting grids | ||
plotgrid(S::Dictionary, n) = plotgrid_domain(n, support(S)) | ||
plotgrid_domain(n::Int, domain::AbstractInterval) = EquispacedGrid(n, domain) | ||
plotgrid_domain(n::Int, domain::ProductDomain) = | ||
productgrid(map(d->plotgrid_domain(n, d), factors(domain))...) | ||
function plotgrid_domain(n::Int, domain) | ||
box = boundingbox(domain) | ||
g = plotgrid_domain(n, box) | ||
MaskedGrid(g, domain) | ||
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
2e5d6fb
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
2e5d6fb
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/115558
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:
2e5d6fb
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
Release notes:
2e5d6fb
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 updated: JuliaRegistries/General/115558
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: