Skip to content

Commit

Permalink
api: normalize the unit acronyms for release
Browse files Browse the repository at this point in the history
  • Loading branch information
Nic Holthaus committed Jan 16, 2025
1 parent 23b4920 commit 2151516
Show file tree
Hide file tree
Showing 17 changed files with 98 additions and 98 deletions.
4 changes: 2 additions & 2 deletions include/units/acceleration.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,8 @@ namespace units
* @anchor accelerationContainers
* @sa See unit for more information on unit type containers.
*/
UNIT_ADD(acceleration, meters_per_second_squared, mps_sq, conversion_factor<std::ratio<1>, dimension::acceleration>)
UNIT_ADD(acceleration, feet_per_second_squared, fps_sq, compound_conversion_factor<feet_, inverse<squared<seconds_>>>)
UNIT_ADD(acceleration, meters_per_second_squared, mps2, conversion_factor<std::ratio<1>, dimension::acceleration>)
UNIT_ADD(acceleration, feet_per_second_squared, fps2, compound_conversion_factor<feet_, inverse<squared<seconds_>>>)
UNIT_ADD(acceleration, standard_gravity, SG, conversion_factor<std::ratio<980665, 100000>, meters_per_second_squared_>)
UNIT_ADD(acceleration, gals, Gal, compound_conversion_factor<centimeters_, inverse<squared<seconds_>>>)

Expand Down
10 changes: 5 additions & 5 deletions include/units/area.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,11 +58,11 @@ namespace units
* @anchor areaContainers
* @sa See unit for more information on unit type containers.
*/
UNIT_ADD(area, square_meters, sq_m, conversion_factor<std::ratio<1>, dimension::area>)
UNIT_ADD(area, square_feet, sq_ft, squared<feet_>)
UNIT_ADD(area, square_inches, sq_in, squared<inches_>)
UNIT_ADD(area, square_miles, sq_mi, squared<miles_>)
UNIT_ADD(area, square_kilometers, sq_km, squared<kilometers_>)
UNIT_ADD(area, square_meters, m2, conversion_factor<std::ratio<1>, dimension::area>)
UNIT_ADD(area, square_feet, ft2, squared<feet_>)
UNIT_ADD(area, square_inches, in2, squared<inches_>)
UNIT_ADD(area, square_miles, mi2, squared<miles_>)
UNIT_ADD(area, square_kilometers, km2, squared<kilometers_>)
UNIT_ADD(area, hectares, ha, conversion_factor<std::ratio<10000>, square_meters_>)
UNIT_ADD(area, acres, acre, conversion_factor<std::ratio<43560>, square_feet_>)

Expand Down
12 changes: 6 additions & 6 deletions include/units/density.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,16 +59,16 @@ namespace units
* @anchor densityContainers
* @sa See unit for more information on unit type containers.
*/
UNIT_ADD(density, kilograms_per_cubic_meter, kg_per_cu_m, conversion_factor<std::ratio<1>, dimension::density>)
UNIT_ADD(density, kilograms_per_cubic_meter, kg_per_m3, conversion_factor<std::ratio<1>, dimension::density>)
UNIT_ADD(density, grams_per_milliliter, g_per_mL, compound_conversion_factor<grams_, inverse<milliliters_>>)
UNIT_ADD(density, kilograms_per_liter, kg_per_L, conversion_factor<std::ratio<1>, compound_conversion_factor<grams_, inverse<milliliters_>>>)
UNIT_ADD(density, ounces_per_cubic_foot, oz_per_cu_ft, compound_conversion_factor<ounces_, inverse<cubic_feet_>>)
UNIT_ADD(density, ounces_per_cubic_inch, oz_per_cu_in, compound_conversion_factor<ounces_, inverse<cubic_inches<>>>)
UNIT_ADD(density, ounces_per_cubic_foot, oz_per_ft3, compound_conversion_factor<ounces_, inverse<cubic_feet_>>)
UNIT_ADD(density, ounces_per_cubic_inch, oz_per_in3, compound_conversion_factor<ounces_, inverse<cubic_inches<>>>)
UNIT_ADD(density, ounces_per_gallon, oz_per_gal, compound_conversion_factor<ounces<>, inverse<gallons<>>>)
UNIT_ADD(density, pounds_per_cubic_foot, lb_per_cu_ft, compound_conversion_factor<mass::pounds<>, inverse<cubic_feet<>>>)
UNIT_ADD(density, pounds_per_cubic_inch, lb_per_cu_in, compound_conversion_factor<mass::pounds<>, inverse<cubic_inches<>>>)
UNIT_ADD(density, pounds_per_cubic_foot, lb_per_ft3, compound_conversion_factor<mass::pounds<>, inverse<cubic_feet<>>>)
UNIT_ADD(density, pounds_per_cubic_inch, lb_per_in3, compound_conversion_factor<mass::pounds<>, inverse<cubic_inches<>>>)
UNIT_ADD(density, pounds_per_gallon, lb_per_gal, compound_conversion_factor<mass::pounds<>, inverse<gallons<>>>)
UNIT_ADD(density, slugs_per_cubic_foot, slug_per_cu_ft, compound_conversion_factor<slugs<>, inverse<cubic_feet<>>>)
UNIT_ADD(density, slugs_per_cubic_foot, slug_per_ft3, compound_conversion_factor<slugs<>, inverse<cubic_feet<>>>)

