citydpc 0.1.22__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.
citydpc/__init__.py ADDED
@@ -0,0 +1,33 @@
1
+ from citydpc.dataset import Dataset
2
+
3
+ from citydpc.logger import logger
4
+ from . import config
5
+
6
+ from typing import List, Type, Optional
7
+
8
+
9
+ def configure_warnings(
10
+ warn_always: bool = None,
11
+ suppress_warnings: Optional[List[Type[Warning]]] = None,
12
+ ):
13
+ """Configure the warning behavior of the library.
14
+
15
+ Parameters
16
+ ----------
17
+ warn_always : bool, optional
18
+ If True, the library will always show warnings for each occurrence.
19
+ If False, it will only show one warning per category (default is False)
20
+ """
21
+ if warn_always is not None:
22
+ config.WARN_ONCE_PER_CATEGORY = not warn_always
23
+ logger.info(
24
+ "Configured warnings: "
25
+ + f"{'always' if warn_always else 'once per category'}"
26
+ )
27
+
28
+ if suppress_warnings is not None:
29
+ config.SUPPRESSED_WARNING_CATEGORIES = set(suppress_warnings)
30
+ logger.info(
31
+ "Configured suppressed warnings: "
32
+ + f"{', '.join([w.__name__ for w in suppress_warnings])}"
33
+ )
citydpc/config.py ADDED
@@ -0,0 +1,8 @@
1
+
2
+ from typing import Set, Type
3
+
4
+ # only show one warning per category
5
+ WARN_ONCE_PER_CATEGORY = False
6
+
7
+ # Suppress specific warning categories
8
+ SUPPRESSED_WARNING_CATEGORIES: Set[Type[Warning]] = set()
File without changes
@@ -0,0 +1,22 @@
1
+ from citydpc.logger import logger
2
+ CALC_ROOF_VOLUME_ON_IMPORT = False
3
+ CHECK_IF_SURFACES_ARE_PLANAR = True
4
+ FIX_GROUNDSURFACE_OUTLIERS = False
5
+
6
+
7
+ def set_roof_volume_calculation(value: bool) -> None:
8
+ global CALC_ROOF_VOLUME_ON_IMPORT
9
+ logger.info("Setting roof volume calculation to: %s", value)
10
+ CALC_ROOF_VOLUME_ON_IMPORT = value
11
+
12
+
13
+ def set_check_if_surfaces_are_planar(value: bool) -> None:
14
+ global CHECK_IF_SURFACES_ARE_PLANAR
15
+ logger.info("Setting check if surfaces are planar to: %s", value)
16
+ CHECK_IF_SURFACES_ARE_PLANAR = value
17
+
18
+
19
+ def set_fix_groundsurface_outliers(value: bool) -> None:
20
+ global FIX_GROUNDSURFACE_OUTLIERS
21
+ logger.info("Setting fix ground surface outliers to: %s", value)
22
+ FIX_GROUNDSURFACE_OUTLIERS = value