Replace tuples by functions in univariate_expressions#26
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #26 +/- ##
==========================================
- Coverage 94.45% 90.65% -3.80%
==========================================
Files 14 16 +2
Lines 2110 2258 +148
==========================================
+ Hits 1993 2047 +54
- Misses 117 211 +94 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
src/operators.jl
Outdated
| ) | ||
| # Assumption 1: check that `f` can be called with `Float64` arguments. | ||
| y = 0.0 | ||
| try |
There was a problem hiding this comment.
We can use hasmethod(f, (Array{dimension,Float64})) and hasmethod(f, Float64):
julia> hasmethod(size, (Array{3,Int},))
true
julia> hasmethod(log, (Array{3,Int},))
false
src/operators.jl
Outdated
| # Assumption 1: check that `f` can be called with `Float64` arguments. | ||
| y = 0.0 | ||
| try | ||
| if dimension == 1 |
There was a problem hiding this comment.
For scalars, dimension should be 0 I think
There was a problem hiding this comment.
I think we decide. I copy-pasted it from Nonlinear as it was needed in _UnivariateOperator which I also copy-pasted. It's the only place it is used for now, and dimension 1 is hard-coded for saying 'there's one argument' I guess.
I changed it to 0 as it may make more sense if we have vectors in the future.
There was a problem hiding this comment.
Ok, renaming nb_args sounds good :)
There was a problem hiding this comment.
Yes sorry I've changed my mind; I put nb_args=1 indeed to make it clear :)
See comment by BL on PR, arbitrary choice for now
Dimension in this function represents the number of arguments the function has
No description provided.