UNIT_ADD_DIMENSION_TRAIT(density)
} // namespace units
Expand Down
2 changes: 1 addition & 1 deletion include/units/energy_density.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ namespace units
* @anchor energy_densityContainers
* @sa See unit for more information on unit type containers.
*/
UNIT_ADD_WITH_METRIC_PREFIXES(energy_density, joules_per_meter_cubed, Jpm3, pascals_)
UNIT_ADD_WITH_METRIC_PREFIXES(energy_density, joules_per_meter_cubed, J_per_m3, pascals_)

UNIT_ADD_DIMENSION_TRAIT(energy_density)
} // namespace units
Expand Down
2 changes: 1 addition & 1 deletion include/units/illuminance.h
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ namespace units
*/
UNIT_ADD_WITH_METRIC_PREFIXES(illuminance, lux, lx, conversion_factor<std::ratio<1>, dimension::illuminance>)
UNIT_ADD(illuminance, footcandles, fc, compound_conversion_factor<lumens_, inverse<squared<feet_>>>)
UNIT_ADD(illuminance, lumens_per_square_inch, lm_per_in_sq, compound_conversion_factor<lumens_, inverse<squared<inches_>>>)
UNIT_ADD(illuminance, lumens_per_square_inch, lm_per_in2, compound_conversion_factor<lumens_, inverse<squared<inches_>>>)
UNIT_ADD(illuminance, phots, ph, compound_conversion_factor<lumens_, inverse<squared<centimeters<>>>>)

UNIT_ADD_DIMENSION_TRAIT(illuminance)
Expand Down
2 changes: 1 addition & 1 deletion include/units/irradiance.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ namespace units
* @anchor irradianceContainers
* @sa See unit for more information on unit type containers.
*/
UNIT_ADD_WITH_METRIC_PREFIXES(irradiance, watts_per_meter_squared, Wpm2, conversion_factor<std::ratio<1>, dimension::irradiance>)
UNIT_ADD_WITH_METRIC_PREFIXES(irradiance, watts_per_meter_squared, W_per_m2, conversion_factor<std::ratio<1>, dimension::irradiance>)

UNIT_ADD_DIMENSION_TRAIT(irradiance)
} // namespace units
Expand Down
4 changes: 2 additions & 2 deletions include/units/jerk.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,8 +65,8 @@ namespace units
* @anchor jerkContainers
* @sa See unit for more information on unit type containers.
*/
UNIT_ADD_WITH_METRIC_PREFIXES(jerk, meters_per_second_cubed, mps_cb, conversion_factor<std::ratio<1>, dimension::jerk>)
UNIT_ADD(jerk, feet_per_second_cubed, fps_cb, compound_conversion_factor<length::feet_, inverse<cubed<time::seconds_>>>)
UNIT_ADD_WITH_METRIC_PREFIXES(jerk, meters_per_second_cubed, mps3, conversion_factor<std::ratio<1>, dimension::jerk>)
UNIT_ADD(jerk, feet_per_second_cubed, fps3, compound_conversion_factor<length::feet_, inverse<cubed<time::seconds_>>>)

