caf.cvt 0.1.1__tar.gz
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.
- caf_cvt-0.1.1/LICENSE +22 -0
- caf_cvt-0.1.1/PKG-INFO +242 -0
- caf_cvt-0.1.1/README.md +176 -0
- caf_cvt-0.1.1/docs/requirements.txt +6 -0
- caf_cvt-0.1.1/pyproject.toml +196 -0
- caf_cvt-0.1.1/requirements.txt +10 -0
- caf_cvt-0.1.1/requirements_dev.txt +13 -0
- caf_cvt-0.1.1/setup.cfg +4 -0
- caf_cvt-0.1.1/src/caf/cvt/__init__.py +3 -0
- caf_cvt-0.1.1/src/caf/cvt/__main__.py +57 -0
- caf_cvt-0.1.1/src/caf/cvt/_version.py +15 -0
- caf_cvt-0.1.1/src/caf/cvt/data_cleaning.py +2104 -0
- caf_cvt-0.1.1/src/caf/cvt/file_paths.py +152 -0
- caf_cvt-0.1.1/src/caf/cvt/functional_rules.py +1338 -0
- caf_cvt-0.1.1/src/caf/cvt/layering.py +1112 -0
- caf_cvt-0.1.1/src/caf/cvt/model_config.py +387 -0
- caf_cvt-0.1.1/src/caf/cvt/py.typed +0 -0
- caf_cvt-0.1.1/src/caf.cvt.egg-info/PKG-INFO +242 -0
- caf_cvt-0.1.1/src/caf.cvt.egg-info/SOURCES.txt +22 -0
- caf_cvt-0.1.1/src/caf.cvt.egg-info/dependency_links.txt +1 -0
- caf_cvt-0.1.1/src/caf.cvt.egg-info/entry_points.txt +2 -0
- caf_cvt-0.1.1/src/caf.cvt.egg-info/requires.txt +27 -0
- caf_cvt-0.1.1/src/caf.cvt.egg-info/top_level.txt +1 -0
- caf_cvt-0.1.1/tests/test_example.py +22 -0
caf_cvt-0.1.1/LICENSE
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
Copyright © Transport for the North (“TfN”) (2026).
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
Use of this software and associated documentation files (“the Software”) by you indicates your acceptance of the terms and conditions below (“the Licence”).
|
|
5
|
+
We make available the Software to you on the basis of this Licence. We do not sell the Software to you. We remain the owners of the Software at all times.
|
|
6
|
+
|
|
7
|
+
We grant you a non-exclusive, worldwide, royalty-free, perpetual licence:
|
|
8
|
+
(a) to use the Software;
|
|
9
|
+
(b) to develop, modify and maintain the Software;
|
|
10
|
+
(c) copy, publish, distribute and transmit the Software;
|
|
11
|
+
(d) adapt the Software.
|
|
12
|
+
|
|
13
|
+
Where you do any of the above you must acknowledge the source of the Software in your product or application by including or linking the following attribution statement in a prominent and noticeable location in or in the context of your product or application:
|
|
14
|
+
“Outputs derived from caf.cvt (the Common Analytical Framework Climate Vulnerability Tool), developed by Transport for the North [https://github.com/Transport-for-the-North/caf.cvt]”
|
|
15
|
+
|
|
16
|
+
Any adaptations applied to the Software before application should be briefly described alongside the above citation. We encourage you to submit to us any adaptations to the Software and where you choose to do so your submissions will be considered for integration into the Software.
|
|
17
|
+
|
|
18
|
+
The above are important conditions of this Licence and if you fail to comply with them the rights granted to you under this Licence will end automatically.
|
|
19
|
+
This Licence does not grant you any right to use the Software in a way that suggests any official status or that we endorse you or your use of the Software.
|
|
20
|
+
The Software is licenced 'as is' and we exclude all representations, warranties, obligations and liabilities in relation to the Software to the maximum extent permitted by law.
|
|
21
|
+
We are not liable for any errors or omissions in the Software and shall not be liable for any loss, injury or damage of any kind caused by its use. We do not guarantee the continued supply of the Software.
|
|
22
|
+
This Licence is governed by the laws of the jurisdiction in which we have our principal place of business.
|
caf_cvt-0.1.1/PKG-INFO
ADDED
|
@@ -0,0 +1,242 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: caf.cvt
|
|
3
|
+
Version: 0.1.1
|
|
4
|
+
Summary: Climate Vulnerability Tool to assess the vulnerability of the transport network in the North to climate hazards.
|
|
5
|
+
Author: Transport for the North
|
|
6
|
+
License: Copyright © Transport for the North (“TfN”) (2026).
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
Use of this software and associated documentation files (“the Software”) by you indicates your acceptance of the terms and conditions below (“the Licence”).
|
|
10
|
+
We make available the Software to you on the basis of this Licence. We do not sell the Software to you. We remain the owners of the Software at all times.
|
|
11
|
+
|
|
12
|
+
We grant you a non-exclusive, worldwide, royalty-free, perpetual licence:
|
|
13
|
+
(a) to use the Software;
|
|
14
|
+
(b) to develop, modify and maintain the Software;
|
|
15
|
+
(c) copy, publish, distribute and transmit the Software;
|
|
16
|
+
(d) adapt the Software.
|
|
17
|
+
|
|
18
|
+
Where you do any of the above you must acknowledge the source of the Software in your product or application by including or linking the following attribution statement in a prominent and noticeable location in or in the context of your product or application:
|
|
19
|
+
“Outputs derived from caf.cvt (the Common Analytical Framework Climate Vulnerability Tool), developed by Transport for the North [https://github.com/Transport-for-the-North/caf.cvt]”
|
|
20
|
+
|
|
21
|
+
Any adaptations applied to the Software before application should be briefly described alongside the above citation. We encourage you to submit to us any adaptations to the Software and where you choose to do so your submissions will be considered for integration into the Software.
|
|
22
|
+
|
|
23
|
+
The above are important conditions of this Licence and if you fail to comply with them the rights granted to you under this Licence will end automatically.
|
|
24
|
+
This Licence does not grant you any right to use the Software in a way that suggests any official status or that we endorse you or your use of the Software.
|
|
25
|
+
The Software is licenced 'as is' and we exclude all representations, warranties, obligations and liabilities in relation to the Software to the maximum extent permitted by law.
|
|
26
|
+
We are not liable for any errors or omissions in the Software and shall not be liable for any loss, injury or damage of any kind caused by its use. We do not guarantee the continued supply of the Software.
|
|
27
|
+
This Licence is governed by the laws of the jurisdiction in which we have our principal place of business.
|
|
28
|
+
|
|
29
|
+
Project-URL: Bug Tracker, https://github.com/transport-for-the-north/caf.cvt.template/issues
|
|
30
|
+
Project-URL: Homepage, https://github.com/transport-for-the-north/caf.cvt.template
|
|
31
|
+
Project-URL: Source, https://github.com/transport-for-the-north/caf.cvt.template
|
|
32
|
+
Project-URL: Documentation, http://cafcvt.readthedocs.io/
|
|
33
|
+
Classifier: Programming Language :: Python :: 3 :: Only
|
|
34
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
35
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
36
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
37
|
+
Requires-Python: >=3.11
|
|
38
|
+
Description-Content-Type: text/markdown
|
|
39
|
+
License-File: LICENSE
|
|
40
|
+
Requires-Dist: caf.toolkit>=0.12.0
|
|
41
|
+
Requires-Dist: fiona>=1.10.1
|
|
42
|
+
Requires-Dist: geopandas>=1.1.1
|
|
43
|
+
Requires-Dist: h5py>=3.15.1
|
|
44
|
+
Requires-Dist: numpy>=2.3.3
|
|
45
|
+
Requires-Dist: pandas>=2.3.3
|
|
46
|
+
Requires-Dist: py7zr>=1.0.0
|
|
47
|
+
Requires-Dist: scikit-learn>=1.7.2
|
|
48
|
+
Requires-Dist: Shapely>=2.1.2
|
|
49
|
+
Requires-Dist: xarray>=2025.10.1
|
|
50
|
+
Provides-Extra: dev
|
|
51
|
+
Requires-Dist: ruff>=0.12; extra == "dev"
|
|
52
|
+
Requires-Dist: pylint>=3.3.1; extra == "dev"
|
|
53
|
+
Requires-Dist: mypy>=1.0.0; extra == "dev"
|
|
54
|
+
Requires-Dist: mypy_extensions>=1.0.0; extra == "dev"
|
|
55
|
+
Requires-Dist: pytest>=8.3; extra == "dev"
|
|
56
|
+
Requires-Dist: pytest-cov>=5.0; extra == "dev"
|
|
57
|
+
Requires-Dist: pytest-xdist>=3.6; extra == "dev"
|
|
58
|
+
Requires-Dist: versioningit>=3.1; extra == "dev"
|
|
59
|
+
Provides-Extra: docs
|
|
60
|
+
Requires-Dist: sphinx>=7.1.2; extra == "docs"
|
|
61
|
+
Requires-Dist: pydata-sphinx-theme>=0.14.1; extra == "docs"
|
|
62
|
+
Requires-Dist: graphviz>=0.20.1; extra == "docs"
|
|
63
|
+
Requires-Dist: sphinx-gallery>=0.17.1; extra == "docs"
|
|
64
|
+
Requires-Dist: matplotlib; extra == "docs"
|
|
65
|
+
Dynamic: license-file
|
|
66
|
+
|
|
67
|
+
<div align="center" style="background-color: white;">
|
|
68
|
+
<a href="https://www.transportforthenorth.com/">
|
|
69
|
+
<img src="https://www.transportforthenorth.com/wp-content/themes/tfn-theme/img/logo.svg"
|
|
70
|
+
alt="Transport for the North logo">
|
|
71
|
+
</a>
|
|
72
|
+
</div>
|
|
73
|
+
|
|
74
|
+
<h1 align="center">CAF.cvt</h1>
|
|
75
|
+
|
|
76
|
+
<p align="center">
|
|
77
|
+
<a href="https://transport-for-the-north.github.io/CAF-Handbook/python_tools/framework.html">
|
|
78
|
+
<img alt="CAF Status - Beta" src="https://img.shields.io/badge/CAF%20Status-Beta-yellow">
|
|
79
|
+
</a>
|
|
80
|
+
</p>
|
|
81
|
+
<p align="center">
|
|
82
|
+
<a href="https://pypi.org/project/caf.cvt/">
|
|
83
|
+
<img alt="Supported Python versions" src="https://img.shields.io/pypi/pyversions/caf.cvt.svg?style=flat-square">
|
|
84
|
+
</a>
|
|
85
|
+
<a href="https://pypi.org/project/caf.cvt/">
|
|
86
|
+
<img alt="Latest release" src="https://img.shields.io/github/release/transport-for-the-north/caf.cvt.svg?style=flat-square&maxAge=86400">
|
|
87
|
+
</a>
|
|
88
|
+
<a href="https://anaconda.org/conda-forge/caf.cvt">
|
|
89
|
+
<img alt="Conda" src="https://img.shields.io/conda/v/conda-forge/caf.cvt?style=flat-square&logo=condaforge">
|
|
90
|
+
</a>
|
|
91
|
+
</p>
|
|
92
|
+
<p align="center">
|
|
93
|
+
<a href="https://github.com/transport-for-the-north/caf.cvt.template/actions?query=event%3Apush">
|
|
94
|
+
<img alt="Testing Badge" src="https://img.shields.io/github/actions/workflow/status/transport-for-the-north/caf.cvt/tests.yml?style=flat-square&logo=GitHub&label=Tests">
|
|
95
|
+
</a>
|
|
96
|
+
<a href="https://app.codecov.io/gh/transport-for-the-north/caf.cvt">
|
|
97
|
+
<img alt="Coverage" src="https://img.shields.io/codecov/c/github/transport-for-the-north/caf.cvt.svg?branch=main&style=flat-square&logo=CodeCov">
|
|
98
|
+
</a>
|
|
99
|
+
<a href='https://cafcvt.readthedocs.io/en/stable/'>
|
|
100
|
+
<img alt='Documentation Status' src="https://img.shields.io/readthedocs/cafcvt?style=flat-square&logo=readthedocs">
|
|
101
|
+
</a>
|
|
102
|
+
</p>
|
|
103
|
+
|
|
104
|
+
|
|
105
|
+
CAF.cvt is a python model that takes climate and transport data and generates a climate risk assessment for the North's key transport infrastructure.
|
|
106
|
+
|
|
107
|
+
> [!TIP]
|
|
108
|
+
> For more detailed information including a user guide, tutorials and API reference see the full
|
|
109
|
+
> [caf.cvt documentation](https://cafcvt.readthedocs.io/en/stable/)
|
|
110
|
+
|
|
111
|
+
|
|
112
|
+
## Table of Contents
|
|
113
|
+
|
|
114
|
+
- [Table of Contents](#table-of-contents)
|
|
115
|
+
- [Overview](#overview)
|
|
116
|
+
- [What does it do?](#what-does-it-do)
|
|
117
|
+
- [Main Features](#main-features)
|
|
118
|
+
- [Work-in-Progress](#work-in-progress)
|
|
119
|
+
- [Who is it for?](#who-is-it-for)
|
|
120
|
+
- [Where to get it](#where-to-get-it)
|
|
121
|
+
- [Installation from GitHub](#installation-from-github)
|
|
122
|
+
- [Usage](#usage)
|
|
123
|
+
- [Command Line](#command-line)
|
|
124
|
+
- [Documentation](#documentation)
|
|
125
|
+
- [What is CAF?](#what-is-caf)
|
|
126
|
+
- [Contribution](#contribution)
|
|
127
|
+
- [Contact Us](#contact-us)
|
|
128
|
+
|
|
129
|
+
## Overview
|
|
130
|
+
|
|
131
|
+
### What does it do?
|
|
132
|
+
|
|
133
|
+
The Common Analytical Framework (CAF) Climate Vulnerability Tool (CVT) is a geospatial python package that translates complex climate and infrastructure data into a set of climate risk assessments for the North of England's key transport networks.
|
|
134
|
+
|
|
135
|
+
### Main Features
|
|
136
|
+
|
|
137
|
+
- **Data Cleaning** - Reads and cleans a wide variety of climate and transport datasets, preprocessing into a standard format in preparation for analysis.
|
|
138
|
+
|
|
139
|
+
- **Apply Functional Rules** - Applies a set of funtional rules and spatial overlays to the climate data to translate complex values into distinct hazard categories and grids.
|
|
140
|
+
|
|
141
|
+
- **Infrastructure Layering** - Layers infrastructure on top of hazard grids to assign risk to the transport assets.
|
|
142
|
+
|
|
143
|
+
#### Work-in-Progress
|
|
144
|
+
|
|
145
|
+
There are currently no work-in-progress features.
|
|
146
|
+
|
|
147
|
+
> [!WARNING]
|
|
148
|
+
> These features are work-in-progress and are not available in a released version of caf.cvt, to
|
|
149
|
+
> access these features a specific branch of caf.cvt should be installed, see [Installation from GitHub](#installation-from-github).
|
|
150
|
+
|
|
151
|
+
### Who is it for?
|
|
152
|
+
|
|
153
|
+
- **Target audience:** Transport Analysts, Transport Planners, Climate Researchers
|
|
154
|
+
- **CAF Analytical Stage:** Modelling
|
|
155
|
+
|
|
156
|
+

|
|
157
|
+
|
|
158
|
+
For more details on CAF Analytical Stages see the [description within TfN's GitHub homepage](https://github.com/Transport-for-the-North)
|
|
159
|
+
|
|
160
|
+
## Where to get it
|
|
161
|
+
|
|
162
|
+
> [!IMPORTANT]
|
|
163
|
+
> caf.cvt has not been published yet so cannot be installed from
|
|
164
|
+
> conda-forge or PyPI, see [Installation from GitHub](#installation-from-github).
|
|
165
|
+
|
|
166
|
+
The latest released version are available at the [Python
|
|
167
|
+
Package Index (PyPI)](https://pypi.org/project/caf.cvt) and on [Conda](https://anaconda.org/conda-forge/caf.cvt).
|
|
168
|
+
|
|
169
|
+
```sh
|
|
170
|
+
conda install -c conda-forge caf.cvt
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
```sh
|
|
174
|
+
pip install caf.cvt
|
|
175
|
+
```
|
|
176
|
+
|
|
177
|
+
> [!TIP]
|
|
178
|
+
>
|
|
179
|
+
> - See the [Quick Start Guide](https://cafcvt.readthedocs.io/en/stable/start.html#quick-start) for more detailed instructions.
|
|
180
|
+
> - See the [requirements.txt](requirements.txt) for the full list of package dependencies.
|
|
181
|
+
|
|
182
|
+
### Installation from GitHub
|
|
183
|
+
|
|
184
|
+
> [!WARNING]
|
|
185
|
+
> Unreleased GitHub versions should **not** be considered stable.
|
|
186
|
+
|
|
187
|
+
The latest, unreleased, version can be installed directly from GitHub using:
|
|
188
|
+
|
|
189
|
+
```sh
|
|
190
|
+
pip install "git+https://github.com/transport-for-the-north/caf.cvt"
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
> [!TIP]
|
|
194
|
+
> `pip install` can install a specific tag, or branch, using `@{tag-name}`
|
|
195
|
+
> after the git URL.
|
|
196
|
+
|
|
197
|
+
## Usage
|
|
198
|
+
|
|
199
|
+
CAF.cvt provides and Command-line (CLI) and graphical interface (GUI) to use many of it's
|
|
200
|
+
features without the need to write any Python code, see the [Tool Usage section](https://cafcvt.readthedocs.io/en/stable/usage/index.html)
|
|
201
|
+
of the user guide for more details.
|
|
202
|
+
|
|
203
|
+
### Command Line
|
|
204
|
+
|
|
205
|
+
The tool can be run from command line, with the command:
|
|
206
|
+
|
|
207
|
+
```sh
|
|
208
|
+
caf.cvt
|
|
209
|
+
```
|
|
210
|
+
|
|
211
|
+
See [Command-Line Interface (User Guide)](https://cafcvt.readthedocs.io/en/stable/usage/cli.html)
|
|
212
|
+
for full explanations of the parameters.
|
|
213
|
+
|
|
214
|
+
## Documentation
|
|
215
|
+
|
|
216
|
+
The code documentation is hosted at <https://cafcvt.readthedocs.io/en/stable/>.
|
|
217
|
+
|
|
218
|
+
|
|
219
|
+
## What is CAF?
|
|
220
|
+
|
|
221
|
+
This tool is part of TfN's [Common Analytical Framework (CAF)](https://github.com/Transport-for-the-North).
|
|
222
|
+
CAF is Transport for the North's structured suite of analytical tools designed to support transport
|
|
223
|
+
modelling, appraisal, and strategic decision-making.
|
|
224
|
+
|
|
225
|
+
More information on CAF and details on other CAF tools can be found on [TfN's GitHub Homepage](https://github.com/Transport-for-the-North).
|
|
226
|
+
|
|
227
|
+
## Contribution
|
|
228
|
+
|
|
229
|
+
We encourage use of, and contributions to, the repositories within this organisation, licenses are provided within
|
|
230
|
+
the repositories and the [organisation contribution guide](https://github.com/Transport-for-the-North/.github/blob/main/CONTRIBUTING.rst)
|
|
231
|
+
provides details for contributions.
|
|
232
|
+
|
|
233
|
+
---
|
|
234
|
+
|
|
235
|
+
## Contact Us
|
|
236
|
+
|
|
237
|
+
For further information about using this tool or CAF tools in your projects and work contact Transport for the North - <TfNOffer@transportforthenorth.com>
|
|
238
|
+
|
|
239
|
+
---
|
|
240
|
+
|
|
241
|
+
|
|
242
|
+
[Go to Top](#table-of-contents)
|
caf_cvt-0.1.1/README.md
ADDED
|
@@ -0,0 +1,176 @@
|
|
|
1
|
+
<div align="center" style="background-color: white;">
|
|
2
|
+
<a href="https://www.transportforthenorth.com/">
|
|
3
|
+
<img src="https://www.transportforthenorth.com/wp-content/themes/tfn-theme/img/logo.svg"
|
|
4
|
+
alt="Transport for the North logo">
|
|
5
|
+
</a>
|
|
6
|
+
</div>
|
|
7
|
+
|
|
8
|
+
<h1 align="center">CAF.cvt</h1>
|
|
9
|
+
|
|
10
|
+
<p align="center">
|
|
11
|
+
<a href="https://transport-for-the-north.github.io/CAF-Handbook/python_tools/framework.html">
|
|
12
|
+
<img alt="CAF Status - Beta" src="https://img.shields.io/badge/CAF%20Status-Beta-yellow">
|
|
13
|
+
</a>
|
|
14
|
+
</p>
|
|
15
|
+
<p align="center">
|
|
16
|
+
<a href="https://pypi.org/project/caf.cvt/">
|
|
17
|
+
<img alt="Supported Python versions" src="https://img.shields.io/pypi/pyversions/caf.cvt.svg?style=flat-square">
|
|
18
|
+
</a>
|
|
19
|
+
<a href="https://pypi.org/project/caf.cvt/">
|
|
20
|
+
<img alt="Latest release" src="https://img.shields.io/github/release/transport-for-the-north/caf.cvt.svg?style=flat-square&maxAge=86400">
|
|
21
|
+
</a>
|
|
22
|
+
<a href="https://anaconda.org/conda-forge/caf.cvt">
|
|
23
|
+
<img alt="Conda" src="https://img.shields.io/conda/v/conda-forge/caf.cvt?style=flat-square&logo=condaforge">
|
|
24
|
+
</a>
|
|
25
|
+
</p>
|
|
26
|
+
<p align="center">
|
|
27
|
+
<a href="https://github.com/transport-for-the-north/caf.cvt.template/actions?query=event%3Apush">
|
|
28
|
+
<img alt="Testing Badge" src="https://img.shields.io/github/actions/workflow/status/transport-for-the-north/caf.cvt/tests.yml?style=flat-square&logo=GitHub&label=Tests">
|
|
29
|
+
</a>
|
|
30
|
+
<a href="https://app.codecov.io/gh/transport-for-the-north/caf.cvt">
|
|
31
|
+
<img alt="Coverage" src="https://img.shields.io/codecov/c/github/transport-for-the-north/caf.cvt.svg?branch=main&style=flat-square&logo=CodeCov">
|
|
32
|
+
</a>
|
|
33
|
+
<a href='https://cafcvt.readthedocs.io/en/stable/'>
|
|
34
|
+
<img alt='Documentation Status' src="https://img.shields.io/readthedocs/cafcvt?style=flat-square&logo=readthedocs">
|
|
35
|
+
</a>
|
|
36
|
+
</p>
|
|
37
|
+
|
|
38
|
+
|
|
39
|
+
CAF.cvt is a python model that takes climate and transport data and generates a climate risk assessment for the North's key transport infrastructure.
|
|
40
|
+
|
|
41
|
+
> [!TIP]
|
|
42
|
+
> For more detailed information including a user guide, tutorials and API reference see the full
|
|
43
|
+
> [caf.cvt documentation](https://cafcvt.readthedocs.io/en/stable/)
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
## Table of Contents
|
|
47
|
+
|
|
48
|
+
- [Table of Contents](#table-of-contents)
|
|
49
|
+
- [Overview](#overview)
|
|
50
|
+
- [What does it do?](#what-does-it-do)
|
|
51
|
+
- [Main Features](#main-features)
|
|
52
|
+
- [Work-in-Progress](#work-in-progress)
|
|
53
|
+
- [Who is it for?](#who-is-it-for)
|
|
54
|
+
- [Where to get it](#where-to-get-it)
|
|
55
|
+
- [Installation from GitHub](#installation-from-github)
|
|
56
|
+
- [Usage](#usage)
|
|
57
|
+
- [Command Line](#command-line)
|
|
58
|
+
- [Documentation](#documentation)
|
|
59
|
+
- [What is CAF?](#what-is-caf)
|
|
60
|
+
- [Contribution](#contribution)
|
|
61
|
+
- [Contact Us](#contact-us)
|
|
62
|
+
|
|
63
|
+
## Overview
|
|
64
|
+
|
|
65
|
+
### What does it do?
|
|
66
|
+
|
|
67
|
+
The Common Analytical Framework (CAF) Climate Vulnerability Tool (CVT) is a geospatial python package that translates complex climate and infrastructure data into a set of climate risk assessments for the North of England's key transport networks.
|
|
68
|
+
|
|
69
|
+
### Main Features
|
|
70
|
+
|
|
71
|
+
- **Data Cleaning** - Reads and cleans a wide variety of climate and transport datasets, preprocessing into a standard format in preparation for analysis.
|
|
72
|
+
|
|
73
|
+
- **Apply Functional Rules** - Applies a set of funtional rules and spatial overlays to the climate data to translate complex values into distinct hazard categories and grids.
|
|
74
|
+
|
|
75
|
+
- **Infrastructure Layering** - Layers infrastructure on top of hazard grids to assign risk to the transport assets.
|
|
76
|
+
|
|
77
|
+
#### Work-in-Progress
|
|
78
|
+
|
|
79
|
+
There are currently no work-in-progress features.
|
|
80
|
+
|
|
81
|
+
> [!WARNING]
|
|
82
|
+
> These features are work-in-progress and are not available in a released version of caf.cvt, to
|
|
83
|
+
> access these features a specific branch of caf.cvt should be installed, see [Installation from GitHub](#installation-from-github).
|
|
84
|
+
|
|
85
|
+
### Who is it for?
|
|
86
|
+
|
|
87
|
+
- **Target audience:** Transport Analysts, Transport Planners, Climate Researchers
|
|
88
|
+
- **CAF Analytical Stage:** Modelling
|
|
89
|
+
|
|
90
|
+

|
|
91
|
+
|
|
92
|
+
For more details on CAF Analytical Stages see the [description within TfN's GitHub homepage](https://github.com/Transport-for-the-North)
|
|
93
|
+
|
|
94
|
+
## Where to get it
|
|
95
|
+
|
|
96
|
+
> [!IMPORTANT]
|
|
97
|
+
> caf.cvt has not been published yet so cannot be installed from
|
|
98
|
+
> conda-forge or PyPI, see [Installation from GitHub](#installation-from-github).
|
|
99
|
+
|
|
100
|
+
The latest released version are available at the [Python
|
|
101
|
+
Package Index (PyPI)](https://pypi.org/project/caf.cvt) and on [Conda](https://anaconda.org/conda-forge/caf.cvt).
|
|
102
|
+
|
|
103
|
+
```sh
|
|
104
|
+
conda install -c conda-forge caf.cvt
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
```sh
|
|
108
|
+
pip install caf.cvt
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
> [!TIP]
|
|
112
|
+
>
|
|
113
|
+
> - See the [Quick Start Guide](https://cafcvt.readthedocs.io/en/stable/start.html#quick-start) for more detailed instructions.
|
|
114
|
+
> - See the [requirements.txt](requirements.txt) for the full list of package dependencies.
|
|
115
|
+
|
|
116
|
+
### Installation from GitHub
|
|
117
|
+
|
|
118
|
+
> [!WARNING]
|
|
119
|
+
> Unreleased GitHub versions should **not** be considered stable.
|
|
120
|
+
|
|
121
|
+
The latest, unreleased, version can be installed directly from GitHub using:
|
|
122
|
+
|
|
123
|
+
```sh
|
|
124
|
+
pip install "git+https://github.com/transport-for-the-north/caf.cvt"
|
|
125
|
+
```
|
|
126
|
+
|
|
127
|
+
> [!TIP]
|
|
128
|
+
> `pip install` can install a specific tag, or branch, using `@{tag-name}`
|
|
129
|
+
> after the git URL.
|
|
130
|
+
|
|
131
|
+
## Usage
|
|
132
|
+
|
|
133
|
+
CAF.cvt provides and Command-line (CLI) and graphical interface (GUI) to use many of it's
|
|
134
|
+
features without the need to write any Python code, see the [Tool Usage section](https://cafcvt.readthedocs.io/en/stable/usage/index.html)
|
|
135
|
+
of the user guide for more details.
|
|
136
|
+
|
|
137
|
+
### Command Line
|
|
138
|
+
|
|
139
|
+
The tool can be run from command line, with the command:
|
|
140
|
+
|
|
141
|
+
```sh
|
|
142
|
+
caf.cvt
|
|
143
|
+
```
|
|
144
|
+
|
|
145
|
+
See [Command-Line Interface (User Guide)](https://cafcvt.readthedocs.io/en/stable/usage/cli.html)
|
|
146
|
+
for full explanations of the parameters.
|
|
147
|
+
|
|
148
|
+
## Documentation
|
|
149
|
+
|
|
150
|
+
The code documentation is hosted at <https://cafcvt.readthedocs.io/en/stable/>.
|
|
151
|
+
|
|
152
|
+
|
|
153
|
+
## What is CAF?
|
|
154
|
+
|
|
155
|
+
This tool is part of TfN's [Common Analytical Framework (CAF)](https://github.com/Transport-for-the-North).
|
|
156
|
+
CAF is Transport for the North's structured suite of analytical tools designed to support transport
|
|
157
|
+
modelling, appraisal, and strategic decision-making.
|
|
158
|
+
|
|
159
|
+
More information on CAF and details on other CAF tools can be found on [TfN's GitHub Homepage](https://github.com/Transport-for-the-North).
|
|
160
|
+
|
|
161
|
+
## Contribution
|
|
162
|
+
|
|
163
|
+
We encourage use of, and contributions to, the repositories within this organisation, licenses are provided within
|
|
164
|
+
the repositories and the [organisation contribution guide](https://github.com/Transport-for-the-North/.github/blob/main/CONTRIBUTING.rst)
|
|
165
|
+
provides details for contributions.
|
|
166
|
+
|
|
167
|
+
---
|
|
168
|
+
|
|
169
|
+
## Contact Us
|
|
170
|
+
|
|
171
|
+
For further information about using this tool or CAF tools in your projects and work contact Transport for the North - <TfNOffer@transportforthenorth.com>
|
|
172
|
+
|
|
173
|
+
---
|
|
174
|
+
|
|
175
|
+
|
|
176
|
+
[Go to Top](#table-of-contents)
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=64.0.0", "versioningit"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "caf.cvt"
|
|
7
|
+
dynamic = ["version", "dependencies", "optional-dependencies"]
|
|
8
|
+
description = "Climate Vulnerability Tool to assess the vulnerability of the transport network in the North to climate hazards."
|
|
9
|
+
readme = "README.md"
|
|
10
|
+
license = { "file" = "LICENSE" }
|
|
11
|
+
requires-python = ">=3.11"
|
|
12
|
+
authors = [{ name = "Transport for the North" }]
|
|
13
|
+
classifiers = [
|
|
14
|
+
"Programming Language :: Python :: 3 :: Only",
|
|
15
|
+
"Programming Language :: Python :: 3.11",
|
|
16
|
+
"Programming Language :: Python :: 3.12",
|
|
17
|
+
"Programming Language :: Python :: 3.13",
|
|
18
|
+
]
|
|
19
|
+
|
|
20
|
+
[project.urls]
|
|
21
|
+
"Bug Tracker" = "https://github.com/transport-for-the-north/caf.cvt.template/issues"
|
|
22
|
+
Homepage = "https://github.com/transport-for-the-north/caf.cvt.template"
|
|
23
|
+
Source = "https://github.com/transport-for-the-north/caf.cvt.template"
|
|
24
|
+
Documentation = "http://cafcvt.readthedocs.io/"
|
|
25
|
+
[project.scripts]
|
|
26
|
+
"caf.cvt" = "caf.cvt.__main__:_main"
|
|
27
|
+
[tool.setuptools.dynamic]
|
|
28
|
+
dependencies = { "file" = "requirements.txt" }
|
|
29
|
+
|
|
30
|
+
[tool.setuptools.dynamic.optional-dependencies]
|
|
31
|
+
dev = { "file" = "requirements_dev.txt" }
|
|
32
|
+
docs = { "file" = "docs/requirements.txt" }
|
|
33
|
+
|
|
34
|
+
# Dynamic versioning for editable installs
|
|
35
|
+
[tool.setuptools.cmdclass]
|
|
36
|
+
build_py = "versioningit.cmdclass.build_py"
|
|
37
|
+
sdist = "versioningit.cmdclass.sdist"
|
|
38
|
+
|
|
39
|
+
# Packaging options
|
|
40
|
+
[tool.setuptools.packages.find]
|
|
41
|
+
where = ["src"]
|
|
42
|
+
|
|
43
|
+
[tool.setuptools.package-data]
|
|
44
|
+
"caf.cvt" = ["py.typed"]
|
|
45
|
+
|
|
46
|
+
# Linters
|
|
47
|
+
[tool.ruff]
|
|
48
|
+
line-length = 95
|
|
49
|
+
target-version = "py311"
|
|
50
|
+
extend-exclude = ["conf.py", "_version.py"]
|
|
51
|
+
|
|
52
|
+
[tool.ruff.lint]
|
|
53
|
+
select = [
|
|
54
|
+
"A", # flake8-builtins
|
|
55
|
+
"E", # pycodestyle
|
|
56
|
+
"W", # pycodestyle warnings
|
|
57
|
+
"F", # Pyflakes
|
|
58
|
+
"UP", # pyupgrade
|
|
59
|
+
"B", # flake8-bugbear
|
|
60
|
+
"SIM", # flake8-simplify
|
|
61
|
+
"I", # isort
|
|
62
|
+
"LOG", # flake8-logging
|
|
63
|
+
"G", # flake8-logging-format
|
|
64
|
+
"N", # pep8-naming
|
|
65
|
+
"D", # pydocstyle
|
|
66
|
+
"DOC", # pydoclint
|
|
67
|
+
"PL", # pylint
|
|
68
|
+
"BLE", # flake8-blind-except
|
|
69
|
+
"ERA", # eradicate (commented out code)
|
|
70
|
+
"TD", # flake8-todos
|
|
71
|
+
"RET", # flake8-return
|
|
72
|
+
"PTH", # flake8-use-pathlib
|
|
73
|
+
"ANN", # flake8-annotations
|
|
74
|
+
"S", # flake8-bandit (security issues)
|
|
75
|
+
"ICN", # flake8-import-conventions
|
|
76
|
+
"ARG", # flake8-unused-arguments
|
|
77
|
+
"PIE", # flake8-pie
|
|
78
|
+
"FURB", # refurb
|
|
79
|
+
"RUF", # Ruff-specific rules
|
|
80
|
+
"TRY", # tryceratops checks
|
|
81
|
+
"C90", # mccabe (complex code)
|
|
82
|
+
"PD", # pandas-vet (pandas best practices)
|
|
83
|
+
"TC", # flake8-type-checking
|
|
84
|
+
"T20", # flake8-print (disallow print statements)
|
|
85
|
+
"PGH", # pygrep-hooks (noqa and type disable comments)
|
|
86
|
+
]
|
|
87
|
+
ignore = [
|
|
88
|
+
# These clash with the ruff formatter
|
|
89
|
+
"W191", # tab-indentation
|
|
90
|
+
"E111", # indentation-with-invalid-multiple
|
|
91
|
+
"E114", # indentation-with-invalid-multiple-comment
|
|
92
|
+
"E117", # over-indented
|
|
93
|
+
"D206", # docstring-tab-indentation
|
|
94
|
+
"D300", # triple-single-quotes
|
|
95
|
+
|
|
96
|
+
"UP015", # redundant-open-modes (pyupgrade)
|
|
97
|
+
"TRY003", # long messages in exceptions (tryceratops)
|
|
98
|
+
"SIM108", # one line if else (flake8-bandit)
|
|
99
|
+
"S311", # random.random not allowed (flake8-bandit)
|
|
100
|
+
"DOC502", # docstring-extraneous-exception (sometimes necessary)
|
|
101
|
+
"ANN003", # type annotation for **kwargs
|
|
102
|
+
]
|
|
103
|
+
unfixable = [
|
|
104
|
+
"T20", # print-statements (flake8-print)
|
|
105
|
+
"B905", # zip without strict, fix defaults to False
|
|
106
|
+
]
|
|
107
|
+
|
|
108
|
+
[tool.ruff.lint.extend-per-file-ignores]
|
|
109
|
+
"__init__.py" = ["F401"] # allow unused imports
|
|
110
|
+
"tests/*" = [
|
|
111
|
+
"S101", # use of assert in tests
|
|
112
|
+
"DOC", # docstring issues
|
|
113
|
+
]
|
|
114
|
+
"examples/*" = [
|
|
115
|
+
"T20", # allow print statements
|
|
116
|
+
"D205", # allow one-liner docstrings
|
|
117
|
+
"D400", # allow missing first line in docstrings
|
|
118
|
+
]
|
|
119
|
+
|
|
120
|
+
[tool.ruff.lint.pydocstyle]
|
|
121
|
+
convention = "numpy"
|
|
122
|
+
|
|
123
|
+
[tool.ruff.lint.pep8-naming]
|
|
124
|
+
ignore-names = ["df", "fn", "ca", "tp", "x", "i"]
|
|
125
|
+
|
|
126
|
+
[tool.ruff.lint.flake8-import-conventions.extend-aliases]
|
|
127
|
+
# Recommended aliases for caf packages
|
|
128
|
+
"caf.toolkit" = "ctk"
|
|
129
|
+
"caf.base" = "cbase"
|
|
130
|
+
"caf.mat" = "cmat"
|
|
131
|
+
"caf.space" = "cspace"
|
|
132
|
+
"caf.distribute" = "cdist"
|
|
133
|
+
"caf.viz" = "cviz"
|
|
134
|
+
|
|
135
|
+
[tool.ruff.lint.pylint]
|
|
136
|
+
max-args = 10
|
|
137
|
+
max-statements = 100
|
|
138
|
+
|
|
139
|
+
[tool.ruff.format]
|
|
140
|
+
docstring-code-format = true
|
|
141
|
+
|
|
142
|
+
# Only necessary until pylint is fully covered by ruff
|
|
143
|
+
[tool.pylint.design]
|
|
144
|
+
max-args = 10
|
|
145
|
+
max-attributes = 15
|
|
146
|
+
max-statements = 100
|
|
147
|
+
|
|
148
|
+
[tool.pylint.messages_control]
|
|
149
|
+
disable = [
|
|
150
|
+
"line-too-long", # Handled by ruff
|
|
151
|
+
"too-many-lines",
|
|
152
|
+
"use-dict-literal",
|
|
153
|
+
"use-list-literal",
|
|
154
|
+
"wrong-import-position", # Compatibility with ruff
|
|
155
|
+
"wrong-import-order", # Handled by ruff
|
|
156
|
+
"ungrouped-imports", # Handled by ruff
|
|
157
|
+
]
|
|
158
|
+
|
|
159
|
+
[tool.pylint.basic]
|
|
160
|
+
extension-pkg-allow-list = []
|
|
161
|
+
|
|
162
|
+
[tool.pylint.main]
|
|
163
|
+
ignore = ["__init__.py", "_version.py"]
|
|
164
|
+
|
|
165
|
+
[tool.mypy]
|
|
166
|
+
packages = ["caf.cvt"]
|
|
167
|
+
namespace_packages = true
|
|
168
|
+
ignore_missing_imports = true
|
|
169
|
+
allow_redefinition = true
|
|
170
|
+
|
|
171
|
+
# Tests
|
|
172
|
+
[tool.pytest.ini_options]
|
|
173
|
+
pythonpath = ["src"]
|
|
174
|
+
addopts = """\
|
|
175
|
+
--cov=caf --cov-report=xml -n auto \
|
|
176
|
+
--doctest-modules --ignore=examples \
|
|
177
|
+
--junitxml=junit.xml -o junit_family=legacy\
|
|
178
|
+
"""
|
|
179
|
+
|
|
180
|
+
[tool.coverage.report]
|
|
181
|
+
include_namespace_packages = true
|
|
182
|
+
|
|
183
|
+
# Versioning
|
|
184
|
+
[tool.versioningit.vcs]
|
|
185
|
+
method = "git"
|
|
186
|
+
match = ["v*"]
|
|
187
|
+
default-tag = "0.0.1"
|
|
188
|
+
|
|
189
|
+
[tool.versioningit.onbuild]
|
|
190
|
+
source-file = "src/caf/cvt/_version.py"
|
|
191
|
+
build-file = "caf/cvt/_version.py"
|
|
192
|
+
|
|
193
|
+
[tool.versioningit.format]
|
|
194
|
+
distance = "{base_version}+{distance}.{vcs}{rev}"
|
|
195
|
+
dirty = "{base_version}+{distance}.{vcs}{rev}.dirty"
|
|
196
|
+
distance-dirty = "{base_version}+{distance}.{vcs}{rev}.dirty"
|
caf_cvt-0.1.1/setup.cfg
ADDED