Skip to content

Instantly share code, notes, and snippets.

@jreadey
jreadey / msgpack.ipynb
Created April 10, 2024 11:56
msgpack try
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jreadey
jreadey / query_update_example.ipynb
Created March 12, 2024 15:07
Example of using the h5pyd query update method
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jreadey
jreadey / query_select_example.ipynb
Created March 12, 2024 15:05
Example of using the h5pyd table query method
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jreadey
jreadey / request_sel.py
Last active March 7, 2024 22:22
Send a DN request to HSDS
import requests
params = {
's3path': 's3://nrel-pds-sup3rcc/test/sup3rcc_conus_ecearth3_ssp585_r1i1p1f1_pressure_2017.h5',
's3offset': 41943916408,
's3size': 2000000,
'bucket': 'nrel-pds-hsds-dev',
'select': '[0:760,67:68]'
}
@jreadey
jreadey / nrel_smoke_test.py
Created March 6, 2024 17:14
nrel hsload smoke test
import sys
import h5pyd as h5py
h5path = "windspeed_10m"
tgt_row = 1234567
if len(sys.argv) == 1 or sys.argv[1] in ("-h", "--help"):
print(f"usage: {sys.argv[0]} <domain>")
sys.exit(1)
@jreadey
jreadey / nrel_ex.ipynb
Created December 13, 2023 02:56
access NREL NSRDB data
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jreadey
jreadey / nsrdb_full_disc_check.ipynb
Created November 10, 2023 19:10
nsrdb_full_disc_check.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jreadey
jreadey / bitshuffle_try.ipynb
Created November 8, 2023 04:57
Try out bitshuffle filter
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@jreadey
jreadey / gist:30749af72f70a5b914b33dedba878e6b
Created September 18, 2023 20:35
process_pool_reader.py
import h5pyd
import time
from concurrent.futures import ProcessPoolExecutor
test_file = "/home/test_user1/snp500_link.h5"
h5path = "/dset"
max_workers = 20
search_key = b'AAPL'
f = h5pyd.File(test_file)
import h5py
import h5pyd
import numpy as np
try:
import s3fs
S3FS_IMPORT = True
except ImportError:
S3FS_IMPORT = False
import sys
import os