diff --git a/gemd/__version__.py b/gemd/__version__.py index edc60b3..b6d2a0c 100644 --- a/gemd/__version__.py +++ b/gemd/__version__.py @@ -1 +1 @@ -__version__ = "2.1.6" +__version__ = "2.1.7" diff --git a/gemd/units/citrine_en.txt b/gemd/units/citrine_en.txt index ea19497..1bbf774 100644 --- a/gemd/units/citrine_en.txt +++ b/gemd/units/citrine_en.txt @@ -1,6 +1,6 @@ # Citrine customized units input file for Pint, based explicitly on the Pint defaults as -# included release 0.20 (https://github.com/hgrecco/pint/releases/tag/0.20). The Pint Authors hold -# copyright and are documented in https://github.com/hgrecco/pint/blob/0.20/AUTHORS. +# included release 0.23 (https://github.com/hgrecco/pint/releases/tag/0.23). The Pint Authors hold +# copyright and are documented in https://github.com/hgrecco/pint/blob/0.23/AUTHORS. # # The original copyright statement for the constants file reads: # @@ -106,6 +106,8 @@ #### PREFIXES #### # decimal prefixes +quecto- = 1e-30 = q- +ronto- = 1e-27 = r- yocto- = 1e-24 = y- zepto- = 1e-21 = z- atto- = 1e-18 = a- @@ -128,6 +130,8 @@ peta- = 1e15 = P- exa- = 1e18 = E- zetta- = 1e21 = Z- yotta- = 1e24 = Y- +ronna- = 1e27 = R- +quetta- = 1e30 = Q- # binary_prefixes kibi- = 2**10 = Ki- @@ -189,9 +193,14 @@ byte = 8 * bit = B = octet = Byte = Octet # byte = 8 * bit = _ = octet ## NOTE: B (byte) symbol can conflict with Bell +# Ratios +percent = 0.01 = % = pct +permille = 0.001 = ‰ = per_thousand +ppm = 1e-6 = per_million + # Length angstrom = 1e-10 * meter = Å = ångström = Angstrom = Ångstrom = Å -micron = micrometer = µ = Micron +micron = micrometer = µ = μ = Micron fermi = femtometer = fm = Fermi light_year = speed_of_light * julian_year = ly = lightyear = Light_Year = Lightyear astronomical_unit = 149597870700 * meter = au = Astronomical_Unit # since Aug 2012 @@ -468,6 +477,10 @@ atomic_unit_of_electric_field = e * k_C / a_0 ** 2 = a_u_electric_field # Electric displacement field [electric_displacement_field] = [charge] / [area] +# Reduced electric field +[reduced_electric_field] = [electric_field] * [area] +townsend = 1e-21 * V * m^2 = Td = Townsend + # Resistance [resistance] = [electric_potential] / [current] ohm = volt / ampere = Ω = Ohm @@ -707,10 +720,10 @@ neper = 1 ; logbase: 2.71828182845904523536028747135266249775724709369995; logfa # @group Textile # tex = gram / kilometer = Tt # dtex = decitex -# denier = gram / (9 * kilometer) = den = Td +# denier = gram / (9 * kilometer) = den # jute = pound / (14400 * yard) = Tj # aberdeen = jute = Ta -# RKM = kgf * 1000 / tex +# RKM = gf / tex # # number_english = 840 * yard / pound = Ne = NeC = ECC # number_meter = kilometer / kilogram = Nm diff --git a/gemd/units/impl.py b/gemd/units/impl.py index 7622343..ee3f378 100644 --- a/gemd/units/impl.py +++ b/gemd/units/impl.py @@ -44,11 +44,6 @@ def _deploy_default_files() -> Tuple[Path, Path]: _ALLOWED_OPERATORS = {".", "+", "-", "*", "/", "//", "^", "**", "(", ")"} -def _space_after_minus_preprocessor(input_string: str) -> str: - """A preprocessor that protects against a pint < 0.21 bug.""" - return re.sub(r"(?<=-)\s+(?=\d)", "", input_string) - - def _scientific_notation_preprocessor(input_string: str) -> str: """Preprocessor that converts x * 10 ** y format to xEy.""" def _as_scientific(matchobj: re.Match) -> str: @@ -402,8 +397,7 @@ def change_definitions_file(filename: str = None): # Need to re-verify path because of some slippiness around tmp on macOS updated = (Path.cwd() / target.name).resolve(strict=True) _REGISTRY = _ScaleFactorRegistry(filename=updated, - preprocessors=[_space_after_minus_preprocessor, - _scientific_notation_preprocessor, + preprocessors=[_scientific_notation_preprocessor, _scaling_preprocessor ], autoconvert_offset_to_baseunit=True diff --git a/requirements.txt b/requirements.txt index d97eb0e..29ad6a1 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -pint==0.20 +pint==0.21 deprecation==2.1.0 typing-extensions==4.8.0 importlib-resources==5.3.0 diff --git a/setup.py b/setup.py index 6a10e4a..9602ea6 100644 --- a/setup.py +++ b/setup.py @@ -33,7 +33,7 @@ 'tests.units': ['test_units.txt'] }, install_requires=[ - "pint>=0.20,<0.24", + "pint>=0.21,<0.24", "deprecation>=2.1.0,<3", "typing_extensions>=4.8,<5", "importlib-resources>=5.3,<7"