This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Fills in implied directory blobs for GCS bucket mounted with GCSfuse without using the --implied-dir option. | |
If you tell it to look in `mygcsbucket` for prefix `path/to/files/to/read/in/gcsfuse/`. It will | |
ensure implied dirs nested in gs://mygcsbucket/path/to/files/to/read/in/gcsfuse/ get covered. | |
It can handle 10 - 100k directories in under 30 minutes if you run it from Cloud Shell. | |
""" | |
import logging | |
from pathlib import Path |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Parse GCP logging to print sample JSON list of container images used in the | |
# past 60 days in a GKE singleuser-server Jupyterhub deployment. | |
# Be sure to set PROJECT_ID and have jq installed. | |
set -e | |
PROJECT_ID="gcpprojectid" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
Trigger a Zenodo DOI for past Github Releases on a public repo. | |
Modified from @medley56 https://github.com/zenodo/zenodo/issues/1463#issuecomment-1468932469 on 2023-08-16. | |
""" | |
import requests | |
# Fill these in... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def lon360to180(lon): | |
return (lon + 180.0) % 360.0 - 180.0 | |
# The inverse going from -180 - 180 to 0 - 360 is | |
def lon180to360(lon): | |
return lon % 360.0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Example CF-convention attrs/metadata | |
{'Conventions': 'CF-1.7 CMIP-6.2', | |
'activity_id': 'CMIP', | |
'branch_method': 'standard', | |
'branch_time_in_child': 0.0, | |
'branch_time_in_parent': 0.0, | |
'cmor_version': '3.4.0', | |
'creation_date': '2019-11-09T02:07:38Z', | |
'data_specs_version': '01.00.30', | |
'experiment': 'all-forcing simulation of the recent past', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
grep '"size":' ${CONDA_PREFIX}/conda-meta/*.json | sort -k3rn | sed 's/.*conda-meta\///g' | column -t |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: argoproj.io/v1alpha1 | |
kind: Workflow | |
metadata: | |
generateName: papermill-test- | |
spec: | |
entrypoint: main | |
templates: | |
- name: main | |
inputs: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import xarray as xr | |
tmin_url = "~/Downloads/tmin-20220208/annual.zarr" | |
tmax_url = "~/Downloads/tmax-20220208/annual.zarr" | |
tmean_url = "~/Downloads/tmean-20220208/annual.zarr" | |
out_url = "gs://fakebucketname/prism-ca-20220208.zarr" | |
tmin = xr.open_zarr(tmin_url).drop("crs") | |
tmax = xr.open_zarr(tmax_url).drop("crs") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
apiVersion: argoproj.io/v1alpha1 | |
kind: Workflow | |
metadata: | |
generateName: dask-internal-process-demo- | |
spec: | |
entrypoint: dask | |
activeDeadlineSeconds: 1800 # Safety first, kids! | |
templates: | |
- name: dask | |
script: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env bash | |
# 2022-01-14 | |
# B. Malevich <[email protected]> | |
# Launch Argo Workflow end-to-end runs with various parameter files. | |
set -e |
NewerOlder