`bionomial` and `factorial` functions not defined?
TorkelE opened this issue · 5 comments
I'm coming here indirectly via ModelingToolkit.jl (which my package, Catalyst.jl, depends on) which recently started using DynamicQuantities.
Catalyst currently crashed whenever you try to use the binomial
or factorial
functions. I have traced this to ModelingToolkit: SciML/ModelingToolkit.jl#2554. I am not familiar with DynamicQuantities (only ModelingToolkit), but it seems like this issue might be traced here? (see conversation)
Sorry for the non-exhaustive description. This sounds like the error (and how to fix it) might be directly obvious for someone familiar with the package. If not, I will try to figure out more about what's going on.
Yes, these functions are not defined. We would need to add them to src/units.jl
. However, are you sure it makes sense to pass quantities to these functions? To me it seems that the behavior is ambiguous. Should factorial(10u"m")
be different dimensionality than factorial(10u"km")
? I’m not sure.
Maybe describe your expected behavior here, as these are going to be physical continuous quantities rather than integers.
Or, maybe you just want to define them for dimensionless input? In which case, add it to this list:
DynamicQuantities.jl/src/math.jl
Lines 156 to 167 in 25e55a1
I think, right now, the input would be dimensionless. I will make a PR to add them there.
(Technically, dimensional input could be added. Not really sure what I would expect though. We kind of jack into MTK which actually does this for us. Personally, I am not really using the unit feature, but it was something that suddenly started throwing errors through MTK)
Dimensionless sounds good to me.
Fixed with #125