Skip to content

Instantly share code, notes, and snippets.

View jhamman's full-sized avatar
🔨
Building something new!

Joe Hamman jhamman

🔨
Building something new!
View GitHub Profile
@jhamman
jhamman / demo.ipynb
Created February 7, 2024 06:12
Zarr V3 status update
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jhamman
jhamman / LICENSE
Created January 26, 2023 21:37 — forked from nymous/README.md
Logging setup for FastAPI, Uvicorn and Structlog (with Datadog integration)
MIT License
Copyright (c) 2023 Thomas GAUDIN
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jhamman
jhamman / dask_gateway_3.py
Created March 30, 2020 18:44
dask_gateway_3.py
from dask.distributed import Client
from dask_gateway import Gateway
gateway = Gateway() # connect to Gateway
cluster = gateway.new_cluster() # create cluster
cluster.scale(...) # scale cluster
client = Client(cluster) # connect Client to Cluster
@jhamman
jhamman / dask_gateway_2.py
Last active March 30, 2020 18:45
dask_gateway_2.py
from dask.distributed import Client
from dask_kubernetes import KubeCluster
cluster = KubeCluster() # create cluster
cluster.scale(...) # scale cluster
client = Client(cluster) # connect Client to Cluster
@jhamman
jhamman / dask_gateway_1.py
Last active March 30, 2020 18:46
dask_gateway_1.py
options.worker_cores = 1
options.worker_memory = 8
cluster = gateway.new_cluster(cluster_options=options)
@jhamman
jhamman / dask_k8s.py
Created March 30, 2020 18:39
dask_k8s.py
containers = [
{
"args": [
"dask-worker", "--nthreads", "1",
"--memory-limit", "14GB",
],
"resources": {
"limits": {"cpu": 1, "memory": "14G"},
"requests": {"cpu": 1, "memory": "14G"},
},
@jhamman
jhamman / dask_k8s.yaml
Created March 30, 2020 18:38
dask_k8s.yaml
# file: dask_config.yaml
kubernetes:
worker-template:
spec:
containers:
- args:
- dask-worker
- --nthreads
- '2'
- --memory-limit
$ pip install intake-stac
# or
$ conda install -c conda-forge intake-stac
In [7]: import satsearch
In [8]: results = satsearch.Search.search(
...: collection='landsat-8-l1',
...: bbox=[43.16, -11.32, 43.54, -11.96],
...: sort=['<datetime'], #earliest scene first
...: property=["landsat:tier=T1"])
...:
In [9]: catalog = intake.open_stac_item_collection(results.items())
In [10]: catalog
<satstac.itemcollection.ItemCollection at 0x7f96efe16828>