You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Example: Dict("D5/2" => PhysicalConstant(4.1115503183857306e14, "Hz"))
Returns the error "TypeError: in new, expected PhysicalConstant, got Float64". This seems to be caused by the Base.convert for PhysicalConstants added in constants.jl. I suspect there's something not quite right with this usage of convert, as defining this method alone breaks all instantiation of PhysicalConstants (even outside of Dicts); the Base.Fix2 method seems to patch this up, but does not fix the problem when the instantiation takes place inside a Dict. I do see that some sort of Base.convert method is necessary, as it allows mathematical operations with regular numbers, but not sure how it would need to be fixed.
It would be nice to be able to do this so that in species files e.g. /src/species/ca40.jl we can directly define energies and transition matrix elements as PhysicalConstants within dictionaries.
The text was updated successfully, but these errors were encountered:
Example:
Dict("D5/2" => PhysicalConstant(4.1115503183857306e14, "Hz"))
Returns the error "TypeError: in new, expected PhysicalConstant, got Float64". This seems to be caused by the
Base.convert
for PhysicalConstants added in constants.jl. I suspect there's something not quite right with this usage of convert, as defining this method alone breaks all instantiation of PhysicalConstants (even outside of Dicts); theBase.Fix2
method seems to patch this up, but does not fix the problem when the instantiation takes place inside a Dict. I do see that some sort ofBase.convert
method is necessary, as it allows mathematical operations with regular numbers, but not sure how it would need to be fixed.It would be nice to be able to do this so that in species files e.g.
/src/species/ca40.jl
we can directly define energies and transition matrix elements as PhysicalConstants within dictionaries.The text was updated successfully, but these errors were encountered: