Open HenryDane opened 1 month ago
Just copying my comment for anybody else reading this:
as a quick hack, you could treat the other existing units as the units you are interested in. So, e.g., luminosity (cd) could be mass_h20.
But would be nice to allow actual custom dimensions.
Here's a reduced test that fails:
using SymbolicRegression.InterfaceDynamicQuantitiesModule: get_units, get_si_units
using DynamicQuantities
struct AngleDimensions{R} <: AbstractDimensions{R}
length::R
mass::R
time::R
current::R
temperature::R
luminosity::R
amount::R
rad::R
end
const rad = Quantity(1.0, AngleDimensions(; rad=1))
get_si_units(Float64, [dimension(y)])
Basically this code: https://github.com/MilesCranmer/SymbolicRegression.jl/blob/cd23a6e25c64d00565c3ae3905d06dc3c63033ed/src/InterfaceDynamicQuantities.jl#L16-L57 assumes Dimensions
is the only AbstractDimensions
for units.
Feature Request
(Originally a discussion post on the PySR github repository).
I think that it would be useful to be able to use custom
AbstractDimensions
with this library.An example of this usecase could be:
Please let me know if there is anything I can do to help with this feature.