Skip to content

Commit a8845e1

Browse files
Fix: Issues flagged by markdownlint
Signed-off-by: Matthew Watkins <[email protected]>
1 parent 7da5c7d commit a8845e1

File tree

8 files changed

+93
-47
lines changed

8 files changed

+93
-47
lines changed

.pre-commit-config.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ repos:
7676
rev: acc9d9de6369b76d22cb4167029d2035e8730b98 # frozen: v0.19.1
7777
hooks:
7878
- id: gitlint
79-
# args: ["-c body-max-line-length=120", "-c title-max-length=120"]
79+
args: ["-c body-max-line-length=120", "-c title-max-length=120"]
8080

8181
- repo: https://github.com/openstack/bashate
8282
rev: 5798d24d571676fc407e81df574c1ef57b520f23 # frozen: 2.1.1
@@ -103,7 +103,7 @@ repos:
103103
args:
104104
[
105105
"-d",
106-
"{rules: {line-length: {max: 100}}, ignore-from-file: [.gitignore],}",
106+
"{rules: {line-length: {max: 120}}, ignore-from-file: [.gitignore],}",
107107
]
108108

109109
- repo: https://github.com/astral-sh/ruff-pre-commit

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
4040

4141
## [0.1.2] - 2022-04-01
4242

43-
### Fixes
43+
### Bug Fixes
4444

4545
- Add missing __init__.py file in src/physrisk/data_objects
4646

CONTRIBUTING.md

Lines changed: 34 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -4,32 +4,34 @@
44

55
To get set up, clone and enter the repo.
66

7-
```
7+
```bash
88
git clone [email protected]:os-climate/physrisk.git
99
cd physrisk
1010
```
1111

1212
We recommend using [pdm](https://pdm-project.org/latest/) for a
1313
consistent working environment. Install via, e.g.:
1414

15-
```
15+
```bash
1616
pip install pdm
1717
```
1818

1919
For ease of using Jupyter notebooks (e.g. in VS Code) the config can be used:
2020

21-
```
21+
```bash
2222
pdm config venv.with_pip True
2323
```
2424

2525
The command:
2626

27-
```
27+
```bash
2828
pdm install
2929
```
3030

31-
will create a virtual environment (typically .venv folder in the project folder) and install the dependencies.
32-
We recommend that the IDE workspace uses this virtual environment when developing.
31+
will create a virtual environment (typically .venv folder in the project
32+
folder) and install the dependencies.
33+
We recommend that the IDE workspace uses this virtual environment when
34+
developing.
3335

