Skip to content

Instantly share code, notes, and snippets.

View weiji14's full-sized avatar

Wei Ji weiji14

View GitHub Profile
@rwegener2
rwegener2 / h5_cloudaccess.ipynb
Last active August 15, 2023 16:05
Accessing hdf5 data
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@scottyhq
scottyhq / kerchunk-ATL06.ipynb
Created July 28, 2023 00:43
icesat2 atl06 kerchunk
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@ashiklom
ashiklom / my-wget.py
Created December 13, 2022 22:54
EDL "wget" implementation
def wget(url):
import urllib.request
import netrc
import os
import fsspec
import base64
from urllib.parse import urlparse
# Get login credentials
@jli
jli / pinned_conda_and_pip_deps.md
Last active October 15, 2021 13:36
Pinned/versioned Python dependencies when using both conda and pip

Pinned/versioned Python dependencies when using both conda and pip

Problem

It's good to have pinned/versioned dependencies for reproducible builds: https://pythonspeed.com/articles/pipenv-docker/

The conda-lock and pip-compile tools are helpful for this. But, they're not ideal when installing dependencies from both conda and pip because the solvers run independently and may generate inconsistent versions.

@mcroach
mcroach / storing-image-assets-in-repo.md
Last active July 16, 2024 22:19
Using an 'assets' branch to store images in your repo

Storing image assets in your repo and referencing in markdown

Create an assets branch and make the initial commit

git checkout --orphan assets
git reset --hard
cp /path/to/cat.png .
git add .
git commit -m 'Added cat picture'
git push -u origin assets
@travishsu
travishsu / coco2labelme.py
Last active July 19, 2024 01:51
Convert COCO format segmentation annotation to LabelMe format
import os
import json
import subprocess
import numpy as np
import pandas as pd
from skimage.measure import find_contours
class CocoDatasetHandler:
def __init__(self, jsonpath, imgpath):
@ajelenak
ajelenak / h5-to-zarr.py
Last active March 1, 2023 16:04
Python code to extract HDF5 chunk locations and add them to Zarr metadata.
# Requirements:
# HDF5 library version 1.10.5 or later
# h5py version 3.0 or later
# pip install git+https://github.com/HDFGroup/zarr-python.git@hdf5
import logging
from urllib.parse import urlparse, urlunparse
import numpy as np
import h5py
import zarr
@discdiver
discdiver / jupyterlab_shortcuts.md
Last active July 13, 2024 08:55
Common Jupyter Lab Keyboard Shortcuts

If you are on a Mac, substitute command for control. Don't type the + (it means press both keys at once).

Shortcuts when in either command mode (outside the cells) or edit mode (inside a cell):

  • Shift + Enter run selected cell or cells - if no cells below, insert a code cell below

  • Ctrl + B toggle hide/show left sidebar

  • Ctrl + S save and checkpoint

  • Ctrl + Shift + S save as

@scottyhq
scottyhq / atl06-example.ipynb
Created September 26, 2019 03:41
basic loading and visualizing of icesat2 atl06
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@SergiyKolesnikov
SergiyKolesnikov / test_and_debug.ipynb
Last active September 24, 2023 14:54
Testing and Debugging Jupyter Notebooks
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.