Skip to content

Commit

Permalink
renamed fix_exponent_notation and fix_power_notation as suggest
Browse files Browse the repository at this point in the history
  • Loading branch information
siligam committed Jul 4, 2024
1 parent 1993a73 commit ad901e9
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/pymorize/units.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
ureg.define("molFe = 55.874 * g")


def fix_exponent_notation(s, pattern=re.compile(r"(?P<name>\w+)-(?P<exp>\d+)")):
def format_exponent_notation(s, pattern=re.compile(r"(?P<name>\w+)-(?P<exp>\d+)")):
"m-2 -> m^-2"

def correction(match):
Expand All @@ -47,7 +47,7 @@ def correction(match):
return re.sub(pattern, correction, s)


def fix_power_notation(s, pattern=re.compile(r"(?P<name>\w+)(?P<exp>\d+)")):
def format_power_notation(s, pattern=re.compile(r"(?P<name>\w+)(?P<exp>\d+)")):
"m2 -> m^2"

def correction(match):
Expand All @@ -66,7 +66,7 @@ def correction(match):

def to_caret_notation(unit):
"Formats the unit so Pint can understand them"
return fix_power_notation(fix_exponent_notation(unit))
return format_power_notation(format_exponent_notation(unit))


def calculate_unit_conversion_factor(a: str, b: str) -> float:
Expand Down

0 comments on commit ad901e9

Please sign in to comment.