Skip to content

Commit

Permalink
chore: Remove unnecessary comments
Browse files Browse the repository at this point in the history
  • Loading branch information
jpmckinney committed Oct 3, 2024
1 parent 61611d2 commit dae10e2
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions pelican/util/currency_converter.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def import_data(data: list[tuple[datetime.date, dict[str, float]]]) -> None:


def interpolation_closest(currency, start_date, end_date):
"""start_date and end_date are exclusive."""
# start_date and end_date are exclusive.
start_date_rate = rates[start_date][currency]
end_date_rate = rates[end_date][currency]

Expand Down Expand Up @@ -100,7 +100,7 @@ def interpolation_closest(currency, start_date, end_date):


def interpolation_linear(currency, start_date, end_date):
"""start_date and end_date are exclusive."""
# start_date and end_date are exclusive.
start_date_rate = rates[start_date][currency]
end_date_rate = rates[end_date][currency]

Expand Down Expand Up @@ -165,23 +165,19 @@ def convert(amount, original_currency, target_currency, rel_date):
except (TypeError, ValueError):
return None

# original currency
original_currency_rate = None
if rel_date in rates and original_currency in rates[rel_date]:
original_currency_rate = rates[rel_date][original_currency]
elif settings.CURRENCY_CONVERTER_EXTRAPOLATION == "closest":
original_currency_rate = extrapolation_closest_rate(original_currency, rel_date)

if original_currency_rate is None:
return None

# target currency
target_currency_rate = None
if rel_date in rates and target_currency in rates[rel_date]:
target_currency_rate = rates[rel_date][target_currency]
elif settings.CURRENCY_CONVERTER_EXTRAPOLATION == "closest":
target_currency_rate = extrapolation_closest_rate(target_currency, rel_date)

if target_currency_rate is None:
return None

Expand Down

0 comments on commit dae10e2

Please sign in to comment.