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 schema reference #120

Merged
merged 17 commits into from
Jul 5, 2023
Merged

Update schema reference #120

merged 17 commits into from
Jul 5, 2023

Conversation

duncandewhurst
Copy link
Contributor

@duncandewhurst duncandewhurst commented Jul 4, 2023

Related issues

Description

This PR updates the reference documentation (formerly known as the data model section). The schema tables are now generated from the schema as part of the Sphinx build so they will always be up-to-date and manage.py includes a pre-commit script to update the sub-schema and codelist reference sections.

The diagrams, explanatory text and examples will need updating once the schema updates are done, but I don't think that should be a blocker to getting this PR merged.

I've temporarily commented out the code in manage.py that adds the lists of references to the sub-schema reference and codelist reference as this requires some more work due to the structure of the RDLS schema and I understand that finishing off the schema changes is the priority.

Merge checklist

  • Update the changelog (style guide)
  • Run ./manage.py pre-commit

@duncandewhurst duncandewhurst requested a review from odscjen July 4, 2023 06:18
@duncandewhurst duncandewhurst marked this pull request as ready for review July 4, 2023 06:19
@duncandewhurst
Copy link
Contributor Author

odscjen
odscjen previously approved these changes Jul 4, 2023
Copy link
Contributor

@odscjen odscjen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I started correcting some language and then realised it was pointless as most of the component pages are going to need rewritten anyway as they are now incorrect and refer to fields etc that have been removed/renamed/resituated.

So other than that it all looks fine

### risk_data_type
### hazard_type

The RDLS offers a classification of hazards that are more often required in disaster risk assessments, based on the review and mapping of existing alternative definitions into one consistent framework.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a question about this bit, do we need to write explanations for all of the codelists and include them in this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think so since the codelist are linked from the schema tables, which provide the context of what they are used for. I just copied this text from the old hazard.md page in order to preserve it.

docs/reference/schema.md Outdated Show resolved Hide resolved
docs/reference/schema.md Outdated Show resolved Hide resolved
docs/reference/schema.md Outdated Show resolved Hide resolved
docs/reference/schema.md Outdated Show resolved Hide resolved

When the scenario modelled refers to a specific period of time, this can be specified in terms of dates, period span and reference year. For example, an observed flood event that occurred from 1.10.2009 (time start) to 3.10.2009 (time end), spanning over 3 days (time span). When precise time collocation is unknown or not applicable, a general reference date such as "2009" is used to identify events (time year). This is also useful to specify future scenario, e.g. time year: 2050.

When instead the hazard scenario is represented in probabilistic terms, the occurrence probability (frequency distribution) of hazard can be expressed in different ways. The most common way to communicate this is the "return period", expressed as the number of years after which a given hazard intensity could occur again: RP 100 indicates that that event has a probability of once in 100 years. This attribute can indicate individual layer frequency (RP100) or a range of frequencies for a collection of layers (RP10-100) The probability of occurrence is usually calculated on the basis of a reference period that provides observations: this period can be specified by start date, end date and time span. For example, an analysis of earthquake frequency based on seismic observations from 1934 (occurrence time start) to 2001 (occurrence time end), for a total count of 66 years (occurrence time span).
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This whole paragraph will need rewritten I think as the way occurence is modelled in the updated schema is very different

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, but, as mentioned in the issue description, I think updating the text is best left until the schema updates are done.

docs/reference/schema.md Outdated Show resolved Hide resolved
docs/reference/schema.md Outdated Show resolved Hide resolved
docs/reference/schema.md Outdated Show resolved Hide resolved
}
```

The main features of an exposure dataset are specified by the **exposure model** attributes.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This whole bit will also need rewritten as it no longer matches the updated data model

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, but, as mentioned in the issue description, I think updating the text is best left until the schema updates are done.

@duncandewhurst
Copy link
Contributor Author

duncandewhurst commented Jul 4, 2023

I started correcting some language and then realised it was pointless as most of the component pages are going to need rewritten anyway as they are now incorrect and refer to fields etc that have been removed/renamed/resituated.

Yep, as I mentioned in PR description, the diagrams, explanatory text and examples will need updating once the schema updates are done, but I don't think that should be a blocker to getting this PR merged.

@matamadio @stufraser1, over to you to review. Per the above, there's no need to review the text on schema.md from line 13 onwards as I copy-pasted it from the old data model documentation pages. You can preview the built documentation here: https://rdl-standard.readthedocs.io/en/schema-reference/reference/

Copy link
Member

@stufraser1 stufraser1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Acknowledging text needs to be updated per comments made already, we can accept this. The interactive browser version is helpful.

We also need to update the examples for each section to make a range of examples available with the JSON implementation of the metadata rather than tabulated values. This could include snippet of JSON in the documentation, or a link out to the metadata file if larger.

@duncandewhurst
Copy link
Contributor Author

All sounds good. +1 to using JSON snippets and full files for examples. I'll merge the PR and copy your comment to #43.

@duncandewhurst duncandewhurst merged commit cef894d into dev Jul 5, 2023
@duncandewhurst duncandewhurst deleted the schema-reference branch July 5, 2023 21:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants