diff --git a/.github/workflows/pre-commit.yml b/.github/workflows/pre-commit.yml new file mode 100644 index 0000000..c7aa47a --- /dev/null +++ b/.github/workflows/pre-commit.yml @@ -0,0 +1,16 @@ +name: pre-commit + +on: + push: + branches: [main] + pull_request: + +jobs: + pre-commit: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-python@v5 + with: + python-version: "3.12" + - uses: pre-commit/action@v3.0.1 diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..5d7ae92 --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,39 @@ +name: publish + +on: + push: + branches: [main] + pull_request: + workflow_dispatch: + +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: pages-${{ github.ref }} + cancel-in-progress: true + +jobs: + render: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: quarto-dev/quarto-actions/setup@v2 + - uses: quarto-dev/quarto-actions/render@v2 + - uses: actions/upload-pages-artifact@v3 + with: + path: _site + + deploy: + # only deploy from main; on pull requests the render job checks the site builds + if: github.event_name != 'pull_request' && github.ref == 'refs/heads/main' + needs: render + runs-on: ubuntu-latest + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + steps: + - id: deployment + uses: actions/deploy-pages@v4 diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..329ce3c --- /dev/null +++ b/.gitignore @@ -0,0 +1,5 @@ +_site/ +.quarto/ + +/.quarto/ +**/*.quarto_ipynb diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml new file mode 100644 index 0000000..611dc14 --- /dev/null +++ b/.pre-commit-config.yaml @@ -0,0 +1,8 @@ +repos: + - repo: https://github.com/pre-commit/pre-commit-hooks + rev: v5.0.0 + hooks: + - id: trailing-whitespace + - id: end-of-file-fixer + - id: check-yaml + - id: check-merge-conflict diff --git a/README.md b/README.md index cbcdc69..97f65d0 100644 --- a/README.md +++ b/README.md @@ -1,2 +1,30 @@ # mlwp-tools.github.io -Website for the mlwp-tools organisation (https://mlwp-tools.github.io) + +Source for the mlwp-tools website, https://mlwp-tools.github.io. The site is built with [Quarto](https://quarto.org) from the markdown files in this repository, and deployed to GitHub Pages by the `publish` workflow on every push to `main`. + +## Adding or editing a page + +1. Create a branch and add a markdown file at the repository root, e.g. `my-page.md`, starting with a front matter block that sets the page title: + + ```markdown + --- + title: "My page" + --- + + Content goes here. + ``` + +2. Link the page from the navbar by adding it under `website.navbar.left` in `_quarto.yml`. +3. Open a pull request. The `publish` workflow renders the site on the PR to check it builds, and deploys it once the PR is merged into `main`. + +Small edits can also be made straight from the site through the "Edit this page" link on each page. + +## Previewing locally + +Install the [Quarto CLI](https://quarto.org/docs/get-started/) (or use `uvx --from quarto-cli quarto`), then run + +```bash +quarto preview +``` + +which serves the site locally and re-renders on every change. `quarto render` builds the full site into `_site/`. diff --git a/_quarto.yml b/_quarto.yml new file mode 100644 index 0000000..7b715e4 --- /dev/null +++ b/_quarto.yml @@ -0,0 +1,26 @@ +project: + type: website + output-dir: _site + +website: + title: "mlwp-tools" + site-url: https://mlwp-tools.github.io + repo-url: https://github.com/mlwp-tools/mlwp-tools.github.io + repo-actions: [edit, issue] + navbar: + left: + - href: index.md + text: Home + - href: roadmap.md + text: Roadmap + right: + - icon: github + href: https://github.com/mlwp-tools + aria-label: mlwp-tools on GitHub + +format: + html: + theme: + light: cosmo + dark: darkly + toc: true diff --git a/index.md b/index.md new file mode 100644 index 0000000..2e98ac2 --- /dev/null +++ b/index.md @@ -0,0 +1,19 @@ +--- +title: "mlwp-tools" +subtitle: "Tools for machine-learning weather prediction" +toc: false +--- + +mlwp-tools is a collection of Python packages for working with machine-learning weather prediction (MLWP) data: defining dataset conventions, loading data into them, aligning datasets in space and time, and verifying forecasts. + +## Packages + +| Package | Description | +|---|---| +| [mlwp-data-specs](https://github.com/mlwp-tools/mlwp-data-specs) | Dataset specifications for MLWP applications for time, coordinate and uncertainty traits based on `xr.Dataset`s and CF Zarr | +| [mlwp-data-loaders](https://github.com/mlwp-tools/mlwp-data-loaders) | General-purpose data-loaders to create mlwp-data-spec conforming `xr.Dataset`s | +| [mxalign](https://github.com/mlwp-tools/mxalign) | xarray-based space/time/uncertainty-alignment for meteorological datasets | +| [mlwp-harp-writer](https://github.com/mlwp-tools/mlwp-harp-writer) | Write mxalign-aligned, mlwp-data-specs conforming datasets to HARP parquet datasets | +| [mlwp-scorecard](https://github.com/mlwp-tools/mlwp-scorecard) | Easy weather model scorecard creation in Python | + +See the [roadmap](roadmap.md) for where the project is heading. diff --git a/roadmap.md b/roadmap.md new file mode 100644 index 0000000..e657db7 --- /dev/null +++ b/roadmap.md @@ -0,0 +1,5 @@ +--- +title: "Roadmap" +--- + +The roadmap is coming soon.