1
1
# Citrine customized units input file for Pint, based explicitly on the Pint defaults as
2
- # included release 0.9 (https://github.com/hgrecco/pint/releases/tag/0.9 ). The Pint Authors hold
3
- # copyright and are documented in https://github.com/hgrecco/pint/blob/0.9 /AUTHORS.
2
+ # included release 0.20 (https://github.com/hgrecco/pint/releases/tag/0.20 ). The Pint Authors hold
3
+ # copyright and are documented in https://github.com/hgrecco/pint/blob/0.20 /AUTHORS.
4
4
#
5
5
# The original copyright statement for the constants file reads:
6
6
#
80
80
# [density] = [mass] / [volume]
81
81
#
82
82
# Note that primary dimensions don't need to be declared; they can be
83
- # defined or the first time in a unit definition.
83
+ # defined for the first time in a unit definition.
84
84
# E.g. see below `meter = [length]`
85
85
#
86
86
#
@@ -112,7 +112,9 @@ atto- = 1e-18 = a-
112
112
femto- = 1e-15 = f-
113
113
pico- = 1e-12 = p-
114
114
nano- = 1e-9 = n-
115
- micro- = 1e-6 = µ- = u-
115
+ # The micro (U+00B5) and Greek mu (U+03BC) are both valid prefixes,
116
+ # and they often use the same glyph.
117
+ micro- = 1e-6 = µ- = μ- = u-
116
118
milli- = 1e-3 = m-
117
119
centi- = 1e-2 = c-
118
120
deci- = 1e-1 = d-
@@ -152,7 +154,6 @@ gram = [mass] = g = Gram
152
154
mole = [substance] = mol = Mole
153
155
kelvin = [temperature]; offset: 0 = K = Kelvin = degK = °K = degree_Kelvin = degreeK # older names supported for compatibility
154
156
radian = [] = rad = Radian
155
- neper = [] = Np = Neper
156
157
bit = [] = _ = Bit
157
158
count = [] = _ = Count
158
159
@@ -180,13 +181,13 @@ mil = π / 32000 * radian = Mil
180
181
steradian = radian ** 2 = sr = Steradian
181
182
square_degree = (π / 180) ** 2 * sr = sq_deg = sqdeg = Square_Degree
182
183
183
- # Logarithmic ratio
184
- bel = 0.5 * ln10 * neper = Bel
185
-
186
184
# Information
187
- byte = 8 * bit = B = octet = Byte = Octet
188
185
baud = bit / second = Bd = bps = Baud = BPS
189
186
187
+ byte = 8 * bit = B = octet = Byte = Octet
188
+ # byte = 8 * bit = _ = octet
189
+ ## NOTE: B (byte) symbol can conflict with Bell
190
+
190
191
# Length
191
192
angstrom = 1e-10 * meter = Å = ångström = Angstrom = Ångstrom = Å
192
193
micron = micrometer = µ = Micron
@@ -198,7 +199,7 @@ nautical_mile = 1852 * meter = nmi = Nautical_Mile
198
199
bohr = hbar / (alpha * m_e * c) = a_0 = a0 = Bohr = bohr_radius = atomic_unit_of_length = a_u_length
199
200
x_unit_Cu = K_alpha_Cu_d_220 * d_220 / 1537.4 = Xu_Cu
200
201
x_unit_Mo = K_alpha_Mo_d_220 * d_220 / 707.831 = Xu_Mo
201
- angstrom_star = K_alpha_W_d_220 * d_220 / 0.2090100 = Å_star = Angstrom_Star
202
+ angstrom_star = K_alpha_W_d_220 * d_220 / 0.2090100 = Å_star = Angstrom_Star = Ångstrom_Star
202
203
planck_length = (hbar * gravitational_constant / c ** 3) ** 0.5 = Planck_length = Planck_Length
203
204
204
205
# Mass
@@ -218,7 +219,10 @@ week = 7 * day = Week
218
219
fortnight = 2 * week = Fortnight
219
220
year = 365.25 * day = yr = julian_year = Year = Julian_year = Julian_Year
220
221
month = year / 12 = _ = Month
221
- decade = 10 * year = _ = Decade
222
+
223
+ # decade = 10 * year = _ = Decade
224
+ ## NOTE: decade [time] can conflict with decade [dimensionless]
225
+
222
226
century = 100 * year = _ = centuries = Century = Centuries
223
227
millennium = 1e3 * year = _ = millennia = Millennium = Millennia
224
228
eon = 1e9 * year = _ = Eon
@@ -262,21 +266,27 @@ stere = meter ** 3 = _ = Stere
262
266
[frequency] = 1 / [time]
263
267
hertz = 1 / second = Hz = Hertz
264
268
revolutions_per_minute = revolution / minute = rpm = Revolutions_Per_Minute = RPM
269
+ revolutions_per_second = revolution / second = rps = Revolutions_Per_Second = RPS
265
270
counts_per_second = count / second = cps = Counts_Per_Second = CPS
266
271
267
272
# Wavenumber
268
273
[wavenumber] = 1 / [length]
269
274
reciprocal_centimeter = 1 / cm = cm_1 = kayser = Kayser = Reciprocal_Centimeter
270
275
271
276
# Velocity
272
- [velocity] = [length] / [time] = [speed]
277
+ [velocity] = [length] / [time]
278
+ [speed] = [velocity]
273
279
knot = nautical_mile / hour = kt = knot_international = international_knot = Knot = International_Knot
274
280
mile_per_hour = mile / hour = mph = MPH = Mile_Per_Hour = Miles_Per_Hour = miles_per_hour
275
281
kilometer_per_hour = kilometer / hour = kph = KPH = kilometers_per_hour = Kilometer_Per_Hour = Kilometers_Per_Hour
276
282
kilometer_per_second = kilometer / second = kps = kilometers_per_second = Kilometer_Per_Second
277
283
meter_per_second = meter / second = mps = Meter_Per_Second = Meters_Per_Second
278
284
foot_per_second = foot / second = fps = feet_per_second = Foot_Per_Second = Feet_Per_Second
279
285
286
+ # Volumetric Flow Rate
287
+ [volumetric_flow_rate] = [volume] / [time]
288
+ sverdrup = 1e6 * meter ** 3 / second = sv
289
+
280
290
# Acceleration
281
291
[acceleration] = [velocity] / [time]
282
292
galileo = centimeter / second ** 2 = Gal = Galileo
@@ -296,7 +306,7 @@ joule = newton * meter = J = Joule
296
306
erg = dyne * centimeter = _ = Erg
297
307
watt_hour = watt * hour = Wh = watthour = Whr = Watt_Hour = Watthour
298
308
electron_volt = e * volt = eV
299
- rydberg = h * c * R_inf = Ry = Rydberg
309
+ rydberg = ℎ * c * R_inf = Ry = Rydberg
300
310
hartree = 2 * rydberg = E_h = Eh = Hartree = hartree_energy = atomic_unit_of_energy = a_u_energy
301
311
calorie = 4.184 * joule = cal = thermochemical_calorie = cal_th = Calorie = Thermochemical_Calorie
302
312
international_calorie = 4.1868 * joule = cal_it = international_steam_table_calorie = International_Calorie
@@ -320,9 +330,13 @@ boiler_horsepower = 33475 * Btu / hour # unclear whic
320
330
metric_horsepower = 75 * force_kilogram * meter / second
321
331
electrical_horsepower = 746 * watt
322
332
refrigeration_ton = 12e3 * Btu / hour = _ = ton_of_refrigeration # approximate, no exact definition
333
+ cooling_tower_ton = 1.25 * refrigeration_ton # approximate, no exact definition
323
334
standard_liter_per_minute = atmosphere * liter / minute = slpm = slm
324
335
conventional_watt_90 = K_J90 ** 2 * R_K90 / (K_J ** 2 * R_K) * watt = W_90
325
336
337
+ # Momentum
338
+ [momentum] = [length] * [mass] / [time]
339
+
326
340
# Density (as auxiliary for pressure)
327
341
[density] = [mass] / [volume]
328
342
mercury = 13.5951 * kilogram / liter = Hg = Hg_0C = Hg_32F = conventional_mercury
@@ -348,6 +362,7 @@ inch_H2O_39F = inch * water_39F * g_0
348
362
inch_H2O_60F = inch * water_60F * g_0
349
363
foot_H2O = foot * water * g_0 = ftH2O = feet_H2O
350
364
centimeter_H2O = centimeter * water * g_0 = cmH2O = cm_H2O
365
+ sound_pressure_level = 20e-6 * pascal = SPL
351
366
352
367
# Torque
353
368
[torque] = [force] * [length]
@@ -381,7 +396,7 @@ enzyme_unit = micromole / minute = U = enzymeunit
381
396
382
397
# Entropy
383
398
[entropy] = [energy] / [temperature]
384
- clausius = calorie / kelvin = _ = Clausius
399
+ clausius = calorie / kelvin = Cl = Clausius
385
400
386
401
# Molar entropy
387
402
[molar_entropy] = [entropy] / [substance]
@@ -474,17 +489,17 @@ farad = coulomb / volt = F
474
489
abfarad = 1e9 * farad = abF
475
490
conventional_farad_90 = R_K90 / R_K * farad = F_90
476
491
492
+ # Magnetic flux
493
+ [magnetic_flux] = [electric_potential] * [time]
494
+ weber = volt * second = Wb = Weber
495
+ unit_pole = µ_0 * biot * centimeter
496
+
477
497
# Inductance
478
498
[inductance] = [magnetic_flux] / [current]
479
499
henry = weber / ampere = H = Henry
480
500
abhenry = 1e-9 * henry = abH
481
501
conventional_henry_90 = R_K / R_K90 * henry = H_90
482
502
483
- # Magnetic flux
484
- [magnetic_flux] = [electric_potential] * [time]
485
- weber = volt * second = Wb = Weber
486
- unit_pole = µ_0 * biot * centimeter
487
-
488
503
# Magnetic field
489
504
[magnetic_field] = [magnetic_flux] / [area]
490
505
tesla = weber / meter ** 2 = T = Tesla
@@ -494,7 +509,7 @@ gamma = 1e-9 * tesla = γ
494
509
[magnetomotive_force] = [current]
495
510
ampere_turn = ampere = At
496
511
biot_turn = biot
497
- gilbert = 1 / (4 * π) * biot_turn = _ = Gilbert
512
+ gilbert = 1 / (4 * π) * biot_turn = _ = Gilbert # Remove Gb for risk of collision with GB
498
513
499
514
# Magnetic field strength
500
515
[magnetic_field_strength] = [current] / [length]
@@ -512,6 +527,27 @@ buckingham = debye * angstrom = Buckingham
512
527
bohr_magneton = e * hbar / (2 * m_e) = µ_B = mu_B
513
528
nuclear_magneton = e * hbar / (2 * m_p) = µ_N = mu_N
514
529
530
+ # Logaritmic Unit Definition
531
+ # Unit = scale; logbase; logfactor
532
+ # x_dB = [logfactor] * log( x_lin / [scale] ) / log( [logbase] )
533
+
534
+ # Logaritmic Units of dimensionless quantity: [ https://en.wikipedia.org/wiki/Level_(logarithmic_quantity) ]
535
+
536
+ decibelmilliwatt = 1e-3 watt; logbase: 10; logfactor: 10 = dBm
537
+ decibelmicrowatt = 1e-6 watt; logbase: 10; logfactor: 10 = dBu
538
+
539
+ decibel = 1 ; logbase: 10; logfactor: 10 = dB
540
+ # bell = 1 ; logbase: 10; logfactor: = B
541
+ ## NOTE: B (Bell) symbol conflicts with byte
542
+
543
+ decade = 1 ; logbase: 10; logfactor: 1
544
+ ## NOTE: decade [time] can conflict with decade [dimensionless]
545
+
546
+ octave = 1 ; logbase: 2; logfactor: 1 = oct
547
+
548
+ neper = 1 ; logbase: 2.71828182845904523536028747135266249775724709369995; logfactor: 0.5 = Np = Neper
549
+ # neper = 1 ; logbase: eulers_number; logfactor: 0.5 = Np
550
+ ## NOTE: using eulers_number in a logbase definition seems broken under Pint 0.19.2, 0.20.0
515
551
516
552
#### UNIT GROUPS ####
517
553
# Mostly for length, area, volume, mass, force
@@ -580,7 +616,7 @@ nuclear_magneton = e * hbar / (2 * m_p) = µ_N = mu_N
580
616
teaspoon = fluid_ounce / 6 = tsp
581
617
tablespoon = fluid_ounce / 2 = tbsp = Tbsp
582
618
shot = 3 * tablespoon = jig = US_shot
583
- cup = pint / 2 = _ = liquid_cup = US_liquid_cup
619
+ cup = pint / 2 = _ = liquid_cup = US_liquid_cup # Removed because of risk of collision with cP
584
620
barrel = 31.5 * gallon = bbl
585
621
oil_barrel = 42 * gallon = oil_bbl
586
622
beer_barrel = 31 * gallon = beer_bbl
@@ -599,6 +635,7 @@ nuclear_magneton = e * hbar / (2 * m_p) = µ_N = mu_N
599
635
ton = 2e3 * pound = _ = short_ton
600
636
long_ton = 2240 * pound
601
637
slug = g_0 * pound * second ** 2 / foot
638
+ slinch = g_0 * pound * second ** 2 / inch = blob = slugette
602
639
603
640
force_ounce = g_0 * ounce = ozf = ounce_force
604
641
force_pound = g_0 * pound = lbf = pound_force
@@ -621,9 +658,9 @@ nuclear_magneton = e * hbar / (2 * m_p) = µ_N = mu_N
621
658
@end
622
659
623
660
@group Troy
624
- pennyweight = 24 * grain = _ = pennyweight
625
- troy_ounce = 480 * grain = _ = troy_ounce
626
- troy_pound = 12 * troy_ounce = _ = troy_pound
661
+ pennyweight = 24 * grain = dwt
662
+ troy_ounce = 480 * grain = toz = ozt
663
+ troy_pound = 12 * troy_ounce = tlb = lbt
627
664
@end
628
665
629
666
@group Apothecary
@@ -650,7 +687,7 @@ nuclear_magneton = e * hbar / (2 * m_p) = µ_N = mu_N
650
687
651
688
@group Printer
652
689
pica = inch / 6 = _ = printers_pica
653
- point = pica / 12 = _ = printers_point = big_point
690
+ point = pica / 12 = pp = printers_point = big_point = bp
654
691
didot = 1 / 2660 * m
655
692
cicero = 12 * didot
656
693
tex_point = inch / 72.27
0 commit comments