Skip to content

Commit

Permalink
[pre-commit.ci] auto fixes from pre-commit.com hooks
Browse files Browse the repository at this point in the history
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Jul 2, 2024
1 parent a7b43f5 commit e462b76
Show file tree
Hide file tree
Showing 8 changed files with 22 additions and 20 deletions.
10 changes: 5 additions & 5 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: CI
on:
push:
branches: ['main']
branches: ["main"]
pull_request:
branches: ['main']
branches: ["main"]
workflow_dispatch:
schedule:
- cron: '0 0 * * 0' # Weekly “At 00:00”
- cron: "0 0 * * 0" # Weekly “At 00:00”

# concurrency:
# group: ${{ github.workflow }}-${{ github.ref }}
Expand All @@ -22,7 +22,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ['3.9', '3.10', '3.11']
python-version: ["3.9", "3.10", "3.11"]
timeout-minutes: 20
defaults:
run:
Expand All @@ -40,7 +40,7 @@ jobs:
python=${{ matrix.python-version }}
# now called cache-environment
cache-environment: true
post-cleanup: 'none'
post-cleanup: "none"
cache-downloads: false

- name: Install package
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pypi-release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- uses: actions/setup-python@v5.0.0
name: Install Python
with:
python-version: '3.11'
python-version: "3.11"

- name: Install dependencies
run: |
Expand Down Expand Up @@ -70,7 +70,7 @@ jobs:
- uses: actions/setup-python@v5.0.0
name: Install Python
with:
python-version: '3.11'
python-version: "3.11"
- uses: actions/download-artifact@v4
with:
name: releases
Expand Down
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ repos:
hooks:
- id: pyupgrade
args:
- '--py38-plus'
- "--py38-plus"

- repo: https://github.com/psf/black
rev: 24.4.2
Expand All @@ -33,10 +33,10 @@ repos:
- id: blackdoc

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: 'v0.5.0'
rev: "v0.5.0"
hooks:
- id: ruff
args: ['--fix']
args: ["--fix"]

- repo: https://github.com/pre-commit/mirrors-prettier
rev: v4.0.0-alpha.8
Expand Down
2 changes: 1 addition & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ version: 2
build:
os: ubuntu-20.04
tools:
python: 'mambaforge-4.10'
python: "mambaforge-4.10"

# Build documentation in the doc/ directory with Sphinx
sphinx:
Expand Down
1 change: 1 addition & 0 deletions cmip6_downscaling/config.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""Config file used by donfig"""

from __future__ import annotations

_defaults = {
Expand Down
2 changes: 1 addition & 1 deletion docs/running-flows.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ config.set({'runtime': 'cloud'})
```yaml
run_options:

runtime: 'cloud'
runtime: "cloud"
```
### Environment Variables
Expand Down
12 changes: 6 additions & 6 deletions flows/catalogs/web_catalog.py
Original file line number Diff line number Diff line change
Expand Up @@ -284,9 +284,9 @@ def parse_cmip6_downscaled_pyramid(
query = {
'source_id': parameters['model'],
'member_id': parameters['member'],
'experiment_id': 'historical'
if parameters['scenario'] == 'hist'
else parameters['scenario'],
'experiment_id': (
'historical' if parameters['scenario'] == 'hist' else parameters['scenario']
),
'variable_id': parameters['variable'],
}

Expand Down Expand Up @@ -389,9 +389,9 @@ def parse_cmip6_downscaled_pyramid(
downscaling_method=attrs['method'],
root_path=root_path,
)
attrs[
'name'
] = f"{targets['destination_name']}.{attrs['timescale']}" # make sure the name is unique
attrs['name'] = (
f"{targets['destination_name']}.{attrs['timescale']}" # make sure the name is unique
)
attrs['destination_path'] = targets['destination_path']
attrs['source_path'] = from_az_to_https(attrs['daily_downscaled_data_uri'], root_path)

Expand Down
5 changes: 3 additions & 2 deletions flows/cmip6_raw_pyramids.py
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,9 @@ def preprocess(ds) -> xr.Dataset:
def _compute_summary_helper(path, freq, chunks):
import xarray as xr

with xr.set_options(keep_attrs=True), dask.config.set(
**{'array.slicing.split_large_chunks': False}
with (
xr.set_options(keep_attrs=True),
dask.config.set(**{'array.slicing.split_large_chunks': False}),
):
ds = xr.open_zarr(path).pipe(preprocess)
if ds.attrs['variable_id'] in {'tasmax', 'tasmin'}:
Expand Down

0 comments on commit e462b76

Please sign in to comment.