maps4fs 0.9.94__py3-none-any.whl → 0.9.95__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.

Potentially problematic release.


This version of maps4fs might be problematic. Click here for more details.

@@ -17,7 +17,6 @@ from maps4fs.generator.dem import (
17
17
  )
18
18
  from maps4fs.generator.path_steps import DEFAULT_DISTANCE, PATH_FULL_NAME, get_steps
19
19
  from maps4fs.generator.tile import Tile
20
- from maps4fs.logger import timeit
21
20
 
22
21
  RESIZE_FACTOR = 1 / 4
23
22
  SIMPLIFY_FACTOR = 10
@@ -151,10 +150,9 @@ class Background(Component):
151
150
  self.logger.debug("Generating obj file for tile %s in path: %s", tile.code, save_path)
152
151
 
153
152
  dem_data = cv2.imread(tile.dem_path, cv2.IMREAD_UNCHANGED) # pylint: disable=no-member
154
- self.plane_from_np(tile.code, dem_data, save_path)
153
+ self.plane_from_np(tile.code, dem_data, save_path) # type: ignore
155
154
 
156
155
  # pylint: disable=too-many-locals
157
- @timeit
158
156
  def plane_from_np(self, tile_code: str, dem_data: np.ndarray, save_path: str) -> None:
159
157
  """Generates a 3D obj file based on DEM data.
160
158
 
maps4fs/generator/tile.py CHANGED
@@ -34,13 +34,13 @@ class Tile(DEM):
34
34
  if not self.code:
35
35
  raise ValueError("Tile code was not provided")
36
36
 
37
- self.logger.debug(f"Generating tile {self.code}")
37
+ self.logger.debug("Generating tile for code %s", self.code)
38
38
 
39
39
  tiles_directory = os.path.join(self.map_directory, "objects", "tiles")
40
40
  os.makedirs(tiles_directory, exist_ok=True)
41
41
 
42
42
  self._dem_path = os.path.join(tiles_directory, f"{self.code}.png")
43
- self.logger.debug(f"DEM path for tile {self.code} is {self._dem_path}")
43
+ self.logger.debug("DEM path for tile %s is %s", self.code, self._dem_path)
44
44
 
45
45
  def get_output_resolution(self) -> tuple[int, int]:
46
46
  """Return the resolution of the output image.
maps4fs/logger.py CHANGED
@@ -4,9 +4,7 @@ import logging
4
4
  import os
5
5
  import sys
6
6
  from datetime import datetime
7
- from logging import getLogger
8
- from time import perf_counter
9
- from typing import Any, Callable, Literal
7
+ from typing import Literal
10
8
 
11
9
  LOGGER_NAME = "maps4fs"
12
10
  log_directory = os.path.join(os.getcwd(), "logs")
@@ -46,25 +44,3 @@ class Logger(logging.Logger):
46
44
  today = datetime.now().strftime("%Y-%m-%d")
47
45
  log_file = os.path.join(log_directory, f"{today}.txt")
48
46
  return log_file
49
-
50
-
51
- def timeit(func: Callable[..., Any]) -> Callable[..., Any]:
52
- """Decorator to log the time taken by a function to execute.
53
-
54
- Args:
55
- func (function): The function to be timed.
56
-
57
- Returns:
58
- function: The timed function.
59
- """
60
-
61
- def timed(*args, **kwargs):
62
- logger = getLogger("maps4fs")
63
- start = perf_counter()
64
- result = func(*args, **kwargs)
65
- end = perf_counter()
66
- if logger is not None:
67
- logger.info("Function %s took %s seconds to execute", func.__name__, end - start)
68
- return result
69
-
70
- return timed
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: maps4fs
3
- Version: 0.9.94
3
+ Version: 0.9.95
4
4
  Summary: Generate map templates for Farming Simulator from real places.
5
5
  Author-email: iwatkot <iwatkot@gmail.com>
6
6
  License: MIT License
@@ -1,7 +1,7 @@
1
1
  maps4fs/__init__.py,sha256=da4jmND2Ths9AffnkAKgzLHNkvKFOc_l21gJisPXqWY,155
