Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update hazard #121

Merged
merged 46 commits into from
Jul 11, 2023
Merged
Show file tree
Hide file tree
Changes from 43 commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
df20b66
Edit to calculation_method field
odscrachel Jul 4, 2023
a45d563
event identifier field
odscrachel Jul 4, 2023
819cdd2
event set identifier field
odscrachel Jul 4, 2023
e96f20e
footprint identifier field
odscrachel Jul 4, 2023
b8ddd17
moving process_type from footprint to event set
odscrachel Jul 4, 2023
d48d3ee
disaster identifier (glide) field
odscrachel Jul 4, 2023
56d1fbc
temporal object event_set
odscrachel Jul 4, 2023
5a9076d
create frequency_distribution.csv codelist
odscrachel Jul 4, 2023
75a64fd
update 'frequency_distribution.csv' and data model
odscrachel Jul 4, 2023
0ebe112
codelists/closed/frequency_distribution.csv: Remove trailing whitespace
duncandewhurst Jul 5, 2023
f9b3bfe
rdl_schema_0.1: Nest footprints within events, events within event sets
duncandewhurst Jul 5, 2023
a16f91f
rdl_schema_0.1: add frequency_distribution field
odscrachel Jul 5, 2023
014bbea
seasonality add codelist and field to event_set
odscrachel Jul 5, 2023
d85e95e
pre commit
odscrachel Jul 5, 2023
7d62871
rdl_schema_0.1: update hazard_type field
odscrachel Jul 5, 2023
9c0002c
update analysis_type field edit hazard_type field
odscrachel Jul 5, 2023
0be42fb
add calculation_method field to event_set
odscrachel Jul 5, 2023
6af318c
add number_events field to event_set
odscrachel Jul 5, 2023
fbcdf0e
update changelog
odscrachel Jul 5, 2023
1a2ae31
add process_type field to event
odscrachel Jul 5, 2023
2f0cba2
Merge branch 'dev' into hazard
duncandewhurst Jul 5, 2023
c2d91ad
schema/rdl_schema_0.1.json: Update codelist links
duncandewhurst Jul 5, 2023
303e0f5
docs/reference: Update schema and codelist reference
duncandewhurst Jul 5, 2023
8cd2c43
Update docs/about/changelog.md
odscrachel Jul 6, 2023
0e456e9
Apply suggestions from code review
odscrachel Jul 6, 2023
780b40e
Apply suggestions from code review
odscrachel Jul 6, 2023
60e99cf
schema/rdl_schema_0.1.json: Occurrence object
odscrachel Jul 6, 2023
3733723
indentation
odscrachel Jul 6, 2023
4a1d338
indentation fix
odscrachel Jul 6, 2023
21e4b06
Run ocdskit indent -r .
duncandewhurst Jul 7, 2023
0bf297d
pull_request_template.md: Add link to developer docs
duncandewhurst Jul 7, 2023
3bb5941
docs/reference/schema.md: Run ./manage.py pre-commit
duncandewhurst Jul 7, 2023
cb321a3
apply review suggestions
odscjen Jul 7, 2023
2dcabd6
Merge branch 'dev' into hazard
odscjen Jul 7, 2023
dc1b05e
revert merge with dev and redo to fix conflict resolution errors
odscjen Jul 7, 2023
61616c8
revert merge with dev and redo to fix conflict resolution errors, pul…
odscjen Jul 7, 2023
a2d3628
add title to 'event.description'
odscjen Jul 7, 2023
c35ae17
add event_sets array to hazard and fix error in schema.md
odscjen Jul 7, 2023
a4e9408
run indent
odscjen Jul 7, 2023
6baf081
rdl_schema_0.1: Rename Hazard to Hazard_metadata, update description
duncandewhurst Jul 9, 2023
48ad482
rdl_schema_0.1: Add Event_set.hazards and Event.hazard
duncandewhurst Jul 9, 2023
7272940
add 'deterministic' and 'empirical' to 'occurrence
odscjen Jul 10, 2023
9f6e2a5
Merge branch 'dev' into hazard
odscjen Jul 10, 2023
747c46d
merge dev
odscjen Jul 10, 2023
e775965
remove remaining superceded common definitions
odscjen Jul 10, 2023
daf16fd
Apply suggestions from code review
duncandewhurst Jul 11, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions codelists/closed/frequency_distribution.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
Code,Title,Description
poisson,Poisson,Data modelled using a poisson distribution.
negativeBinomial,Negative Binomial,Data modelled using a negative binomial distribution.
userDefined,User defined,Data modelled using a user defined distribution.
3 changes: 3 additions & 0 deletions codelists/closed/seasonality.csv
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Code,Title
uniform,Uniform
userDefined,User defined
17 changes: 17 additions & 0 deletions docs/about/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,22 @@ This page lists changes to the Risk Data Library Standard.
- Add validation keywords to `Location`, `Gazetteer_entry` and `Geometry` definitions.
- [#116](https://github.com/GFDRR/rdl-standard/pull/116) - Replace `biblio_title` and `biblio_url` with `Related_resource` definition.
- [#115](https://github.com/GFDRR/rdl-standard/pull/115) - Add `Entity` and `Attribution` objects, update entity related field names and descriptions.
- [#121](https://github.com/GFDRR/rdl-standard/pull/121):
- Nest footprints within events and events within event sets.
- Update `calculation_method`.
- Add fields:
- `event_set.id`
- `event.id`
- `footprint_set.id`
- `event_set.disaster_identifier`
- `event_set.frequency_distribution`
- `event_set.seasonality`
- `event_set.calculation_method`
- `event_set.number_events`
- `event_set.temporal`
- Add codelists for `event_set.hazard_type` and `event_set.analysis_type`.
- Move `process_type` from `footprint_set` to `event` and `event_set`.
- Create `Occurrence` object.
- [#124](https://github.com/GFDRR/rdl-standard/pull/124):
- Replace `vulnerability` object with `Vulnerability` definition.
- Replace `function_type`, `calculation_method`, `approach`, `f_math` and `f_relationship` with `functions` object and `Vulnerability_function`, `Fragility_function`, `Damage_to_loss_function` and `Engineering_demand_function` definitions.
Expand All @@ -36,6 +52,7 @@ This page lists changes to the Risk Data Library Standard.
- [#114](https://github.com/GFDRR/rdl-standard/pull/114) - 'IMT.csv' add descriptions and change pattern of codes to metric:unit.
- [#117](https://github.com/GFDRR/rdl-standard/pull/117) - Create 'license.csv' codelist and replace `license_code` field with `license`.
- [#105](https://github.com/GFDRR/rdl-standard/pull/105) - Create 'country.csv', 'location_gazetteers.csv' and 'geometry_type.csv'.
- [#121](https://github.com/GFDRR/rdl-standard/pull/121) - Create 'frequency_distribution.csv' and 'seasonality.csv'
- [#130](https://github.com/GFDRR/rdl-standard/pull/130) - 'hazard_type.csv' add descriptions and hazard category which aligns with UNDRR Hazard taxonomy, and update codes from abbreviations to human-readable words.
- [#134](https://github.com/GFDRR/rdl-standard/pull/134) - 'risk_data_type.csv', replace codes with lower-case versions.

Expand Down
24 changes: 24 additions & 0 deletions docs/reference/codelists.md
Original file line number Diff line number Diff line change
Expand Up @@ -271,6 +271,18 @@ file: ../../codelists/closed/exposure_category.csv
---
```

### frequency_distribution

This codelist has the following codes:

```{csv-table-no-translate}
---
header-rows: 1
widths: auto
file: ../../codelists/closed/frequency_distribution.csv
---
```

### function_approach

This codelist is referenced by the following properties:
Expand Down Expand Up @@ -379,6 +391,18 @@ file: ../../codelists/closed/risk_data_type.csv
---
```

### seasonality

This codelist has the following codes:

```{csv-table-no-translate}
---
header-rows: 1
widths: auto
file: ../../codelists/closed/seasonality.csv
---
```

### source_type

This codelist is referenced by the following properties:
Expand Down
220 changes: 197 additions & 23 deletions docs/reference/schema.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ In addition to schema-specific attributes, each dataset is identified by a list

```{jsonschema} ../../docs/_readthedocs/html/rdl_schema_0.1.json
---
collapse: spatial,resources
collapse: spatial,resources,referenced_by,contact_point,creator,attributions
addtargets:
---
```
Expand Down Expand Up @@ -150,7 +150,7 @@ The hazard dataset could include one or more footprints for the same event, wher
```{jsonschema} ../../docs/_readthedocs/html/rdl_schema_0.1.json
---
pointer: /anyOf/0/properties/hazard
collapse:
collapse: event_sets
addtargets:
---
```
Expand Down Expand Up @@ -243,7 +243,7 @@ Additional **tags** attributes can be associated with an asset to link any infor
```{jsonschema} ../../docs/_readthedocs/html/rdl_schema_0.1.json
---
pointer: /anyOf/1/properties/exposure
collapse:
collapse: cost
addtargets:
---
```
Expand Down Expand Up @@ -458,26 +458,6 @@ Insert example of recorded empirical losses.

## Sub-schemas

### Exposure

`Exposure` is defined as:

```{jsoninclude-quote} ../../docs/_readthedocs/html/rdl_schema_0.1.json
---
jsonpointer: /$defs/Exposure/description
---
```

Each `Exposure` has the following fields:

```{jsonschema} ../../docs/_readthedocs/html/rdl_schema_0.1.json
---
pointer: /$defs/Exposure
collapse: category,taxonomy,cost
addtargets:
---
```

### Cost

`Cost` is defined as:
Expand Down Expand Up @@ -638,6 +618,40 @@ addtargets:
---
```

### Event_set

`Event_set` is defined as:

```{jsoninclude-quote} ../../docs/_readthedocs/html/rdl_schema_0.1.json
---
jsonpointer: /$defs/Event_set/description
---
```

Each `Event_set` has the following fields:

```{jsonschema} ../../docs/_readthedocs/html/rdl_schema_0.1.json
---
pointer: /$defs/Event_set
collapse:
id,hazards,analysis_type,frequency_distribution,seasonality,calculation_method,event_count,occurrence_range,spatial,temporal,events
addtargets:
---
```

### Event

Each `Event` has the following fields:

```{jsonschema} ../../docs/_readthedocs/html/rdl_schema_0.1.json
---
pointer: /$defs/Event
collapse:
id,disaster_identifier,calculation_method,hazard,occurrence,description,footprints
addtargets:
---
```

### Vulnerability

`Vulnerability` is defined as:
Expand Down Expand Up @@ -699,6 +713,26 @@ addtargets:
---
```

### Occurrence

`Occurrence` is defined as:

```{jsoninclude-quote} ../../docs/_readthedocs/html/rdl_schema_0.1.json
---
jsonpointer: /$defs/Occurrence/description
---
```

Each `Occurrence` has the following fields:

```{jsonschema} ../../docs/_readthedocs/html/rdl_schema_0.1.json
---
pointer: /$defs/Occurrence
collapse: probabilistic,empirical,deterministic
addtargets:
---
```

### Damage_to_loss_function

`Damage_to_loss_function` is defined as:
Expand All @@ -719,6 +753,26 @@ addtargets:
---
```

### Probabilistic

`Probabilistic` is defined as:

```{jsoninclude-quote} ../../docs/_readthedocs/html/rdl_schema_0.1.json
---
jsonpointer: /$defs/Probabilistic/description
---
```

Each `Probabilistic` has the following fields:

```{jsonschema} ../../docs/_readthedocs/html/rdl_schema_0.1.json
---
pointer: /$defs/Probabilistic
collapse: return_period,event_rate,probability
addtargets:
---
```

### Engineering_demand_function

`Engineering_demand_function` is defined as:
Expand All @@ -739,6 +793,26 @@ addtargets:
---
```

### Probability

`Probability` is defined as:

```{jsoninclude-quote} ../../docs/_readthedocs/html/rdl_schema_0.1.json
---
jsonpointer: /$defs/Probability/description
---
```

Each `Probability` has the following fields:

```{jsonschema} ../../docs/_readthedocs/html/rdl_schema_0.1.json
---
pointer: /$defs/Probability
collapse: value,span
addtargets:
---
```

### Impact

`Impact` is defined as:
Expand Down Expand Up @@ -779,6 +853,26 @@ addtargets:
---
```

### Footprint

`Footprint` is defined as:

```{jsoninclude-quote} ../../docs/_readthedocs/html/rdl_schema_0.1.json
---
jsonpointer: /$defs/Footprint/description
---
```

Each `Footprint` has the following fields:

```{jsonschema} ../../docs/_readthedocs/html/rdl_schema_0.1.json
---
pointer: /$defs/Footprint
collapse: id,intensity_measure,data_uncertainty
addtargets:
---
```

### Source

`Source` is defined as:
Expand All @@ -798,3 +892,83 @@ collapse: id,name,url,type,component
addtargets:
---
```

### Hazard

`Hazard` is defined as:

```{jsoninclude-quote} ../../docs/_readthedocs/html/rdl_schema_0.1.json
---
jsonpointer: /$defs/Hazard/description
---
```

Each `Hazard` has the following fields:

```{jsonschema} ../../docs/_readthedocs/html/rdl_schema_0.1.json
---
pointer: /$defs/Hazard
collapse: id,type,processes,intensity_measure,trigger
addtargets:
---
```

### Trigger

`Trigger` is defined as:

```{jsoninclude-quote} ../../docs/_readthedocs/html/rdl_schema_0.1.json
---
jsonpointer: /$defs/Trigger/description
---
```

Each `Trigger` has the following fields:

```{jsonschema} ../../docs/_readthedocs/html/rdl_schema_0.1.json
---
pointer: /$defs/Trigger
collapse: type,processes
addtargets:
---
```

### Empirical

`Empirical` is defined as:

```{jsoninclude-quote} ../../docs/_readthedocs/html/rdl_schema_0.1.json
---
jsonpointer: /$defs/Empirical/description
---
```

Each `Empirical` has the following fields:

```{jsonschema} ../../docs/_readthedocs/html/rdl_schema_0.1.json
---
pointer: /$defs/Empirical
collapse: temporal,return_period
addtargets:
---
```

### Deterministic

`Deterministic` is defined as:

```{jsoninclude-quote} ../../docs/_readthedocs/html/rdl_schema_0.1.json
---
jsonpointer: /$defs/Deterministic/description
---
```

Each `Deterministic` has the following fields:

```{jsonschema} ../../docs/_readthedocs/html/rdl_schema_0.1.json
---
pointer: /$defs/Deterministic
collapse: index_criteria,thresholds
addtargets:
---
```
4 changes: 2 additions & 2 deletions manage.py
Original file line number Diff line number Diff line change
Expand Up @@ -308,8 +308,8 @@ def update_schema_docs(schema):
for defn, definition in schema["$defs"].items():
definition["content"] = definition.get("content", [])

# Omit Resource definition and string definitions, which will be moved to CSV codelists
if defn != 'Resource' and definition.get('type') == 'object':
# Omit Resource and Exposure definitions and string definitions, which will be moved to CSV codelists
if defn not in ['Resource', 'Hazard_metadata', 'Exposure'] and definition.get('type') == 'object':

# Add heading
definition["content"].insert(0, f"### {defn}\n")
Expand Down
4 changes: 4 additions & 0 deletions pull_request_template.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,7 @@
If you added or removed a field:

- [ ] Update the `collapse` option of the jsonschema directives for dataset, resource, hazard, exposure, vulnerability and loss on `reference/schema.md`

**Having trouble?**

See [how to resolve check failures](https://github.com/GFDRR/rdl-standard/blob/dev/developer_docs.md#resolve-check-failures).
Loading