UNIT_ADD_DIMENSION_TRAIT(jerk)
} // namespace units
Expand Down
2 changes: 1 addition & 1 deletion include/units/luminance.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ namespace units
* @anchor luminanceContainers
* @sa See unit for more information on unit type containers.
*/
UNIT_ADD_WITH_METRIC_PREFIXES(luminance, candelas_per_square_meter, cd_per_m_sq, conversion_factor<std::ratio<1>, dimension::luminance>)
UNIT_ADD_WITH_METRIC_PREFIXES(luminance, candelas_per_square_meter, cd_per_m2, conversion_factor<std::ratio<1>, dimension::luminance>)
UNIT_ADD(luminance, stilbs, sb, conversion_factor<std::ratio<10'000>, candelas_per_square_meter_>)
UNIT_ADD(luminance, apostilbs, asb, conversion_factor<std::ratio<1>, candelas_per_square_meter_, std::ratio<-1>>)
UNIT_ADD(luminance, brils, bril, conversion_factor<std::ratio<1, 10'000'000>, candelas_per_square_meter<>, std::ratio<-1>>)
Expand Down
2 changes: 1 addition & 1 deletion include/units/radiance.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ namespace units
* @anchor radianceContainers
* @sa See unit for more information on unit type containers.
*/
UNIT_ADD_WITH_METRIC_PREFIXES(radiance, watts_per_steradian_per_meter_squared, Wpsrm2, conversion_factor<std::ratio<1>, dimension::radiance>)
UNIT_ADD_WITH_METRIC_PREFIXES(radiance, watts_per_steradian_per_meter_squared, W_per_srm2, conversion_factor<std::ratio<1>, dimension::radiance>)

UNIT_ADD_DIMENSION_TRAIT(radiance)
} // namespace units
Expand Down
2 changes: 1 addition & 1 deletion include/units/radiant_intensity.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ namespace units
* @anchor radiant_intensityContainers
* @sa See unit for more information on unit type containers.
*/
UNIT_ADD_WITH_METRIC_PREFIXES(radiant_intensity, watts_per_steradian, Wpsr, conversion_factor<std::ratio<1>, dimension::radiant_intensity>)
UNIT_ADD_WITH_METRIC_PREFIXES(radiant_intensity, watts_per_steradian, W_per_sr, conversion_factor<std::ratio<1>, dimension::radiant_intensity>)

UNIT_ADD_DIMENSION_TRAIT(radiant_intensity)
} // namespace units
Expand Down
2 changes: 1 addition & 1 deletion include/units/solid_angle.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@ namespace units
* @sa See unit for more information on unit type containers.
*/
UNIT_ADD_WITH_METRIC_PREFIXES(solid_angle, steradians, sr, conversion_factor<std::ratio<1>, dimension::solid_angle>)
UNIT_ADD(solid_angle, degrees_squared, sq_deg, squared<degrees_>)
UNIT_ADD(solid_angle, degrees_squared, deg2, squared<degrees_>)
UNIT_ADD(solid_angle, spats, sp, conversion_factor<std::ratio<4>, steradians_, std::ratio<1>>)

UNIT_ADD_DIMENSION_TRAIT(solid_angle)
Expand Down
2 changes: 1 addition & 1 deletion include/units/spectral_flux.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ namespace units
* @anchor spectral_fluxContainers
* @sa See unit for more information on unit type containers.
*/
UNIT_ADD_WITH_METRIC_PREFIXES(spectral_flux, watts_per_meter, Wpm, conversion_factor<std::ratio<1>, dimension::spectral_flux>)
UNIT_ADD_WITH_METRIC_PREFIXES(spectral_flux, watts_per_meter, W_per_m, conversion_factor<std::ratio<1>, dimension::spectral_flux>)

UNIT_ADD_DIMENSION_TRAIT(spectral_flux)
} // namespace units
Expand Down
2 changes: 1 addition & 1 deletion include/units/spectral_intensity.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ namespace units
* @anchor spectral_intensityContainers
* @sa See unit for more information on unit type containers.
*/
UNIT_ADD_WITH_METRIC_PREFIXES(spectral_intensity, watts_per_steradian_per_meter, Wpsrm, conversion_factor<std::ratio<1>, dimension::spectral_intensity>)
UNIT_ADD_WITH_METRIC_PREFIXES(spectral_intensity, watts_per_steradian_per_meter, W_per_srm, conversion_factor<std::ratio<1>, dimension::spectral_intensity>)