2
- maps4fs/logger.py,sha256=8oZzAKJllilYrVp452LX0zx-dNFwpS6UngbTrI6KfwA,2148
2
+ maps4fs/logger.py,sha256=B-NEYpMjPAAqlV4VpfTi6nbBFnEABVtQOaYe6nMpidg,1489
3
3
  maps4fs/generator/__init__.py,sha256=zZMLEkGzb4z0xql650gOtGSvcgX58DnJ2yN3vC2daRk,43
4
- maps4fs/generator/background.py,sha256=AP-Z3F-4I9achvA9xsaXAAoA6IHtmPLxb1RkUsVYdbg,14036
4
+ maps4fs/generator/background.py,sha256=XtrTtLEYL5yINFPib-RsYSisNlqBZx9brDCyn4bBj5E,14006
5
5
  maps4fs/generator/component.py,sha256=ZEDjChPnvqAsgnBu2f2YBOlwGOlfax4VaAYBcJerLIQ,10684
6
6
  maps4fs/generator/config.py,sha256=ZO5BWDU-S3p0-ndKDSFa8Oin3YcYy0iH8B4lqEA_07Q,4275
7
7
  maps4fs/generator/dem.py,sha256=2hqkNfJpMJ3rNUK5Mi1OoWzMaaDfycwr7Okb19PyF4M,17142
@@ -11,11 +11,11 @@ maps4fs/generator/map.py,sha256=tJqe4r4Y8Z8ARUJtFc_8xAQjta8sL_lKdbI89vrljVM,4668
11
11
  maps4fs/generator/path_steps.py,sha256=yeN6hmOD8O2LMozUf4HcQMIy8WJ5sHF5pGQT_s2FfOw,3147
12
12
  maps4fs/generator/qgis.py,sha256=R5Iv3ovyLXkhAL5Oy41u3ZLNOSEbc1byLetzPootO7o,6091
13
13
  maps4fs/generator/texture.py,sha256=SBWZRXq7CdSZh2e8PMW57J56-kqwRvrl_jCPxtOkpR8,22316
14
- maps4fs/generator/tile.py,sha256=3vmfjQiPiiUZKPuIo5tg2rOKkgcP1NRVkMGK-Vo10-A,2138
14
+ maps4fs/generator/tile.py,sha256=6zUpDidPcPRTGzQvYSNw-0Pj-if2WiakU2qb-40vyOk,2151
15
15
  maps4fs/toolbox/__init__.py,sha256=zZMLEkGzb4z0xql650gOtGSvcgX58DnJ2yN3vC2daRk,43
16
16
  maps4fs/toolbox/dem.py,sha256=53KVZ6IKIlK642eYFSRDAC8l2HL9IEUpQNYkkTC56uU,3510
17
- maps4fs-0.9.94.dist-info/LICENSE.md,sha256=pTKD_oUexcn-yccFCTrMeLkZy0ifLRa-VNcDLqLZaIw,10749
18
- maps4fs-0.9.94.dist-info/METADATA,sha256=n6Lg89YSNXIdJYftItLEW-zHWvQ44gLam6SSKlG50nc,25194
19
- maps4fs-0.9.94.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
20
- maps4fs-0.9.94.dist-info/top_level.txt,sha256=Ue9DSRlejRQRCaJueB0uLcKrWwsEq9zezfv5dI5mV1M,8
21
- maps4fs-0.9.94.dist-info/RECORD,,
17
+ maps4fs-0.9.95.dist-info/LICENSE.md,sha256=pTKD_oUexcn-yccFCTrMeLkZy0ifLRa-VNcDLqLZaIw,10749
18
+ maps4fs-0.9.95.dist-info/METADATA,sha256=PBJcYY-N-DuY-oBkbuE5k9isXXMtyyfQkInhEDSQxTI,25194
19
+ maps4fs-0.9.95.dist-info/WHEEL,sha256=PZUExdf71Ui_so67QXpySuHtCi3-J3wvF4ORK6k_S8U,91
20
+ maps4fs-0.9.95.dist-info/top_level.txt,sha256=Ue9DSRlejRQRCaJueB0uLcKrWwsEq9zezfv5dI5mV1M,8
21
+ maps4fs-0.9.95.dist-info/RECORD,,