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

fix: add mdx generation #188

Merged
merged 17 commits into from
Dec 10, 2024
Merged

fix: add mdx generation #188

merged 17 commits into from
Dec 10, 2024

Conversation

botanical
Copy link
Member

@botanical botanical commented Nov 22, 2024

Issue

#182

@botanical botanical marked this pull request as ready for review November 22, 2024 18:33
@botanical botanical requested a review from smohiudd as a code owner November 22, 2024 18:33
Copy link

github-actions bot commented Nov 22, 2024

Workflow Status

Starting workflow... View action run

Collection Publication Status

  • modis-ndvi-diff-2015-2022-TEST: Successfully published ✅

Collection Publication Status

  • modis-ndvi-diff-2015-2022-TEST: Successfully published ✅

@botanical
Copy link
Member Author

The script, when run locally, generates a file with:

---
id: modis-ndvi-diff-2015-2022-TEST
name: 'Camp Fire Domain: MODIS NDVI Difference'
featured: false
description: MODIS NDVI difference from a three-year average of 2015 to 2018 subtracted
  from a three-year average of 2019-2022. These tri-annual averages represent periods
  before and after the fire.
media:
  src: https://bootstrap-cheatsheet.themeselection.com/assets/images/bs-images/img-2x1.png
  alt: Placeholder image
  author:
    name: Media author
    url: ''
taxonomy:
- name: Theme
  values:
  - Greenhouse Gases
- name: Source
  values:
  - NASA
infoDescription: "::markdown\n            - **Temporal Extent:** 2015 - 2100\n   \
  \         - **Temporal Resolution:** Annual\n            - **Spatial Extent:** Global\n\
  \            - **Spatial Resolution:** 0.25 degrees x 0.25 degrees\n           \
  \ - **Data Units:** Days (Days per year above 90\xB0F or 110\xB0F)\n           \
  \ - **Data Type:** Research\n        "
layers: []
---
<Block>
  <Prose>
    Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
  </Prose>
</Block>

Copy link
Contributor

@anayeaye anayeaye left a comment

Choose a reason for hiding this comment

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

I ran this locally and it works as expected. I think we might be able to parse a bit more from the dataset-config json and maybe add some more hints in the rendered MDX about properties that need to be updated. I think the only change that we actually need to add here is the shebang in the python file

scripts/generate-mdx.py Show resolved Hide resolved
scripts/generate-mdx.py Outdated Show resolved Hide resolved
Comment on lines +52 to +58
"sourceParams": {
"assets": asset_id,
"resampling_method": "bilinear",
"colormap_name": "wistia",
"rescale": "0,365",
"maxzoom": 4,
},
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
"sourceParams": {
"assets": asset_id,
"resampling_method": "bilinear",
"colormap_name": "wistia",
"rescale": "0,365",
"maxzoom": 4,
},

I think we should check and see if the dashboard is ready to use renders params instead of sourceParams and leave this out entirely?

Co-authored-by: Alexandra Kirk <[email protected]>
Co-authored-by: Alexandra Kirk <[email protected]>
Copy link
Contributor

@anayeaye anayeaye left a comment

Choose a reason for hiding this comment

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

My other comments were just for discussion. This is ready to go

@botanical botanical merged commit 4a3ad2e into main Dec 10, 2024
6 checks passed
@botanical botanical deleted the issue-182/mdx-file-generation branch December 10, 2024 20:14
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.

2 participants