numbers-parser 4.14.1__py3-none-any.whl → 4.14.2__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -65,7 +65,7 @@ DOCUMENT_ID = 1
65
65
  PACKAGE_ID = 2
66
66
 
67
67
  # System constants
68
- EPOCH = datetime(2001, 1, 1)
68
+ EPOCH = datetime(2001, 1, 1) # noqa: DTZ001
69
69
  SECONDS_IN_HOUR = 60 * 60
70
70
  SECONDS_IN_DAY = SECONDS_IN_HOUR * 24
71
71
  SECONDS_IN_WEEK = SECONDS_IN_DAY * 7
@@ -90,6 +90,7 @@ SUPPORTED_NUMBERS_VERSIONS = [
90
90
  "14.0",
91
91
  "14.1",
92
92
  "14.2",
93
+ "14.3",
93
94
  ]
94
95
 
95
96
 
@@ -269,7 +270,8 @@ CUSTOM_FORMATTING_ALLOWED_CELLS = {
269
270
 
270
271
  @enum_tools.documentation.document_enum
271
272
  class NegativeNumberStyle(IntEnum):
272
- """How negative numbers are formatted.
273
+ """
274
+ How negative numbers are formatted.
273
275
 
274
276
  This enum is used in cell data formats and cell custom formats using the
275
277
  `negative_style` keyword argument.
@@ -287,7 +289,8 @@ class NegativeNumberStyle(IntEnum):
287
289
 
288
290
  @enum_tools.documentation.document_enum
289
291
  class FractionAccuracy(IntEnum):
290
- """How fractions are formatted.
292
+ """
293
+ How fractions are formatted.
291
294
 
292
295
  This enum is used in cell data formats and cell custom formats using the
293
296
  `fraction_accuracy` keyword argument.
@@ -10,7 +10,7 @@ from numbers_parser.iwork import IWork, IWorkHandler
10
10
  class ItemsList:
11
11
  def __init__(self, model, refs, item_class) -> None:
12
12
  self._item_name = item_class.__name__.lower()
13
- self._items = [item_class(model, id) for id in refs]
13
+ self._items = [item_class(model, x) for x in refs]
14
14
 
15
15
  def __getitem__(self, key: int):
16
16
  if isinstance(key, int):
@@ -20,16 +20,15 @@ class ItemsList:
20
20
  msg = f"index {key} out of range"
21
21
  raise IndexError(msg)
22
22
  return self._items[key]
23
- elif isinstance(key, str):
23
+ if isinstance(key, str):
24
24
  for item in self._items:
25
25
  if item.name == key:
26
26
  return item
27
27
  msg = f"no {self._item_name} named '{key}'"
28
28
  raise KeyError(msg)
29
- else:
30
- t = type(key).__name__
31
- msg = f"invalid index type {t}"
32
- raise LookupError(msg)
29
+ t = type(key).__name__
30
+ msg = f"invalid index type {t}"
31
+ raise LookupError(msg)
33
32
 
34
33
  def __len__(self) -> int:
35
34
  return len(self._items)
@@ -37,7 +36,7 @@ class ItemsList:
37
36
  def __contains__(self, key) -> bool:
38
37
  return key.lower() in [x.name.lower() for x in self._items]
39
38
 
40
- def append(self, item):
39
+ def append(self, item) -> None:
41
40
  self._items.append(item)
42
41
 
43
42
 
@@ -79,7 +78,8 @@ class ObjectStore(IWorkHandler):
79
78
  return self._max_id
80
79
 
81
80
  def create_object_from_dict(self, iwa_file: str, object_dict: dict, cls: object, append=False):
82
- """Create a new object and store the associated IWA segment. Return the
81
+ """
82
+ Create a new object and store the associated IWA segment. Return the
83
83
  message ID for the object and the newly created object. If the IWA
84
84
  file cannot be found, it will be created.
85
85
  """
@@ -100,8 +100,9 @@ class ObjectStore(IWorkHandler):
100
100
  self._object_to_filename_map[new_id] = iwa_pathname
101
101
  return new_id, self._objects[new_id]
102
102
 
103
- def update_object_file_store(self):
104
- """Copy the protobuf messages from any updated object to the cached
103
+ def update_object_file_store(self) -> None:
104
+ """
105
+ Copy the protobuf messages from any updated object to the cached
105
106
  version in the file store so this can be saved to a new document.
106
107
  """
107
108
  for obj_id in self._objects: