Skip to content

Relaxing ::Real requirement? #2133

Closed
Closed
@MilesCranmer

Description

@MilesCranmer

Hi everyone,

Awesome package and ecosystem. I'm really enjoying it!

I was wondering if the requirement for numeric types to be ::Real could be relaxed to ::Any? Since Julia doesn't have multiple inheritance, this limits the range of types you can use perhaps more than necessary. There are some types which act exactly like a Real in every other way, except they do not inherit from Real, so it would be great if one could use those as well.

My specific use-case is I'm trying to use physical units in a TuringLang model, but both Unitful.Quantity and DynamicQuantities.Quantity are <:Number so are incompatible, despite the numerical type being a Real in both cases (base type Float64).

Cheers,
Miles

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions