-
Notifications
You must be signed in to change notification settings - Fork 51
Started DimensionalDataInterpolationsExt.jl
for AbstractDimVector
s
#1091
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
498e78c
to
aa5a061
Compare
I don't know how to stop the other CI runs before my latest force-push 😭 |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1091 +/- ##
==========================================
+ Coverage 86.86% 86.89% +0.02%
==========================================
Files 54 55 +1
Lines 5307 5317 +10
==========================================
+ Hits 4610 4620 +10
Misses 697 697 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
||
""" | ||
``` | ||
(::DataInterpolations.AbstractInterpolation)( |
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.
(::DataInterpolations.AbstractInterpolation)( | |
(::Type{<: DataInterpolations.AbstractInterpolation})( |
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.
I would actually document each one separately, if you are running this in an @eval
loop.
function DataInterpolations.QuadraticInterpolation( | ||
data::AbstractDimVector, | ||
mode::Symbol, | ||
args...; | ||
kw... | ||
) | ||
return QuadraticInterpolation( | ||
data |> parent, | ||
dims(data) |> only |> parent |> parent, | ||
mode, | ||
args...; | ||
kw... | ||
) | ||
end |
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.
If these are all the same, I would recommend defining them in an @eval
loop for simplicity and ease of editing
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.
Unfortunately, they're not all the same. Some require or have options for one or more arguments.
Additionally, one of them isa Function
and not a struct
.
Project.toml
Outdated
DimensionalDataAlgebraOfGraphicsExt = "AlgebraOfGraphics" | ||
DimensionalDataCategoricalArraysExt = "CategoricalArrays" | ||
DimensionalDataDiskArraysExt = "DiskArrays" | ||
DimensionalDataInterpolationsExt = "DataInterpolations" |
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.
DimensionalDataInterpolationsExt = "DataInterpolations" | |
DimensionalDataDataInterpolationsExt = "DataInterpolations" |
Two datas in a row, I know, but this makes it consistent with the rest of the extensions (and I think there was also an Interpolations.jl extension PR)
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.
What about the discussed solution of brevity where, Julia already displays the base package in addition to the extension, so we should just be naming it DataInterpolationsExt.jl
?
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.
Have to agree with @asinghvi17, just go with the standard. We actually messed it up in the past and I mean to standardise the rest too.
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.
Docs in tabs are great.
And this is a good, straightforward place to start
docs/src/interpolations.md
Outdated
|
||
# Interpolation of `DimensionalData.jl` Objects | ||
|
||
The following functionalities are experimental and under development. |
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.
Semver and breakage is the key thing to mention here, otherwise it's not clear what this means practically.
) | ||
return Itp( | ||
data |> parent, | ||
dims(data) |> only |> parent |> parent, |
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.
We should think about Points vs Intervals here, may need to use shiftlocus(Center(), dim)
to standardise everything (the lookup values can also be the Start()
of the interval)
Also, this line can be an internal function we use for all the constructors.
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.
Also, this line can be an internal function we use for all the constructors.
Not really, different interpolation packages have different interfaces.
Unless I've understood you incorrectly.
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.
may need to use
shiftlocus
I need an explanation/demonstration for this.
docs/src/interpolations.md
Outdated
For the following examples, the following `DimArray` is used: | ||
|
||
```@ansi Interpolation1D | ||
y = DimArray( |
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.
I would use a name besides y
, as it suggests a Y
dimension. da
is an obvious one, or just A
Thanks a tonne guys! |
Take 2. Critiques please 😁 |
Uh, should I rebase it? If so, where? |
You can rebase main if you want |
@kapple19 it turns out I need this for work so I'm going to have a go at DimInterpolator objects and stacks of them based on DataInterpolations.jl |
Sounds good. |
No problem, I haven't had much time anyway |
First pass at interpolation wrappers.
Critiques please 😊