Skip to content

Instantly share code, notes, and snippets.

View michaelaye's full-sized avatar

Michael Aye michaelaye

View GitHub Profile
"""Custom quartodoc renderer that adds GitHub source links to documentation.
This renderer extends quartodoc's MdRenderer to add [source] links that point
to the corresponding GitHub file and line numbers for functions and classes.
Usage in _quarto.yml:
quartodoc:
renderer:
style: _renderer.py
repo_url: https://github.com/michaelaye/planetarypy

Polygon Storage Format in ISIS Cube Files

Summary

The polygon footprint data in the ISIS cube file hirise40.cal.map.cub is stored as ASCII text in WKT (Well-Known Text) format, not as binary data.

Input Data

The example cube file hirise40.cal.map.cub was created from the following HiRISE data processing pipeline:

@michaelaye
michaelaye / gist:1d6bf02a95f07a8bb85e5620b18fc33b
Last active November 20, 2025 16:52
Terminal output from creating a 3.14 conda env with geopandas and rioxarray
❯ conda create -n py314geo python=3.14 geopandas rioxarray 2>|gh gist create --public
Channels:
- conda-forge
Platform: osx-arm64
Collecting package metadata (repodata.json): done
Solving environment: failed
LibMambaUnsatisfiableError: Encountered problems while solving:
- nothing provides _python_rc needed by python-3.14.0rc1-h6ea10a9_2_cp314t
$PATH:
/Users/maye/miniforge3/envs/py313/bin
/Users/maye/miniforge3/condabin
/Users/maye/.cargo/bin
/Users/maye/miniforge3/envs/isis/bin
/Users/maye/miniforge3/condabin
/Users/maye/.pixi/bin
/opt/homebrew/bin
/opt/whalebrew/bin
/Users/maye/.local/bin

title: How to MyST, without being mystified 🧙 subject: Tutorial subtitle: Evolve your markdown documents into structured data short_title: How to MyST authors:

  • name: Rowan Cockett affiliations:
    • Executable Books
  • Curvenote
@michaelaye
michaelaye / matplotlib_polar_log.py
Created September 11, 2024 14:09
example from claude for log polar plot...
import numpy as np
import matplotlib.pyplot as plt
from matplotlib.colors import LogNorm # Add this import
# Generate some sample data
np.random.seed(42)
angles = np.random.uniform(0, 2*np.pi, 1000)
radii = np.random.normal(5, 1, 1000)
# Create a polar subplot
@michaelaye
michaelaye / shell.txt
Created November 1, 2022 09:51
Espanso cargo compile error
[1 million of these cargo warnings (more than my terminal cache allows]
cargo:warning= 657 | class WXDLLIMPEXP_FWD_CORE wxKeyEvent;
cargo:warning= | ^~~~~~~~~~
cargo:warning=src/sys/form/form.cpp:315:9: error: invalid use of incomplete type ‘class wxKeyEvent’
cargo:warning= 315 | event.Skip();
cargo:warning= | ^~~~~
cargo:warning=In file included from /usr/include/wx-3.0/wx/wx.h:24,
cargo:warning= from src/sys/form/../common/common.h:27,
cargo:warning= from src/sys/form/form.cpp:22:
cargo:warning=/usr/include/wx-3.0/wx/event.h:657:28: note: forward declaration of ‘class wxKeyEvent’
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@michaelaye
michaelaye / create_env_file.py
Last active September 8, 2022 15:17
Create environment.yml from nbdev settings.ini
from configparser import ConfigParser
import subprocess
config = ConfigParser(delimiters=["="])
config.read("settings.ini")
cfg = config["DEFAULT"]
requirements = cfg.get("requirements", "").split()
with open("environment.yml", "w") as f:
f.write("name: testenv\n")
@michaelaye
michaelaye / conda_env_export.py
Created October 22, 2021 23:28 — forked from michael-ford/conda_env_export.py
Export a Conda environment with --from-history, but also append Pip-installed dependencies
"""
Export a Conda environment with --from-history, but also append
Pip-installed dependencies
Exports only manually-installed dependencies, excluding build versions, but
including Pip-installed dependencies.
Lots of issues requesting this functionality in the Conda issue tracker, no
sign of progress (as of March 2020).