Skip to content

Commit

Permalink
ruff formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
ahankinson committed Aug 13, 2024
1 parent 8c4f968 commit 6f08bce
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
5 changes: 3 additions & 2 deletions edtf/natlang/en.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Utilities to derive an EDTF string from an (English) natural language string."""

import functools
import re
from datetime import datetime
Expand Down Expand Up @@ -52,7 +53,7 @@
REJECT_RULES = re.compile(r".*dynasty.*") # Don't parse '23rd Dynasty' to 'uuuu-uu-23'


@functools.lru_cache()
@functools.lru_cache
def text_to_edtf(text: str) -> Optional[str]:
"""
Generate EDTF string equivalent of a given natural language date string.
Expand Down Expand Up @@ -133,7 +134,7 @@ def text_to_edtf(text: str) -> Optional[str]:
return result


@functools.lru_cache()
@functools.lru_cache
def text_to_edtf_date(text: str) -> Optional[str]:
"""
Return EDTF string equivalent of a given natural language date string.
Expand Down
9 changes: 4 additions & 5 deletions edtf/parser/parser_classes.py
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,6 @@ class EDTFObject:

parser = None

def __init__(self, *args, **kwargs):
errmsg: str = f"{type(self).__name__}.__init__(*{args}, **{kwargs})"
raise NotImplementedError(f"{errmsg} is not implemented.")

@classmethod
def set_parser(cls, p):
cls.parser = p
Expand Down Expand Up @@ -288,6 +284,7 @@ def set_year(self, y: int):

def get_year(self) -> int:
return self._year

year = property(get_year, set_year)

def set_month(self, m: Optional[int]):
Expand All @@ -297,6 +294,7 @@ def set_month(self, m: Optional[int]):

def get_month(self) -> Optional[int]:
return self._month

month = property(get_month, set_month)

def __str__(self):
Expand Down Expand Up @@ -932,8 +930,9 @@ def __str__(self):

return result

def set_year(self, y): # Year can be None.
def set_year(self, y): # Year can be None.
self._year = y

year = property(Date.get_year, set_year)

def _precise_year(self, lean: str):
Expand Down

0 comments on commit 6f08bce

Please sign in to comment.