Skip to content

Instantly share code, notes, and snippets.

View benbovy's full-sized avatar

Benoit Bovy benbovy

View GitHub Profile
@benbovy
benbovy / environment.yml
Created October 13, 2021 14:16
Fastscape - Drainage area - Coarse grids
name: fastscape-demo
channels:
- conda-forge
- defaults
dependencies:
- aiohttp=3.6.2=py38h0b31af3_0
- ansiwrap=0.8.4=py_0
- anyio=2.2.0=py38h50d1736_0
- appdirs=1.4.4=pyh9f0ad1d_0
- appnope=0.1.0=py38h32f6830_1001
@benbovy
benbovy / export_xr_mask_as_shp_points.ipynb
Created October 7, 2021 08:13
Export Xarray raster mask as point shapefile
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@benbovy
benbovy / arome_fr_analysis.ipynb
Created July 23, 2021 11:01
Total precipitation forecast / Meteo-France AROME model / Belgium flooding 2021-07
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@benbovy
benbovy / test_pys2index.ipynb
Last active October 20, 2020 20:21
pys2index preliminary tests and benchmarks
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@benbovy
benbovy / inference_pymc3_theano.ipynb
Created August 30, 2020 19:09
Inference of time exposure and erosion rate from 10Be data using PyMC3
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@benbovy
benbovy / ball_tree_xr_accessor.ipynb
Last active July 31, 2022 20:58
Ball Tree Xarray Index
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@benbovy
benbovy / test_balltree.ipynb
Created June 24, 2020 14:58
Nearest neighbor lookup with lat/lon coordinates using sklearn's BallTree
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@benbovy
benbovy / flexible_routes.py
Last active June 17, 2020 15:24
FastAPI flexible routes
from typing import Callable, Dict, Union
from fastapi import APIRouter, Depends, FastAPI, HTTPException
import xarray as xr
DatasetOrCollection = Union[xr.Dataset, Dict[str, xr.Dataset]]
def _get_dataset_dependency(obj: DatasetOrCollection) -> Callable:
@benbovy
benbovy / xsimlab_process_class_factory.ipynb
Created June 10, 2020 08:26
xarray-simlab process class factory
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.