matterhorn103 / quanstants

Intuitive and unastonishing physical quantities, units, constants, and uncertainties in Python
MIT License
1 stars 0 forks source link

Consider adding a scaling factor to units like astropy.units #43

Open matterhorn103 opened 4 months ago

matterhorn103 commented 4 months ago

Kind of similar to how it is possible to produce a DerivedUnit with a constant in it, it would be cool to be able to express quantities as e.g. 300 (10^6 m), where the scaling factor is part of the unit. This would be mostly useful for use on matplotlib plots or in LaTeX table preparation etc.

ScaledUnit could work almost identically to a PrefixedUnit, where the "prefix" string is just the number, and the "multiplier" is the scaling factor. Units should be allowed both a prefix and a scaling factor though.