# What would it take to bring this Julia 0.6 package to Julia 1.6?

**URL:** <https://discourse.julialang.org/t/what-would-it-take-to-bring-this-julia-0-6-package-to-julia-1-6/59652>\
**Category:** General Usage\
**Created:** [April 20, 2021, 9:45am UTC](https://discourse.julialang.org/t/what-would-it-take-to-bring-this-julia-0-6-package-to-julia-1-6/59652 "2021-04-20T09:45:46Z")\
**Posts on this page:** 12\
**Page:** 2

<div class="post-metadata">

**Author:** ![oheil](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oheil/32/220745_2.png) [@oheil](https://discourse.julialang.org/u/oheil)\
**Post date:** [April 20, 2021, 12:10pm UTC](https://discourse.julialang.org/t/what-would-it-take-to-bring-this-julia-0-6-package-to-julia-1-6/59652/22 "2021-04-20T12:10:39Z")

</div>

Looks good so far for me.  
There is a long loop in constrsparsereg\_admm.jl over k and after the loop in line 640 it is with my change:

```julia
       k=maxiters #loop var k is out of scope here after the loop, so set it to the max

       βpath = βpath[:, 1:k-1]
       deleteat!(ρpath, k:length(ρpath))
       deleteat!(objvalpath, k:length(objvalpath))
       deleteat!(dfpath, k:length(dfpath))
       dfpath[dfpath .< 0] = 0;

```

---

<div class="post-metadata">

**Author:** ![oheil](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oheil/32/220745_2.png) [@oheil](https://discourse.julialang.org/u/oheil)\
**Post date:** [April 20, 2021, 12:12pm UTC](https://discourse.julialang.org/t/what-would-it-take-to-bring-this-julia-0-6-package-to-julia-1-6/59652/23 "2021-04-20T12:12:13Z")

</div>

You actually solved

```julia
MethodError: no method matching sumsquares(::Array{Convex.MultiplyAtom,1})

```

faster than I did, and I am a complete novice to these ConstrainedLasso things, so don’t expect too much from me.

---

<div class="post-metadata">

**Author:** ![yha](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/yha/32/3502_2.png) [@yha](https://discourse.julialang.org/u/yha)\
**Post date:** [April 20, 2021, 12:19pm UTC](https://discourse.julialang.org/t/what-would-it-take-to-bring-this-julia-0-6-package-to-julia-1-6/59652/24 "2021-04-20T12:19:07Z")

</div>

> [@lrnv](#):
>
> I do not unserstand as i `add` ed it…

`]dev` looks up the name of the package in the registry, not among your `add`ed packages. If you used a URL or local path to do the `]add` the package, you should specify it again for `]dev`.

---

<div class="post-metadata">

**Author:** ![lrnv](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lrnv/32/19373_2.png) [@lrnv](https://discourse.julialang.org/u/lrnv)\
**Post date:** [April 20, 2021, 12:32pm UTC](https://discourse.julialang.org/t/what-would-it-take-to-bring-this-julia-0-6-package-to-julia-1-6/59652/25 "2021-04-20T12:32:50Z")

</div>

> [@oheil](#):
>
> Looks good so far for me.  
> There is a long loop in constrsparsereg\_admm.jl over k and after the loop in line 640 it is with my change:
> 
> ```julia-auto
> k=maxiters #loop var k is out of scope here after the loop, so set it to the max
> 
> βpath = βpath[:, 1:k-1]
> deleteat!(ρpath, k:length(ρpath))
> deleteat!(objvalpath, k:length(objvalpath))
> deleteat!(dfpath, k:length(dfpath))
> dfpath[dfpath .< 0] = 0;
> 
> ```

I included you change in the next commit. However i still have some weird bugs:

```julia-auto
[ Info: Test lsq_constrsparsereg: sum-to-zero constraint
[ Info: Optimize at a single tuning parameter value
┌ Warning: broadcast will default to iterating over its arguments in the future. Wrap arguments of
│ type `x::Convex.AdditionAtom` with `Ref(x)` to ensure they broadcast as "scalar" elements.
│ caller = ip:0x0
└ @ Core :-1

```

Which i do not understand, and then it fails with :

```julia-auto
[ Info: Test lsq_classopath: sum-to-zero constraint
Test Failed at C:\Users\u009192\.julia\dev\ConstrainedLasso\test\classopath_test.jl:25
  Expression: all(abs.(sum(β̂path1, dims=1)) .< 1.0e-6)
ERROR: LoadError: LoadError: There was an error during testing
in expression starting at C:\Users\u009192\.julia\dev\ConstrainedLasso\test\classopath_test.jl:25
in expression starting at C:\Users\u009192\.julia\dev\ConstrainedLasso\test\runtests.jl:4
ERROR: Package ConstrainedLasso errored during testing

```

without more details…

---

<div class="post-metadata">

**Author:** ![oheil](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oheil/32/220745_2.png) [@oheil](https://discourse.julialang.org/u/oheil)\
**Post date:** [April 20, 2021, 12:48pm UTC](https://discourse.julialang.org/t/what-would-it-take-to-bring-this-julia-0-6-package-to-julia-1-6/59652/26 "2021-04-20T12:48:25Z")

</div>

perhaps

`all(abs.(sum.(β̂path1, dims=1)) .< 1.0e-6)`

---

<div class="post-metadata">

**Author:** ![lrnv](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lrnv/32/19373_2.png) [@lrnv](https://discourse.julialang.org/u/lrnv)\
**Post date:** [April 20, 2021, 12:52pm UTC](https://discourse.julialang.org/t/what-would-it-take-to-bring-this-julia-0-6-package-to-julia-1-6/59652/27 "2021-04-20T12:52:17Z")

</div>

No, it yielded `MethodError: no method matching sum(::Float64; dims=1)`, which mean that \beta\hat{p}ath1 is indeed only a one dimensional vector.

---

<div class="post-metadata">

**Author:** ![oheil](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oheil/32/220745_2.png) [@oheil](https://discourse.julialang.org/u/oheil)\
**Post date:** [April 20, 2021, 1:22pm UTC](https://discourse.julialang.org/t/what-would-it-take-to-bring-this-julia-0-6-package-to-julia-1-6/59652/28 "2021-04-20T13:22:03Z")

</div>

> [@oheil](#):
>
> `k=maxiters #loop var k is out of scope here after the loop, so set it to the max`

This is wrong.  
There are some `break` in the big loop and k must be set to last value before a break occurs.

Just telling you, it doesn’t change the latest error.

---

<div class="post-metadata">

**Author:** ![oheil](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oheil/32/220745_2.png) [@oheil](https://discourse.julialang.org/u/oheil)\
**Post date:** [April 20, 2021, 1:24pm UTC](https://discourse.julialang.org/t/what-would-it-take-to-bring-this-julia-0-6-package-to-julia-1-6/59652/29 "2021-04-20T13:24:11Z")

</div>

> [@lrnv](#):
>
> No, it yielded `MethodError: no method matching sum(::Float64; dims=1)` , which mean that β^path1\beta\hat{p}ath1 is indeed only a one dimensional vector.

It contains a row with lots of `NaN`, summing over it again gives `NaN` and the test fails.

---

<div class="post-metadata">

**Author:** ![lrnv](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lrnv/32/19373_2.png) [@lrnv](https://discourse.julialang.org/u/lrnv)\
**Post date:** [April 20, 2021, 1:25pm UTC](https://discourse.julialang.org/t/what-would-it-take-to-bring-this-julia-0-6-package-to-julia-1-6/59652/30 "2021-04-20T13:25:12Z")

</div>

> [@oheil](#):
>
> > [@oheil](#):
> >
> > `k=maxiters #loop var k is out of scope here after the loop, so set it to the max`
> 
> This is wrong.  
> There are some `break` in the big loop and k must be set to last value before a break occurs.

I did something like that:

```julia-auto
outer_k = 1
for k in 2:...
    ...
    ...
    outer_k +=1
end

```

Yes i have the same NaNs as you do. I wander if the problem is the changes i made or if the package itself had a failing test at the begining.

Edit: I pushed a new commit, but I still have the same bugs..

---

<div class="post-metadata">

**Author:** ![oheil](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/oheil/32/220745_2.png) [@oheil](https://discourse.julialang.org/u/oheil)\
**Post date:** [April 20, 2021, 2:33pm UTC](https://discourse.julialang.org/t/what-would-it-take-to-bring-this-julia-0-6-package-to-julia-1-6/59652/31 "2021-04-20T14:33:05Z")

</div>

I am at a dead end now.  
Have you been able to install this package in v0.6 ? To check if it actually works? I get errors when I try (Windows 10).

---

<div class="post-metadata">

**Author:** ![lrnv](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/lrnv/32/19373_2.png) [@lrnv](https://discourse.julialang.org/u/lrnv)\
**Post date:** [April 20, 2021, 2:33pm UTC](https://discourse.julialang.org/t/what-would-it-take-to-bring-this-julia-0-6-package-to-julia-1-6/59652/32 "2021-04-20T14:33:42Z")

</div>

No I did not, might be the problem. I assumed that the claim on the repo ‘Works on 0.6’ was true, but maybe it wasn’t.

---

<div class="post-metadata">

**Author:** ![mauro3](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/mauro3/32/292_2.png) [@mauro3](https://discourse.julialang.org/u/mauro3)\
**Post date:** [April 20, 2021, 3:52pm UTC](https://discourse.julialang.org/t/what-would-it-take-to-bring-this-julia-0-6-package-to-julia-1-6/59652/33 "2021-04-20T15:52:19Z")

</div>

There are a bunch of deprecation warnings in 0.6 (which turn into erros on 0.7); thus you should fix those first.

[Previous page](https://discourse.julialang.org/t/what-would-it-take-to-bring-this-julia-0-6-package-to-julia-1-6/59652.md?page=1)
