Skip to content

Commit

Permalink
Update valid supported units (#212)
Browse files Browse the repository at this point in the history
  • Loading branch information
petechd authored Aug 9, 2023
1 parent c996606 commit 309b44c
Show file tree
Hide file tree
Showing 4 changed files with 174 additions and 82 deletions.
248 changes: 170 additions & 78 deletions schemas/lists/units.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,144 +5,236 @@
"description": "Internationalised units for length, area, volume, and others.",
"enum": [
"acceleration-g-force",
"acceleration-meter-per-second-squared",
"acceleration-meter-per-square-second",
"angle-revolution",
"angle-radian",
"angle-degree",
"angle-arc-minute",
"angle-arc-second",
"angle-degree",
"angle-radian",
"angle-revolution",
"area-acre",
"area-hectare",
"area-square-centimeter",
"area-square-foot",
"area-square-inch",
"area-square-kilometer",
"area-hectare",
"area-square-meter",
"area-square-centimeter",
"area-square-mile",
"area-acre",
"area-square-yard",
"area-square-foot",
"area-square-inch",
"area-dunam",
"concentr-karat",
"concentr-milligram-per-deciliter",
"concentr-milligram-ofglucose-per-deciliter",
"concentr-millimole-per-liter",
"concentr-part-per-million",
"consumption-liter-per-100kilometers",
"concentr-item",
"concentr-permillion",
"concentr-percent",
"concentr-permille",
"concentr-permyriad",
"concentr-mole",
"consumption-liter-per-kilometer",
"consumption-liter-per-100-kilometer",
"consumption-mile-per-gallon",
"consumption-mile-per-gallon-imperial",
"digital-bit",
"digital-byte",
"digital-gigabit",
"digital-petabyte",
"digital-terabyte",
"digital-terabit",
"digital-gigabyte",
"digital-kilobit",
"digital-kilobyte",
"digital-megabit",
"digital-gigabit",
"digital-megabyte",
"digital-terabit",
"digital-terabyte",
"digital-megabit",
"digital-kilobyte",
"digital-kilobit",
"digital-byte",
"digital-bit",
"duration-century",
"duration-decade",
"duration-year",
"duration-year-person",
"duration-quarter",
"duration-month",
"duration-month-person",
"duration-week",
"duration-week-person",
"duration-day",
"duration-day-person",
"duration-hour",
"duration-microsecond",
"duration-millisecond",
"duration-minute",
"duration-month",
"duration-month-person",
"duration-nanosecond",
"duration-second",
"duration-week",
"duration-week-person",
"duration-year",
"duration-year-person",
"duration-millisecond",
"duration-microsecond",
"duration-nanosecond",
"electric-ampere",
"electric-milliampere",
"electric-ohm",
"electric-volt",
"energy-kilocalorie",
"energy-calorie",
"energy-foodcalorie",
"energy-joule",
"energy-kilocalorie",
"energy-kilojoule",
"energy-joule",
"energy-kilowatt-hour",
"energy-electronvolt",
"energy-british-thermal-unit",
"energy-therm-us",
"force-pound-force",
"force-newton",
"force-kilowatt-hour-per-100-kilometer",
"frequency-gigahertz",
"frequency-hertz",
"frequency-kilohertz",
"frequency-megahertz",
"length-astronomical-unit",
"length-centimeter",
"length-decimeter",
"length-fathom",
"length-foot",
"length-furlong",
"length-inch",
"frequency-kilohertz",
"frequency-hertz",
"graphics-em",
"graphics-pixel",
"graphics-megapixel",
"graphics-pixel-per-centimeter",
"graphics-pixel-per-inch",
"graphics-dot-per-centimeter",
"graphics-dot-per-inch",
"graphics-dot",
"length-earth-radius",
"length-kilometer",
"length-light-year",
"length-meter",
"length-micrometer",
"length-mile",
"length-mile-scandinavian",
"length-decimeter",
"length-centimeter",
"length-millimeter",
"length-micrometer",
"length-nanometer",
"length-nautical-mile",
"length-parsec",
"length-picometer",
"length-mile",
"length-yard",
"length-foot",
"length-inch",
"length-parsec",
"length-light-year",
"length-astronomical-unit",
"length-furlong",
"length-fathom",
"length-nautical-mile",
"length-mile-scandinavian",
"length-point",
"length-solar-radius",
"light-lux",
"mass-carat",
"mass-gram",
"light-candela",
"light-lumen",
"light-solar-luminosity",
"mass-tonne",
"mass-kilogram",
"mass-metric-ton",
"mass-microgram",
"mass-gram",
"mass-milligram",
"mass-microgram",
"mass-ton",
"mass-stone",
"mass-pound",
"mass-ounce",
"mass-ounce-troy",
"mass-pound",
"mass-stone",
"mass-ton",
"mile",
"mass-carat",
"mass-dalton",
"mass-earth-mass",
"mass-solar-mass",
"mass-grain",
"power-gigawatt",
"power-horsepower",
"power-kilowatt",
"power-megawatt",
"power-milliwatt",
"power-kilowatt",
"power-watt",
"pressure-hectopascal",
"pressure-inch-hg",
"power-milliwatt",
"power-horsepower",
"pressure-millimeter-ofhg",
"pressure-pound-force-per-square-inch",
"pressure-inch-ofhg",
"pressure-bar",
"pressure-millibar",
"pressure-millimeter-of-mercury",
"pressure-pound-per-square-inch",
"pressure-atmosphere",
"pressure-pascal",
"pressure-hectopascal",
"pressure-kilopascal",
"pressure-megapascal",
"speed-kilometer-per-hour",
"speed-knot",
"speed-meter-per-second",
"speed-mile-per-hour",
"speed-knot",
"temperature-generic",
"temperature-celsius",
"temperature-fahrenheit",
"temperature-generic",
"temperature-kelvin",
"volume-acre-foot",
"volume-bushel",
"volume-centiliter",
"volume-cubic-centimeter",
"volume-cubic-foot",
"volume-cubic-inch",
"torque-pound-force-foot",
"torque-newton-meter",
"volume-cubic-kilometer",
"volume-cubic-meter",
"volume-cubic-centimeter",
"volume-cubic-mile",
"volume-cubic-yard",
"volume-cup",
"volume-cup-metric",
"volume-deciliter",
"volume-fluid-ounce",
"volume-gallon",
"volume-gallon-imperial",
"volume-cubic-foot",
"volume-cubic-inch",
"volume-megaliter",
"volume-hectoliter",
"volume-liter",
"volume-megaliter",
"volume-deciliter",
"volume-centiliter",
"volume-milliliter",
"volume-pint",
"volume-pint-metric",
"volume-cup-metric",
"volume-acre-foot",
"volume-bushel",
"volume-gallon",
"volume-gallon-imperial",
"volume-quart",
"volume-pint",
"volume-cup",
"volume-fluid-ounce",
"volume-fluid-ounce-imperial",
"volume-tablespoon",
"volume-teaspoon"
"volume-teaspoon",
"volume-barrel",
"volume-dessert-spoon",
"volume-dessert-spoon-imperial",
"volume-drop",
"volume-dram",
"volume-jigger",
"volume-pinch",
"volume-quart-imperial",
"angle-steradian",
"concentr-portion",
"concentr-ofglucose",
"concentr-katal",
"duration-fortnight",
"electric-coulomb",
"electric-farad",
"electric-henry",
"electric-siemens",
"energy-calorie-it",
"energy-british-thermal-unit-it",
"energy-becquerel",
"energy-sievert",
"energy-gray",
"force-kilogram-force",
"length-100-kilometer",
"length-rod",
"length-chain",
"magnetic-tesla",
"magnetic-weber",
"mass-slug",
"pressure-ofhg",
"speed-beaufort",
"temperature-rankine",
"volume-pint-imperial",
"pressure-gasoline-equivalent",
"length-rin",
"length-sun",
"length-shaku-length",
"length-shaku-cloth",
"length-ken",
"length-jo-jp",
"length-ri-jp",
"area-bu-jp",
"area-se-jp",
"area-cho",
"volume-kosaji",
"volume-osaji",
"volume-cup-jp",
"volume-shaku",
"volume-sai",
"volume-to-jp",
"volume-koku",
"mass-fun"
]
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@
{
"id": "average-distance",
"mandatory": false,
"unit": "mile",
"unit": "length-mile",
"type": "Unit",
"unit_length": "long",
"label": "Average commuting distance",
Expand Down
4 changes: 2 additions & 2 deletions tests/schemas/valid/test_placeholder_transform.json
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@
{
"id": "average-distance",
"mandatory": false,
"unit": "mile",
"unit": "length-mile",
"type": "Unit",
"unit_length": "long",
"label": "Average commuting distance",
Expand Down Expand Up @@ -419,7 +419,7 @@
"source": "answers",
"identifier": "average-distance"
},
"unit": "mile",
"unit": "length-mile",
"unit_length": "long"
}
}
Expand Down
2 changes: 1 addition & 1 deletion tests/test_placeholder_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ def test_validation_answer_type_for_transform(
[
{
"message": error_messages.ANSWER_UNIT_AND_TRANSFORM_UNIT_MISMATCH.format(
answer_unit="mile", transform_unit="meter"
answer_unit="length-mile", transform_unit="meter"
),
"identifier": "average-distance",
}
Expand Down

0 comments on commit 309b44c

Please sign in to comment.