ModelParameters.jl icon indicating copy to clipboard operation
ModelParameters.jl copied to clipboard

Add unitful extension with convenience dispatches

Open bgroenks96 opened this issue 1 year ago • 2 comments

This is a very minor addition, but I have been pirating these convenience dispatches in my own code for a while now. It would be nice to actually add them to the package via an extension.

bgroenks96 avatar Aug 23 '24 09:08 bgroenks96

@rafaqz I am getting a type inference test failure on 1.10.4 that appears unrelated to this PR (happens on master too). Are you aware of it?

Tables interface: Error During Test at /home/bgroenke/.julia/dev/ModelParameters/test/runtests.jl:156
  Got exception outside of a @test
  return type Model does not match inferred return type Any
  Stacktrace:
   [1] error(s::String)
     @ Base ./error.jl:35
   [2] macro expansion
     @ ~/.julia/dev/ModelParameters/test/runtests.jl:180 [inlined]
   [3] macro expansion
     @ ~/.julia/juliaup/julia-1.10.4+0.x64.linux.gnu/share/julia/stdlib/v1.10/Test/src/Test.jl:1577 [inlined]
   [4] top-level scope
     @ ~/.julia/dev/ModelParameters/test/runtests.jl:157
   [5] include(fname::String)
     @ Base.MainInclude ./client.jl:489
   [6] top-level scope
     @ none:6
   [7] eval
     @ ./boot.jl:385 [inlined]
   [8] exec_options(opts::Base.JLOptions)
     @ Base ./client.jl:291
   [9] _start()
     @ Base ./client.jl:552
Test Summary:    | Pass  Error  Total  Time
Tables interface |    9      1     10  2.6s

bgroenks96 avatar Aug 23 '24 09:08 bgroenks96

Oh not sure what that is from . Maybe Julia got worse at working out the type somewhere?. It seems we need go use Base.@assume_effects more and more to force these things.

rafaqz avatar Aug 23 '24 10:08 rafaqz

Assuming there are no test failures, it would be great if we could merge this finally.

bgroenks96 avatar Jul 12 '25 16:07 bgroenks96

We can probably add some math to it as well... if not to AbstractNumbers.jl. I've been hitting some ambiguities between Params and units.

rafaqz avatar Jul 13 '25 04:07 rafaqz

Sorry this took so long, hoping to be more responsive here fir the next few years

rafaqz avatar Jul 20 '25 23:07 rafaqz

Oh, weren't there failing tests?

bgroenks96 avatar Jul 21 '25 09:07 bgroenks96

Ugh damn looks like there was, not sure how I missed that

rafaqz avatar Jul 21 '25 11:07 rafaqz

Fixed in 36770b5

bgroenks96 avatar Jul 21 '25 18:07 bgroenks96