Skip to content

fix: BSPlineKit 0.18 is not breaking, but now exports fit, which runs into a conflict #252

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

Merged
merged 3 commits into from
Mar 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion docs/literate/explanations/nonlinear_effects.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@



using BSplineKit, Unfold
import BSplineKit
using Unfold
using CairoMakie
using DataFrames
using Random
Expand Down
4 changes: 2 additions & 2 deletions docs/src/references/extensions.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ using Unfold
To use robust (outlier-"safe") solvers support as described in @Ref(custom_solvers) you have to:

```julia
using RobustSolvers
import RobustSolvers
using Unfold
```

Expand All @@ -26,7 +26,7 @@ using Unfold
Finally to use non-linear effects/splines like in `@formula 0~1+spl(continuous,5)` you have to use:

```julia
using BSplineKit
import BSplineKit
using Unfold
```

Expand Down
8 changes: 7 additions & 1 deletion ext/UnfoldBSplineKitExt/UnfoldBSplineKitExt.jl
Original file line number Diff line number Diff line change
@@ -1,6 +1,12 @@
module UnfoldBSplineKitExt
using Unfold
using BSplineKit
import BSplineKit:
BSplineOrder,
BSplineBasis,
boundaries,
period,
PeriodicBSplineBasis,
basis_to_array_index
using StatsModels
import StatsModels: termvars, width, coefnames, modelcols, apply_schema
import Base: show
Expand Down
2 changes: 1 addition & 1 deletion ext/UnfoldBSplineKitExt/basisfunctions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ end

function splinekernel(e, times, nsplines)
breakpoints = spl_breakpoints(times, nsplines)
basis = BSplineKit.BSplineBasis(BSplineOrder(4), breakpoints) # 4= cubic
basis = BSplineBasis(BSplineOrder(4), breakpoints) # 4= cubic
return sparse(splFunction(times, basis))
end

Expand Down
2 changes: 1 addition & 1 deletion ext/UnfoldBSplineKitExt/splinepredictors.jl
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ function splFunction(x::AbstractVector, spl::PeriodicBSplineTerm)
end

function splFunction(x::AbstractVector, spl::BSplineTerm)
basis = BSplineKit.BSplineBasis(BSplineOrder(spl.order), deepcopy(spl.breakpoints))
basis = BSplineBasis(BSplineOrder(spl.order), deepcopy(spl.breakpoints))
_splFunction(x, basis)
end
#spl(x,df) = Splines2.bs(x,df=df,intercept=true) # assumes intercept
Expand Down
2 changes: 1 addition & 1 deletion test/setup.jl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ using StatsBase
using Missings
using StableRNGs

using RobustModels, BSplineKit # extensionTriggers
import RobustModels, BSplineKit # extensionTriggers
using SparseArrays
using UnfoldSim
using Interpolations
Expand Down
Loading