Skip to content

Instantly share code, notes, and snippets.

@nbren12
nbren12 / port-forwarding.txt
Created August 16, 2023 21:33
ssh portfowarding
ssh -L <the port I will open in my browser>:<the hostname of the node on the cluster>:<the port on the node> \
cluster-login-hostname.com
# examples
@nbren12
nbren12 / cupy-proper-scoring.py
Last active July 22, 2023 01:52
use cupy with proper-scoring
import properscoring
properscoring._crps.np = cupy
properscoring._crps._crps_ensemble_core = properscoring._crps._crps_ensemble_vectorized
import cupy as np
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@nbren12
nbren12 / colorblind.py
Last active April 14, 2022 07:07
Colorblind friendly defaults
# https://davidmathlogic.com/colorblind/#%23000000-%23E69F00-%2356B4E9-%23009E73-%23F0E442-%230072B2-%23D55E00-%23CC79A7
wong_palette = [
"#000000",
"#E69F00",
"#56B4E9",
"#009E73",
"#F0E442",
"#0072B2",
"#D55E00",
"#CC79A7",
@nbren12
nbren12 / taxes2020.py
Last active May 1, 2021 20:54
2020 IRS Tax + Capital Gains
"""
Copyright 2021 Noah D. Brenowitz
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:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE US
module python
use machine , only : kind_phys
use callpy_mod
implicit none
character(len=*), parameter :: python_module = "plugin"
contains
subroutine python_init ()
call call_function(python_module, "init")
all:
${CC} -lpython3.8 -I${python}/include/python3.8 main.c
check:
./a.out
install:
mkdir -p ${out}/bin
cp a.out ${out}/bin/main
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.
from numpy.core.fromnumeric import var
from numpy.lib.function_base import place
import streamlit as st
import intake
import xarray as xr
import cloudpickle
import matplotlib.pyplot as plt
from collections import defaultdict
st.header("Modern `ncview` (of course it's slower!)")