Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create uom error message filter similar to tnfilt #296

Open
iliekturtles opened this issue Mar 30, 2022 · 0 comments
Open

Create uom error message filter similar to tnfilt #296

iliekturtles opened this issue Mar 30, 2022 · 0 comments

Comments

@iliekturtles
Copy link
Owner

tnfilt (at least the slightly patched version I submitted in a PR (it looks like rustc has changed the amount of qualification in shows in the error messages, since tnfilt was written) which has been ignored thus far) does work with uom, but it doesn't help much. For example, it turns this

Quantity<(dyn Dimension<L = PInt<UInt<UTerm, B1>>, J = Z0, Kind = (dyn Kind + 'static), N = Z0, T = NInt<UInt<UInt<UTerm, B1>, B0>>, M = Z0, Th = Z0, I = Z0> + 'static), (dyn uom::si::Units<f32, luminous_intensity = uom::si::luminous_intensity::candela, mass = uom::si::mass::kilogram, length = uom::si::length::meter, time = uom::si::time::second, thermodynamic_temperature = uom::si::thermodynamic_temperature::kelvin, amount_of_substance = uom::si::amount_of_substance::mole, electric_current = uom::si::electric_current::ampere> + 'static), f32>

into this

Quantity<(dyn Dimension<L = PInt<U1>,              J = Z0, Kind = (dyn Kind + 'static), N = Z0, T = NInt<U2>,                        M = Z0, Th = Z0, I = Z0> + 'static), (dyn uom::si::Units<f32, luminous_intensity = uom::si::luminous_intensity::candela, mass = uom::si::mass::kilogram, length = uom::si::length::meter, time = uom::si::time::second, thermodynamic_temperature = uom::si::thermodynamic_temperature::kelvin, amount_of_substance = uom::si::amount_of_substance::mole, electric_current = uom::si::electric_current::ampere> + 'static), f32>

(alignment mine) which is almost nothing on the scale of the total amount of noise.

All it does is things like

  • PInt<UInt<UTerm, B1>> -> PInt<U1>
  • NInt<UInt<UInt<UTerm, B1>, B0>> -> NInt<U2>

If all that noise can be reduced to something like this Quantity<m^1 s^-2, Kind, f32>, then it would be really useful. I'll have a go, and see how close I can get to that ideal, but progress will be very slow, for lack of time.

Originally posted by @jacg in #293 (comment)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant