comcheck-api 1.0.0__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.
- comcheck_api/DISCLAIMER.md +24 -0
- comcheck_api/__init__.py +99 -0
- comcheck_api/ai/__init__.py +30 -0
- comcheck_api/ai/skill/SKILL.md +285 -0
- comcheck_api/ai/skill/__init__.py +5 -0
- comcheck_api/ai/skill/reference/operations.md +101 -0
- comcheck_api/ai/skill/reference/simulation.md +99 -0
- comcheck_api/ai/skill/reference/types.md +90 -0
- comcheck_api/ai/skill/scripts/__init__.py +1 -0
- comcheck_api/ai/skill/scripts/validate_code.py +210 -0
- comcheck_api/api/__init__.py +1 -0
- comcheck_api/api/api_services.py +273 -0
- comcheck_api/cli.py +136 -0
- comcheck_api/client/__init__.py +1 -0
- comcheck_api/client/comcheck_client.py +335 -0
- comcheck_api/constants/__init__.py +0 -0
- comcheck_api/constants/building_area_constants.py +35 -0
- comcheck_api/constants/common_constants.py +116 -0
- comcheck_api/constants/envelope_constants.py +250 -0
- comcheck_api/defaults.py +150 -0
- comcheck_api/exceptions.py +54 -0
- comcheck_api/introspection.py +188 -0
- comcheck_api/managers/__init__.py +0 -0
- comcheck_api/managers/components/__init__.py +0 -0
- comcheck_api/managers/components/building_area.py +11 -0
- comcheck_api/managers/components/envelope/__init__.py +0 -0
- comcheck_api/managers/components/envelope/ag_wall.py +97 -0
- comcheck_api/managers/components/envelope/bg_wall.py +39 -0
- comcheck_api/managers/components/envelope/door.py +11 -0
- comcheck_api/managers/components/envelope/floor.py +11 -0
- comcheck_api/managers/components/envelope/roof.py +30 -0
- comcheck_api/managers/components/envelope/skylight.py +11 -0
- comcheck_api/managers/components/envelope/window.py +11 -0
- comcheck_api/managers/data_manager.py +369 -0
- comcheck_api/project_operations/__init__.py +8 -0
- comcheck_api/project_operations/project_building_area_operations.py +107 -0
- comcheck_api/project_operations/project_envelope_operations.py +899 -0
- comcheck_api/schemas/comCheck.schema.json +6463 -0
- comcheck_api/types/__init__.py +49 -0
- comcheck_api/types/api_types.py +127 -0
- comcheck_api/types/common_types.py +32 -0
- comcheck_api/types/core_types.py +4198 -0
- comcheck_api/types/custom_base_model.py +314 -0
- comcheck_api/utilities/__init__.py +5 -0
- comcheck_api/utilities/common.py +50 -0
- comcheck_api/utilities/envelope_utilities.py +46 -0
- comcheck_api/utilities/id_registry.py +79 -0
- comcheck_api/utilities/project_utilities.py +60 -0
- comcheck_api/validation.py +64 -0
- comcheck_api-1.0.0.dist-info/METADATA +244 -0
- comcheck_api-1.0.0.dist-info/RECORD +54 -0
- comcheck_api-1.0.0.dist-info/WHEEL +4 -0
- comcheck_api-1.0.0.dist-info/entry_points.txt +2 -0
- comcheck_api-1.0.0.dist-info/licenses/LICENSE +24 -0
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
"""Type definitions for the comcheckweb-api-python package.
|
|
2
|
+
|
|
3
|
+
This module re-exports all generated types from api_types and core_types
|
|
4
|
+
so package users can import them directly.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from types import ModuleType
|
|
8
|
+
from typing import List
|
|
9
|
+
|
|
10
|
+
# Import modules to access their __all__ if defined
|
|
11
|
+
from . import api_types as _api_types
|
|
12
|
+
from . import common_types as _common_types
|
|
13
|
+
from . import core_types as _core_types
|
|
14
|
+
from .api_types import * # noqa: F401, F403
|
|
15
|
+
from .common_types import * # noqa: F401, F403
|
|
16
|
+
from .core_types import * # noqa: F401, F403
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
def _collect_exports(mod: ModuleType) -> List[str]:
|
|
20
|
+
"""Collect public names exported by a module.
|
|
21
|
+
|
|
22
|
+
Uses the module's ``__all__`` list when available; otherwise falls back to
|
|
23
|
+
all names that do not start with an underscore.
|
|
24
|
+
|
|
25
|
+
Args:
|
|
26
|
+
mod: The module to inspect.
|
|
27
|
+
|
|
28
|
+
Returns:
|
|
29
|
+
List of exportable name strings.
|
|
30
|
+
"""
|
|
31
|
+
if hasattr(mod, "__all__"):
|
|
32
|
+
return list(mod.__all__)
|
|
33
|
+
return [name for name in dir(mod) if not name.startswith("_")]
|
|
34
|
+
|
|
35
|
+
|
|
36
|
+
# Build __all__ from all modules
|
|
37
|
+
__all__ = []
|
|
38
|
+
|
|
39
|
+
for name in _collect_exports(_common_types):
|
|
40
|
+
if name not in __all__:
|
|
41
|
+
__all__.append(name)
|
|
42
|
+
|
|
43
|
+
for name in _collect_exports(_api_types):
|
|
44
|
+
if name not in __all__:
|
|
45
|
+
__all__.append(name)
|
|
46
|
+
|
|
47
|
+
for name in _collect_exports(_core_types):
|
|
48
|
+
if name not in __all__:
|
|
49
|
+
__all__.append(name)
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
"""Pydantic models for COMcheck API request and response payloads.
|
|
2
|
+
|
|
3
|
+
These models represent the JSON structures returned by the COMcheck Web API
|
|
4
|
+
and are used internally by :class:`~comcheck_api.api.COMCheckApiService` and
|
|
5
|
+
:class:`~comcheck_api.client.COMcheckClient` for type-safe deserialization.
|
|
6
|
+
"""
|
|
7
|
+
|
|
8
|
+
from enum import StrEnum
|
|
9
|
+
from typing import Any
|
|
10
|
+
from pydantic import BaseModel, ConfigDict
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
class SimulationStatus(StrEnum):
|
|
14
|
+
"""Known lifecycle states for a COMcheck simulation session.
|
|
15
|
+
|
|
16
|
+
This catalog is **not exhaustive** — the server may introduce
|
|
17
|
+
additional states without notice. ``StatusInfo.status`` is typed
|
|
18
|
+
as ``str`` so unknown values still parse cleanly; only the
|
|
19
|
+
terminal pair (``SUCCESS`` / ``FAILED``) is guaranteed to remain
|
|
20
|
+
stable. Compare against these members for terminal detection;
|
|
21
|
+
treat anything else as "still in progress."
|
|
22
|
+
"""
|
|
23
|
+
|
|
24
|
+
INITIALIZING = "INITIALIZING"
|
|
25
|
+
GENERATING_BASELINE = "GENERATING_BASELINE"
|
|
26
|
+
GENERATING_PROPOSED = "GENERATING_PROPOSED"
|
|
27
|
+
RUNNING_SIMULATIONS = "RUNNING_SIMULATIONS"
|
|
28
|
+
CALCULATING_RESULTS = "CALCULATING_RESULTS"
|
|
29
|
+
EVALUATING = "EVALUATING"
|
|
30
|
+
SUCCESS = "SUCCESS"
|
|
31
|
+
FAILED = "FAILED"
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
class ApiResponse(BaseModel):
|
|
35
|
+
"""Base model for all COMcheck API responses.
|
|
36
|
+
|
|
37
|
+
Attributes:
|
|
38
|
+
success: Whether the API call succeeded. Defaults to ``True``
|
|
39
|
+
because the server omits this field on successful responses
|
|
40
|
+
(failures surface as non-2xx HTTP statuses, which the client
|
|
41
|
+
raises as exceptions before validation).
|
|
42
|
+
message: Optional human-readable message from the server.
|
|
43
|
+
data: Response payload (type varies by endpoint).
|
|
44
|
+
errors: List of error strings, if any.
|
|
45
|
+
"""
|
|
46
|
+
|
|
47
|
+
success: bool = True
|
|
48
|
+
message: str | None = None
|
|
49
|
+
data: Any = None
|
|
50
|
+
errors: list[str] | None = None
|
|
51
|
+
|
|
52
|
+
|
|
53
|
+
class SessionInfo(BaseModel):
|
|
54
|
+
"""Session metadata returned when a simulation is started.
|
|
55
|
+
|
|
56
|
+
Attributes:
|
|
57
|
+
sessionId: Unique identifier for the simulation session.
|
|
58
|
+
"""
|
|
59
|
+
|
|
60
|
+
model_config = ConfigDict(extra="allow")
|
|
61
|
+
sessionId: str
|
|
62
|
+
|
|
63
|
+
|
|
64
|
+
class RunSimulationResponse(ApiResponse):
|
|
65
|
+
"""Response from the ``start-run-simulation`` endpoint.
|
|
66
|
+
|
|
67
|
+
Attributes:
|
|
68
|
+
data: Session information for the started simulation, or ``None`` on failure.
|
|
69
|
+
"""
|
|
70
|
+
|
|
71
|
+
data: SessionInfo | None = None
|
|
72
|
+
|
|
73
|
+
|
|
74
|
+
class StatusInfo(BaseModel):
|
|
75
|
+
"""Simulation status details.
|
|
76
|
+
|
|
77
|
+
Attributes:
|
|
78
|
+
sessionId: The simulation session identifier.
|
|
79
|
+
status: Current lifecycle state. Typed as ``str`` because the
|
|
80
|
+
server may emit values not yet enumerated in
|
|
81
|
+
:class:`SimulationStatus` (the enum is a known-values
|
|
82
|
+
catalog, not an exhaustive contract). The terminal pair
|
|
83
|
+
(``"SUCCESS"`` / ``"FAILED"``) is guaranteed stable.
|
|
84
|
+
message: Optional status message from the server.
|
|
85
|
+
"""
|
|
86
|
+
|
|
87
|
+
sessionId: str
|
|
88
|
+
status: str
|
|
89
|
+
message: str | None = None
|
|
90
|
+
|
|
91
|
+
|
|
92
|
+
class SimulationStatusResponse(ApiResponse):
|
|
93
|
+
"""Response from the ``get-status-simulation`` endpoint.
|
|
94
|
+
|
|
95
|
+
Attributes:
|
|
96
|
+
data: Status details for the queried session, or ``None`` on failure.
|
|
97
|
+
"""
|
|
98
|
+
|
|
99
|
+
data: StatusInfo | None = None
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
class SimulationResultInfo(BaseModel):
|
|
103
|
+
"""Simulation result metrics.
|
|
104
|
+
|
|
105
|
+
Attributes:
|
|
106
|
+
sessionId: The simulation session identifier.
|
|
107
|
+
performanceRating: Overall performance rating (percentage).
|
|
108
|
+
energyCreditPerformanceRating: Energy credit performance rating.
|
|
109
|
+
proposedBpf: Proposed building performance factor.
|
|
110
|
+
baselineBpf: Baseline building performance factor.
|
|
111
|
+
"""
|
|
112
|
+
|
|
113
|
+
sessionId: str
|
|
114
|
+
performanceRating: float | None = None
|
|
115
|
+
energyCreditPerformanceRating: float | None = None
|
|
116
|
+
proposedBpf: float | None = None
|
|
117
|
+
baselineBpf: float | None = None
|
|
118
|
+
|
|
119
|
+
|
|
120
|
+
class SimulationResultResponse(ApiResponse):
|
|
121
|
+
"""Response from the ``get-result-simulation`` endpoint.
|
|
122
|
+
|
|
123
|
+
Attributes:
|
|
124
|
+
data: Result metrics for the queried session, or ``None`` on failure.
|
|
125
|
+
"""
|
|
126
|
+
|
|
127
|
+
data: SimulationResultInfo | None = None
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
"""Common utility types used throughout the comcheckweb package.
|
|
2
|
+
|
|
3
|
+
This module contains generic types, enums, and type aliases that are used
|
|
4
|
+
across multiple modules but aren't generated from schemas.
|
|
5
|
+
"""
|
|
6
|
+
|
|
7
|
+
from enum import Enum
|
|
8
|
+
from typing import Literal
|
|
9
|
+
|
|
10
|
+
# Type alias for assembly types
|
|
11
|
+
AssemblyType = Literal[
|
|
12
|
+
"Roof", "Skylight", "AgWall", "Floor", "BgWall", "Window", "Door"
|
|
13
|
+
]
|
|
14
|
+
|
|
15
|
+
|
|
16
|
+
# Runtime-friendly enum (useful when you need a value at runtime)
|
|
17
|
+
class AssemblyTypeEnum(str, Enum):
|
|
18
|
+
"""Enum representation of assembly types for runtime validation and iteration."""
|
|
19
|
+
|
|
20
|
+
ROOF = "Roof"
|
|
21
|
+
SKYLIGHT = "Skylight"
|
|
22
|
+
AGWALL = "AgWall"
|
|
23
|
+
FLOOR = "Floor"
|
|
24
|
+
BGWALL = "BgWall"
|
|
25
|
+
WINDOW = "Window"
|
|
26
|
+
DOOR = "Door"
|
|
27
|
+
|
|
28
|
+
|
|
29
|
+
__all__ = [
|
|
30
|
+
"AssemblyType",
|
|
31
|
+
"AssemblyTypeEnum",
|
|
32
|
+
]
|