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

135 examples #196

Merged
merged 40 commits into from
Aug 30, 2023
Merged

135 examples #196

merged 40 commits into from
Aug 30, 2023

Conversation

duncandewhurst
Copy link
Contributor

@duncandewhurst duncandewhurst commented Aug 17, 2023

Related issues

Description

This PR:

  • Adds the example from [Docs update] Examples to be included #135 (comment)
  • Updates ./manage.py to generate transposed CSV files from JSON examples for presentation in the schema reference documentation
  • Consistently prefixes identifier titles with the name of the parent object to aid example comprehension
  • Shortens the title of hazard, exposure, vulnerability and loss to reduce the length of the example CSV file names

Merge checklist

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

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.

@duncandewhurst
Copy link
Contributor Author

Preview (below schema reference table): https://rdl-standard.readthedocs.io/en/135-examples/reference/schema/#hazard

@odscjen
Copy link
Contributor

odscjen commented Aug 21, 2023

@duncandewhurst Mat's done a new version of the Fathom hazard data example, can I delete the example.json that's currently in the examples/hazard/fathom folder and rename the new version to example.json?

@odscjen
Copy link
Contributor

odscjen commented Aug 21, 2023

@duncandewhurst I ran manage.py but examples/hazard/aqueduct/dataset.csv is coming back as empty?

I get the warning

/home/jen/rdl-standard/.ve/bin/flatten-tool:4: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
import('pkg_resources').require('flattentool==0.22.0')

but I don't think that's causing the issue?

@duncandewhurst
Copy link
Contributor Author

@duncandewhurst Mat's done a new version of the Fathom hazard data example, can I delete the example.json that's currently in the examples/hazard/fathom folder and rename the new version to example.json?

Yep, that's right. If the new example results in a different set of CSV files, you'll also need to update docs/reference/schema.md.

@duncandewhurst I ran manage.py but examples/hazard/aqueduct/dataset.csv is coming back as empty?

Ah, I forgot to mention that the example RDLS metadata in the JSON file needs to be wrapped in an outer datasets array. I've added some instructions to https://github.com/GFDRR/rdl-standard/blob/135-examples/developer_docs.md#add-an-rdls-metadata-example

I get the warning...

Looks like this is a bug in the version of pip that you're using. Try upgrading pip and see if that removes the warning: pip install --upgrade pip

@duncandewhurst
Copy link
Contributor Author

@odscjen let me know once the example JSON and CSV files are ready and I'll have a think about how best to present them in the docs.

@odscjen
Copy link
Contributor

odscjen commented Aug 29, 2023

@duncandewhurst I realised that we do need the new spreadsheet version to finish updating the remaining examples, particularly the exposure one. If you could generate that (I wasn't sure how to) I can update the examples if you don't have time. Ping me in Signal if you need me to do that and I'll get it done tomorrow.

@duncandewhurst duncandewhurst marked this pull request as ready for review August 30, 2023 02:36
@duncandewhurst
Copy link
Contributor Author

duncandewhurst commented Aug 30, 2023

@matamadio @stufraser1 this PR is ready for your review. Jen doesn't work Wednesdays so, with an eye on the workshop on Thursday, once you've reviewed we can merge it, if you're happy with it. I don't think there'll be time to add any more examples before Thursday, but we can make further changes and add more examples in future PRs.

Edit: Preview link for convenience: https://rdl-standard.readthedocs.io/en/135-examples/reference/schema/

@duncandewhurst duncandewhurst merged commit 2cb3558 into dev Aug 30, 2023
@duncandewhurst duncandewhurst deleted the 135-examples branch August 30, 2023 19:56
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