Metadata-Version: 2.4
Name: cable-thermal-model
Version: 2.1.0
Summary: Cable Thermal Model (CTM) is a physical model used to calculate dynamic cable temperatures.
License-Expression: MPL-2.0
License-File: LICENSE
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Programming Language :: Python :: 3.14
Requires-Dist: pandas>=2.2.3,<3.0.0
Requires-Dist: scipy>=1.15.0,<2.0.0
Requires-Dist: structlog>=25.0.0,<26.0.0
Requires-Dist: pydantic>=2.13.4,<3.0.0
Requires-Dist: numpy>=2.4.6,<3.0.0
Requires-Dist: pandera>=0.31.1
Requires-Python: >=3.11, <3.15
Project-URL: Homepage, https://alliander-opensource.github.io/cable-thermal-model
Project-URL: Repository, https://github.com/alliander-opensource/cable-thermal-model
Project-URL: Documentation, https://alliander-opensource.github.io/cable-thermal-model/
Project-URL: Changelog, https://github.com/alliander-opensource/cable-thermal-model/blob/main/CHANGELOG.md
Project-URL: Issues, https://github.com/alliander-opensource/cable-thermal-model/issues
Description-Content-Type: text/markdown

<!--
SPDX-FileCopyrightText: Contributors to the Cable Thermal Model project

SPDX-License-Identifier: MPL-2.0
-->

# Cable thermal model

[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=alliander-opensource_cable-thermal-model&metric=alert_status)](https://sonarcloud.io/summary/new_code?id=alliander-opensource_cable-thermal-model)
[![Code Smells](https://sonarcloud.io/api/project_badges/measure?project=alliander-opensource_cable-thermal-model&metric=code_smells)](https://sonarcloud.io/summary/new_code?id=alliander-opensource_cable-thermal-model)
[![Coverage](https://sonarcloud.io/api/project_badges/measure?project=alliander-opensource_cable-thermal-model&metric=coverage)](https://sonarcloud.io/summary/new_code?id=alliander-opensource_cable-thermal-model)
[![Duplicated Lines (%)](https://sonarcloud.io/api/project_badges/measure?project=alliander-opensource_cable-thermal-model&metric=duplicated_lines_density)](https://sonarcloud.io/summary/new_code?id=alliander-opensource_cable-thermal-model)
[![Maintainability Rating](https://sonarcloud.io/api/project_badges/measure?project=alliander-opensource_cable-thermal-model&metric=sqale_rating)](https://sonarcloud.io/summary/new_code?id=alliander-opensource_cable-thermal-model)

Cable Thermal Model is a physical model which can be used to calculate cable
temperature profiles in situations with dynamic profiles for loads, ambient temperature,
soil properties. The model uses an implicit Euler finite difference approach to discretize the heat equation.
Moreover, it relies on the [NEN-IEC](https://www.nen.nl/) norms for cable ratings.
Cable Thermal Model supports different bonding types,
circuit types and environments in soil as well as in air.

# Getting started

## System Requirements

- **Python Version**: Python 3.11 or higher
- **Operating System**: Windows, Linux, or macOS
- **Package Manager**: uv

## Installation

### For Users

#### Installation via pip

Install the package from PyPI:

```bash
pip install cable-thermal-model
```

#### Installation via uv (Recommended)

For better dependency management, use uv:

**Adding to an Existing uv Project:**

```bash
uv add cable-thermal-model
```

**Creating a New uv Project:**

If you're starting from scratch, first create a new uv project:

```bash
# Create a new uv project
uv init my-cable-thermal-model
cd my-cable-thermal-model

# Add cable-thermal-model
uv add cable-thermal-model

# Install the project dependencies
uv sync
```

### For Developers

If you plan to contribute to the Cable Thermal Model, follow these steps to set up your development environment:

#### 1. Clone the Repository

```bash
git clone https://github.com/alliander-opensource/cable-thermal-model
cd cable-thermal-model
```

#### 2. Install Dependencies with uv

We recommend using uv for development:

```bash
# Install all dependencies including development tools
uv sync --group dev

```

#### 3. Enable Pre-commit Hooks

Pre-commit hooks ensure code quality and proper licensing headers:

```bash
# Install pre-commit hooks
pre-commit install --install-hooks
```

The **reuse** pre-commit hook ensures that all files have proper copyright headers (MPL-2.0 license).

### Verifying Your Installation

After installation, verify that the package is correctly installed by importing some of the main classes:

```python
from cable_thermal_model import (
    CircuitType,
    BondingType,
    StaticEnvSoil,
    StaticEnvAir,
    ModelFactory,
    CableKey
)

# Check the installed version
from cable_thermal_model  import __version__
print(f"Cable Thermal Model version: {__version__}")
```

If the import succeeds without errors, your installation is complete!

# Documentation
For more information regarding the model, technical documentation and working examples, please visit the documentation:

[https://alliander-opensource.github.io/cable-thermal-model/](https://alliander-opensource.github.io/cable-thermal-model/)