3436
When adding a package for use in new or improved functionality,
3537
`pdm add <package-name>`. Or, when adding something helpful for
@@ -48,21 +50,22 @@ checks.
4850
and enabling automatic formatting via [pre-commit](https://pre-commit.com/)
4951
is recommended:
5052

51-
```
53+
```bash
5254
pre-commit install
5355
```
5456

5557
or
5658

57-
```
59+
```bash
5860
pre-commit run --all-files
5961
```
6062

61-
To ensure compliance with static check tools, developers may wish to run black and isort against modified files.
63+
To ensure compliance with static check tools, developers may wish to run
64+
black and isort against modified files.
6265

6366
E.g.,
6467

65-
```
68+
```bash
6669
# auto-sort imports
6770
isort .
6871
# auto-format code
@@ -71,7 +74,7 @@ black .
7174

7275
Code can then be tested using tox.
7376

74-
```
77+
```bash
7578
# run static checks and unit tests
7679
tox
7780
# run only tests
@@ -84,17 +87,19 @@ tox -e cov
8487

8588
## IDE set-up
8689

87-
For those using VS Code, configure tests ('Python: Configure Tests') to use 'pytest'
88-
to allow running of tests within the IDE.
90+
For those using VS Code, configure tests ('Python: Configure Tests') to
91+
use 'pytest' to allow running of tests within the IDE.
8992

9093
## Releasing
9194

92-
Actions are configured to release to PyPI on pushing a tag. In order to do this:
95+
Actions are configured to release to PyPI on pushing a tag. In order to
96+
do this:
9397

94-
- Ensure version in pyproject.toml is updated (will require pull request like any other change)
98+
- Ensure version in pyproject.toml is updated (will require pull request
99+
like any other change)
95100
- Create new annotated tag and push
96101

97-
```
102+
```bash
98103
git tag -a v1.0.0 -m "v1.0.0"
99104
git push --follow-tags
100105
```
@@ -106,21 +111,26 @@ This is a useful clarification of the forking workflow:
106111

107112
## Project Organization
108113

109-
------------
114+
---
110115

111-
├── LICENSE
112-
├── pdm.lock <- pdm.lock stating a pinned down software stack as used by pdm.
116+
```text
117+
├── LICENSE
118+
├── pdm.lock <- pdm.lock stating a pinned down software stack
119+
│ as used by pdm.
113120
├── README.md <- The top-level README for developers using this project.
114121
115122
├── methodology <- Contains LaTeX methodology document.
116123
│ └── literature <- Literature review.
117124
118-
├── docs <- A default Sphinx project; see sphinx-doc.org for details.
125+
├── docs <- A default Sphinx project; see sphinx-doc.org
126+
│ for details.
119127
120-
├── notebooks <- Jupyter notebooks. These comprise notebooks used for on-boarding
121-
│ hazard data, on-boarding vulnerability models and tutorial.
128+
├── notebooks <- Jupyter notebooks. These comprise notebooks used
129+
│ for on-boarding hazard data, on-boarding
130+
│ vulnerability models and tutorial.
122131
123-
├── setup.py <- makes project pip installable (pip install -e .) so src can be imported.
132+
├── setup.py <- makes project pip installable (pip install -e .)
133+
│ so src can be imported.
124134
125135
├── src <- Source code for use in this project.
126136
│   └── physrisk <- physrisk source code.
@@ -131,4 +141,4 @@ This is a useful clarification of the forking workflow:
131141
132142
└── tox.ini <- tox file with settings for running tox; see tox.readthedocs.io.
133143
134-
--------
144+
---

README.md

Lines changed: 44 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -11,50 +11,78 @@
1111

1212
Physical climate risk calculation engine.
1313

14-
<img src="docs/images/OS-Climate-Logo.png" alt="drawing" width="150"/>
14+
![OS-Climate Logo](docs/images/OS-Climate-Logo.png)
1515

1616
## About physrisk
1717

18-
An [OS-Climate](https://os-climate.org) project, physrisk is a library for assessing the physical effects of climate change and thereby the potential benefit of measures to improve resilience.
18+
An [OS-Climate](https://os-climate.org) project, physrisk is a library for
19+
assessing the physical effects of climate change and thereby the potential
20+
benefit of measures to improve resilience.
1921

20-
An introduction and methodology is available [here](https://github.com/os-climate/physrisk/blob/main/methodology/PhysicalRiskMethodology.pdf).
22+
An introduction and methodology is available in the
23+
[Physical Risk Methodology document](https://github.com/os-climate/physrisk/blob/main/methodology/PhysicalRiskMethodology.pdf).
2124

22-
Physrisk is primarily designed to run 'bottom-up' calculations that model the impact of climate hazards on large numbers of individual assets (including natural) and operations. These calculations can be used to assess financial risks or socio-economic impacts. To do this physrisk collects:
25+
Physrisk is primarily designed to run 'bottom-up' calculations that model
26+
the impact of climate hazards on large numbers of individual assets
27+
(including natural) and operations. These calculations can be used to assess
28+
financial risks or socio-economic impacts. To do this physrisk collects:
2329

2430
- hazard indicators and
2531
- models of vulnerability of assets/operations to hazards.
2632

27-
Hazard indicators are on-boarded from public resources or inferred from climate projections, e.g. from CMIP or CORDEX data sets. Indicators are created from code in the
28-
[hazard repo](https://github.com/os-climate/hazard) to make calculations as transparent as possible.
33+
Hazard indicators are on-boarded from public resources or inferred from
34+
climate projections, e.g. from CMIP or CORDEX data sets. Indicators are
35+
created from code in the
36+
[hazard repository](https://github.com/os-climate/hazard) to make
37+
calculations as transparent as possible.
2938

30-
Physrisk is also designed to be a hosted, e.g. to provide on-demand calculations. [physrisk-api](https://github.com/os-climate/physrisk-api) and [physrisk-ui](https://github.com/os-climate/physrisk-ui) provide an example API and user interface. A [development version of the UI](https://physrisk-ui-physrisk.apps.odh-cl2.apps.os-climate.org) is hosted by OS-Climate.
39+
Physrisk is also designed to be a hosted, e.g. to provide on-demand
40+
calculations.
41+
[physrisk-api](https://github.com/os-climate/physrisk-api) and
42+
[physrisk-ui](https://github.com/os-climate/physrisk-ui) provide an example
43+
API and user interface. A
44+
[development version of the UI](https://physrisk-ui-physrisk.apps.odh-cl2.apps.os-climate.org)
45+
is hosted by OS-Climate.
3146

3247
## Using the library
3348

34-
The library can be run locally, although access to the hazard indicator data is needed. The library is installed via:
49+
The library can be run locally, although access to the hazard indicator data
50+
is needed. The library is installed via:
3551

36-
```
52+
```bash
3753
pip install physrisk-lib
3854
```
3955

40-
Hazard indicator data is freely available. Members of the project are able to access OS-Climate S3 buckets. Credentials are available [here](https://console-openshift-console.apps.odh-cl2.apps.os-climate.org/k8s/ns/physrisk/secrets/physrisk-s3-keys). Information about the project is available via the [community-hub](https://github.com/os-climate/OS-Climate-Community-Hub). Non-members are able to download or copy hazard indicator data.
56+
Hazard indicator data is freely available. Members of the project are able to
57+
access OS-Climate S3 buckets. Credentials are available from the
58+
[OS-Climate S3 keys](https://console-openshift-console.apps.odh-cl2.apps.os-climate.org/k8s/ns/physrisk/secrets/physrisk-s3-keys).
59+
Information about the project is available via the
60+
[community-hub](https://github.com/os-climate/OS-Climate-Community-Hub).
61+
Non-members are able to download or copy hazard indicator data.
4162

42-
Hazard indicator data can be downloaded or copied from the 'os-climate-public-data' bucket. A list of the keys to copy is available from
63+
Hazard indicator data can be downloaded or copied from the
64+
'os-climate-public-data' bucket. A list of the keys to copy is available from
4365
<https://os-climate-public-data.s3.amazonaws.com/hazard/keys.txt>
4466

45-
An inventory of the hazard data is maintained [here](https://github.com/os-climate/hazard/blob/main/src/inventories/hazard/inventory.json) (this is used by the physrisk library itself). The [UI hazard viewer](https://physrisk-ui-physrisk.apps.odh-cl2.apps.os-climate.org) is a convenient way to browse data sets.
67+
An inventory of the hazard data is maintained in the
68+
[hazard inventory](https://github.com/os-climate/hazard/blob/main/src/inventories/hazard/inventory.json)
69+
(this is used by the physrisk library itself). The
70+
[UI hazard viewer](https://physrisk-ui-physrisk.apps.odh-cl2.apps.os-climate.org)
71+
is a convenient way to browse data sets.
4672

47-
Access to hazard event data requires setting of environment variables specifying the S3 Bucket, for example:
73+
Access to hazard event data requires setting of environment variables
74+
specifying the S3 Bucket, for example:
4875

49-
```
76+
```bash
5077
OSC_S3_BUCKET=physrisk-hazard-indicators
5178
OSC_S3_ACCESS_KEY=**********
5279
OSC_S3_SECRET_KEY=**********
5380
```
5481

55-
For use in a Jupyter environment, it is recommended to put the environment variables in a credentials.env file and do, for example:
82+
For use in a Jupyter environment, it is recommended to put the environment
83+
variables in a credentials.env file and do, for example:
5684

57-
```
85+
```python
5886
from dotenv import load_dotenv
5987
load_dotenv(dotenv_path=dotenv_path, override=True)
6088
```

docs/README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,4 +9,5 @@ make html
99

1010
A Read the Docs process builds to: <https://physrisk.readthedocs.io/en/latest/index.html>.
1111

12-
Currently ``requirements-docs.txt`` is used by Read the Docs and requires all physrisk packages in order to generate API correctly.
12+
Currently ``requirements-docs.txt`` is used by Read the Docs and requires
13+
all physrisk packages in order to generate API correctly.

methodology/toadapt/README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,3 @@
1+
# Materials to Adapt
2+
13
Various materials to adapt integrate into the documentation.
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
1-
These files contain a mixture of hazard information and details of an ECB stress test study (beyond scope of physrisk).
1+
# Hazard Information Files
2+
3+
These files contain a mixture of hazard information and details of an ECB
4+
stress test study (beyond scope of physrisk).
25
TODO: separate out hazard part and add to methodology doc.
Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# Vulnerability configuration
22

3-
Vulnerability configuration is generated by a test: `test_generate_all_config`.
3+
Vulnerability configuration is generated by a test:
4+
`test_generate_all_config`.
45

5-
This test writes to a temporary file `candidate_vulnerability_config.csv` that can be copied into `vulnerability.config.csv`.
6+
This test writes to a temporary file `candidate_vulnerability_config.csv`
7+
that can be copied into `vulnerability.config.csv`.

0 commit comments

Comments
 (0)