# Overview
A package containing functionality to compute ampacity line ratings for overhead lines.
Currently, the package only contains equations from CIGRE TB 601.
## Installation
```raw
pip install linerate
```
## Documentation
This library is split into four main parts:
1. The `equations` module, which contains one pure function for each equation in CIGRE TB 601,
2. the `types` module, which contains datatypes for conductors, weather parameters and spans,
3. the `model` module, which contains a wrapper class `Cigre601` to easily compute the ampacity and conductor temperature based on a `Span` and `Weather` instance,
4. and the `solver` module, which contains a vectorized bisection solver for estimating the steady state ampacity and temperature of a conductor.
A typical user of this software package will only use the `types` and `model` module,
and the `model` module will then use functions from `equations` and `solver` to estimate the conductor temperature and ampacity. However, to understand the parameters, it may be useful to look at the functions
in the `equations` module, as we have taken care to ensure that the argument names stay consistent.
Below, we see an example of how to compute the conductor temperature based on *Example B* on page 79-81 in CIGRE TB 601.
```python
import numpy as np
import linerate
conductor = linerate.Conductor(
core_diameter=10.4e-3,
conductor_diameter=28.1e-3,
outer_layer_strand_diameter=2.2e-3,
emissivity=0.9,
solar_absorptivity=0.9,
temperature1=25,
temperature2=75,
resistance_at_temperature1=7.283e-5,
resistance_at_temperature2=8.688e-5,
aluminium_cross_section_area=float("nan"), # No core magnetisation loss
constant_magnetic_effect=1,
current_density_proportional_magnetic_effect=0,
max_magnetic_core_relative_resistance_increase=1,
)
start_tower = linerate.Tower(latitude=50 - 0.0045, longitude=0, altitude=500 - 88)
end_tower = linerate.Tower(latitude=50 + 0.0045, longitude=0, altitude=500 + 88)
span = linerate.Span(
conductor=conductor,
start_tower=start_tower,
end_tower=end_tower,
ground_albedo=0.15,
num_conductors=1,
)
weather = linerate.Weather(
air_temperature=20,
wind_direction=np.radians(80), # Conductor azimuth is 0, so angle of attack is 80
wind_speed=1.66,
clearness_ratio=0.5,
)
time_of_measurement = np.datetime64("2016-10-03 14:00")
max_conductor_temperature = 100
current_load = 1000
model = linerate.Cigre601(span, weather, time_of_measurement)
conductor_rating = model.compute_steady_state_ampacity(max_conductor_temperature)
print(f"The span has a steady-state ampacity rating of {conductor_rating:.0f} A if the maximum temperature is {max_conductor_temperature} °C")
conductor_temperature = model.compute_conductor_temperature(current_load)
print(f"The conductor has a temperature of {conductor_temperature:.0f} °C when operated at {current_load} A")
```
## Transient state solver
There is currently no transient solver or short time thermal rating solver, but that is on the roadmap.
## Development
Dependencies for the project are managed with poetry.
To install all dependencies run:
```raw
poetry install
```
Remember that when developing a library it is *not* recommended to
commit the `poetry.lock` file.
### Generate docs
To generate docs locally:
- Install required dependencies with `poetry install --with docs`.
- Generate docs with `poetry run make html` in the `docs` folder.
### Release new version
Press the "Draft new release" button on the [Releases](https://github.com/statnett/linerate/releases) page.
Choose or create an appropriate tag, e.g. `1.2.3`.
Press "Generate release notes" to generate release notes.
Edit Release notes if necessary and press "Publish release".
This causes the publish workflow to run, which publishes the package to PyPI and generates [docs on Github pages](https://statnett.github.io/linerate/).
Raw data
{
"_id": null,
"home_page": "https://github.com/statnett/linerate.git",
"name": "linerate",
"maintainer": null,
"docs_url": null,
"requires_python": "<3.13,>=3.9",
"maintainer_email": null,
"keywords": null,
"author": "Statnett Datascience",
"author_email": "Datascience.Drift@Statnett.no",
"download_url": "https://files.pythonhosted.org/packages/84/f6/438575a236acbb940264e31db0fa1d8a3ddf0fa070d2f60aedb278b42ba1/linerate-1.2.0.tar.gz",
"platform": null,
"description": "# Overview\n\nA package containing functionality to compute ampacity line ratings for overhead lines.\nCurrently, the package only contains equations from CIGRE TB 601.\n\n## Installation\n\n```raw\npip install linerate\n```\n\n## Documentation\n\nThis library is split into four main parts:\n\n 1. The `equations` module, which contains one pure function for each equation in CIGRE TB 601,\n 2. the `types` module, which contains datatypes for conductors, weather parameters and spans,\n 3. the `model` module, which contains a wrapper class `Cigre601` to easily compute the ampacity and conductor temperature based on a `Span` and `Weather` instance,\n 4. and the `solver` module, which contains a vectorized bisection solver for estimating the steady state ampacity and temperature of a conductor.\n\nA typical user of this software package will only use the `types` and `model` module,\nand the `model` module will then use functions from `equations` and `solver` to estimate the conductor temperature and ampacity. However, to understand the parameters, it may be useful to look at the functions\nin the `equations` module, as we have taken care to ensure that the argument names stay consistent.\n\nBelow, we see an example of how to compute the conductor temperature based on *Example B* on page 79-81 in CIGRE TB 601.\n\n```python\nimport numpy as np\nimport linerate\n\n\nconductor = linerate.Conductor(\n core_diameter=10.4e-3,\n conductor_diameter=28.1e-3,\n outer_layer_strand_diameter=2.2e-3,\n emissivity=0.9,\n solar_absorptivity=0.9,\n temperature1=25,\n temperature2=75,\n resistance_at_temperature1=7.283e-5,\n resistance_at_temperature2=8.688e-5,\n aluminium_cross_section_area=float(\"nan\"), # No core magnetisation loss\n constant_magnetic_effect=1,\n current_density_proportional_magnetic_effect=0,\n max_magnetic_core_relative_resistance_increase=1,\n)\n\n\nstart_tower = linerate.Tower(latitude=50 - 0.0045, longitude=0, altitude=500 - 88)\nend_tower = linerate.Tower(latitude=50 + 0.0045, longitude=0, altitude=500 + 88)\nspan = linerate.Span(\n conductor=conductor,\n start_tower=start_tower,\n end_tower=end_tower,\n ground_albedo=0.15,\n num_conductors=1,\n)\n\n\nweather = linerate.Weather(\n air_temperature=20,\n wind_direction=np.radians(80), # Conductor azimuth is 0, so angle of attack is 80\n wind_speed=1.66,\n clearness_ratio=0.5,\n)\n\n\ntime_of_measurement = np.datetime64(\"2016-10-03 14:00\")\nmax_conductor_temperature = 100\ncurrent_load = 1000\n\nmodel = linerate.Cigre601(span, weather, time_of_measurement)\nconductor_rating = model.compute_steady_state_ampacity(max_conductor_temperature)\nprint(f\"The span has a steady-state ampacity rating of {conductor_rating:.0f} A if the maximum temperature is {max_conductor_temperature} \u00b0C\")\nconductor_temperature = model.compute_conductor_temperature(current_load)\nprint(f\"The conductor has a temperature of {conductor_temperature:.0f} \u00b0C when operated at {current_load} A\")\n```\n\n## Transient state solver\n\nThere is currently no transient solver or short time thermal rating solver, but that is on the roadmap.\n\n## Development\n\nDependencies for the project are managed with poetry.\nTo install all dependencies run:\n\n```raw\npoetry install\n```\n\nRemember that when developing a library it is *not* recommended to\ncommit the `poetry.lock` file.\n\n### Generate docs\nTo generate docs locally:\n- Install required dependencies with `poetry install --with docs`.\n- Generate docs with `poetry run make html` in the `docs` folder.\n\n### Release new version\nPress the \"Draft new release\" button on the [Releases](https://github.com/statnett/linerate/releases) page.\nChoose or create an appropriate tag, e.g. `1.2.3`.\nPress \"Generate release notes\" to generate release notes.\nEdit Release notes if necessary and press \"Publish release\".\nThis causes the publish workflow to run, which publishes the package to PyPI and generates [docs on Github pages](https://statnett.github.io/linerate/).\n\n",
"bugtrack_url": null,
"license": null,
"summary": "Library for computing line ampacity ratings for overhead lines",
"version": "1.2.0",
"project_urls": {
"Homepage": "https://github.com/statnett/linerate.git",
"Repository": "https://github.com/statnett/linerate.git"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "039f8146a99051327b5edfbbc8560702fcd7bb78c7a9e16d4cd257f640c7e4fe",
"md5": "9f585ae7fe2320bcd7ec990744764877",
"sha256": "dc982e9b4aa2b99573a65e4ee37ec703fb9b205fea9089f88faf1100f613879f"
},
"downloads": -1,
"filename": "linerate-1.2.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "9f585ae7fe2320bcd7ec990744764877",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<3.13,>=3.9",
"size": 41743,
"upload_time": "2024-06-14T11:21:04",
"upload_time_iso_8601": "2024-06-14T11:21:04.948145Z",
"url": "https://files.pythonhosted.org/packages/03/9f/8146a99051327b5edfbbc8560702fcd7bb78c7a9e16d4cd257f640c7e4fe/linerate-1.2.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "84f6438575a236acbb940264e31db0fa1d8a3ddf0fa070d2f60aedb278b42ba1",
"md5": "972c6ac31683cb84c206d0c6565fb7f0",
"sha256": "aa0ab12a1e232c76b538e11b013854a9c2d8e1f9476d7e55873ff5d8510ea385"
},
"downloads": -1,
"filename": "linerate-1.2.0.tar.gz",
"has_sig": false,
"md5_digest": "972c6ac31683cb84c206d0c6565fb7f0",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<3.13,>=3.9",
"size": 28512,
"upload_time": "2024-06-14T11:21:06",
"upload_time_iso_8601": "2024-06-14T11:21:06.381086Z",
"url": "https://files.pythonhosted.org/packages/84/f6/438575a236acbb940264e31db0fa1d8a3ddf0fa070d2f60aedb278b42ba1/linerate-1.2.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-06-14 11:21:06",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "statnett",
"github_project": "linerate",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "linerate"
}