UNIT_ADD_DIMENSION_TRAIT(spectral_intensity)
} // namespace units
Expand Down
2 changes: 1 addition & 1 deletion include/units/spectral_irradiance.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ namespace units
* @anchor spectral_irradianceContainers
* @sa See unit for more information on unit type containers.
*/
UNIT_ADD_WITH_METRIC_PREFIXES(spectral_irradiance, watts_per_meter_cubed, Wpm3, conversion_factor<std::ratio<1>, dimension::spectral_irradiance>)
UNIT_ADD_WITH_METRIC_PREFIXES(spectral_irradiance, watts_per_meter_cubed, W_per_m3, conversion_factor<std::ratio<1>, dimension::spectral_irradiance>)

UNIT_ADD_DIMENSION_TRAIT(spectral_irradiance)
} // namespace units
Expand Down
2 changes: 1 addition & 1 deletion include/units/spectral_radiance.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ namespace units
* @anchor spectral_radianceContainers
* @sa See unit for more information on unit type containers.
*/
UNIT_ADD_WITH_METRIC_PREFIXES(spectral_radiance, watts_per_steradian_per_meter_cubed, Wpsrm3, conversion_factor<std::ratio<1>, dimension::spectral_radiance>)
UNIT_ADD_WITH_METRIC_PREFIXES(spectral_radiance, watts_per_steradian_per_meter_cubed, W_per_srm3, conversion_factor<std::ratio<1>, dimension::spectral_radiance>)

UNIT_ADD_DIMENSION_TRAIT(spectral_radiance)
} // namespace units
Expand Down
16 changes: 8 additions & 8 deletions include/units/volume.h
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,14 @@ namespace units
* @anchor volumeContainers
* @sa See unit for more information on unit type containers.
*/
UNIT_ADD(volume, cubic_meters, cu_m, conversion_factor<std::ratio<1>, dimension::volume>)
UNIT_ADD(volume, cubic_millimeters, cu_mm, cubed<millimeters_>)
UNIT_ADD(volume, cubic_kilometers, cu_km, cubed<kilometers<>>)
UNIT_ADD(volume, cubic_meters, m3, conversion_factor<std::ratio<1>, dimension::volume>)
UNIT_ADD(volume, cubic_millimeters, mm3, cubed<millimeters_>)
UNIT_ADD(volume, cubic_kilometers, km3, cubed<kilometers<>>)
UNIT_ADD_WITH_METRIC_PREFIXES(volume, liters, L, cubed<decimeters<>>)
UNIT_ADD(volume, cubic_inches, cu_in, cubed<inches<>>)
UNIT_ADD(volume, cubic_feet, cu_ft, cubed<feet<>>)
UNIT_ADD(volume, cubic_yards, cu_yd, cubed<yards<>>)
UNIT_ADD(volume, cubic_miles, cu_mi, cubed<miles<>>)
UNIT_ADD(volume, cubic_inches, in3, cubed<inches<>>)
UNIT_ADD(volume, cubic_feet, ft3, cubed<feet<>>)
UNIT_ADD(volume, cubic_yards, yd3, cubed<yards<>>)
UNIT_ADD(volume, cubic_miles, mi3, cubed<miles<>>)
UNIT_ADD(volume, gallons, gal, conversion_factor<std::ratio<231>, cubic_inches<>>)
UNIT_ADD(volume, quarts, qt, conversion_factor<std::ratio<1, 4>, gallons<>>)
UNIT_ADD(volume, pints, pt, conversion_factor<std::ratio<1, 2>, quarts<>>)
Expand All @@ -74,7 +74,7 @@ namespace units
UNIT_ADD(volume, barrels, bl, conversion_factor<std::ratio<42>, gallons<>>)
UNIT_ADD(volume, bushels, bu, conversion_factor<std::ratio<215042, 100>, cubic_inches<>>)
UNIT_ADD(volume, cords, cord, conversion_factor<std::ratio<128>, cubic_feet<>>)
UNIT_ADD(volume, cubic_fathoms, cu_fm, cubed<fathoms<>>)
UNIT_ADD(volume, cubic_fathoms, fm3, cubed<fathoms<>>)
UNIT_ADD(volume, tablespoons, tbsp, conversion_factor<std::ratio<1, 2>, fluid_ounces<>>)
UNIT_ADD(volume, teaspoons, tsp, conversion_factor<std::ratio<1, 6>, fluid_ounces<>>)
UNIT_ADD(volume, pinches, pinch, conversion_factor<std::ratio<1, 8>, teaspoons<>>)
Expand Down
Loading

0 comments on commit 2151516

Please sign in to comment.