Skip to content

Implement a rex backend for xarray (rexarray) #192

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 74 commits into from
Apr 2, 2025
Merged
Show file tree
Hide file tree
Changes from 61 commits
Commits
Show all changes
74 commits
Select commit Hold shift + click to select a range
1ccd031
[WIP] Crude first pass of backend implementation
ppinchuk Feb 3, 2025
8417942
Add data
ppinchuk Feb 3, 2025
6fc9507
Add init module
ppinchuk Feb 3, 2025
8b9da95
Register backend
ppinchuk Feb 3, 2025
f551a05
[WIP] Add tests
ppinchuk Feb 3, 2025
1aae855
Add `xarray` req
ppinchuk Feb 3, 2025
faa9a23
Add package data
ppinchuk Feb 3, 2025
de4151b
Add min version to xarray req
ppinchuk Feb 3, 2025
f36bb7c
Update version string
ppinchuk Feb 3, 2025
0f899d8
Add dask as a req
ppinchuk Feb 4, 2025
95a9edf
Fix segfault
ppinchuk Feb 4, 2025
2b6a7f6
Better detect dimensions
ppinchuk Feb 4, 2025
ef5824f
Add test for dims
ppinchuk Feb 4, 2025
b8a019b
Add `rex_unscale` function
ppinchuk Feb 4, 2025
f3050a7
Use `rex_unscale`
ppinchuk Feb 4, 2025
fdafb69
Python 3.9 compat
ppinchuk Feb 26, 2025
458c0b5
Update reqs
ppinchuk Feb 26, 2025
1b1054a
Python 3.9 fix
ppinchuk Feb 26, 2025
1c2022f
Custom ds loading so that close method is set properly
ppinchuk Feb 26, 2025
952200b
Add tests for closing mf ds
ppinchuk Feb 26, 2025
9d86aad
Minor updates
ppinchuk Feb 26, 2025
61a923f
Add test
ppinchuk Feb 26, 2025
228a445
Add docstrings
ppinchuk Feb 27, 2025
370d095
Add xarray tests
ppinchuk Feb 27, 2025
348677e
Add fsspec (S3) support
ppinchuk Feb 27, 2025
1184111
Remove deprecated arg
ppinchuk Feb 27, 2025
5e204e6
Use `open_mfdataset`
ppinchuk Feb 27, 2025
6f6c77c
Minor formatting
ppinchuk Feb 27, 2025
b2961c4
Fix s3 tests
ppinchuk Feb 27, 2025
350d0d0
Fix tests
ppinchuk Feb 27, 2025
95b7f67
Python 3.9 fix
ppinchuk Feb 27, 2025
3306ad1
Use existing ds
ppinchuk Feb 27, 2025
fa7492e
Remove unused code
ppinchuk Feb 27, 2025
a45c808
Support hsds
ppinchuk Feb 27, 2025
bc7d31f
Add xarray tests
ppinchuk Feb 27, 2025
8dda21f
Don't need to store hsds var
ppinchuk Feb 27, 2025
308d7dd
coordinates not take precedent over meta
ppinchuk Feb 27, 2025
5717511
Add coords test
ppinchuk Feb 27, 2025
80d2c2d
Bump version
ppinchuk Feb 27, 2025
66a82f7
Merge remote-tracking branch 'origin/main' into pp/rexarray
ppinchuk Feb 27, 2025
99a61cc
Use backward-compatible syntax
ppinchuk Feb 27, 2025
ffe2e73
Support data trees
ppinchuk Feb 27, 2025
e55b058
tests for data trees
ppinchuk Feb 27, 2025
362f4d6
Add logger
ppinchuk Feb 27, 2025
b39d952
Python 3.9 compat
ppinchuk Feb 27, 2025
19d12f3
Fix skip conditions
ppinchuk Feb 27, 2025
df15362
Add some utility funcs
ppinchuk Feb 27, 2025
62b019d
More utility funcs
ppinchuk Feb 27, 2025
f54b247
Use new utility functions
ppinchuk Feb 27, 2025
1df3009
Cleanup part 1
ppinchuk Feb 27, 2025
2d72d85
More cleanup
ppinchuk Feb 27, 2025
bb1edc0
More cleanup
ppinchuk Feb 28, 2025
b958526
More cleanup
ppinchuk Feb 28, 2025
9321598
More cleanup
ppinchuk Feb 28, 2025
d1174e2
Add test for overwriting attrs
ppinchuk Feb 28, 2025
85e1392
Linter fix
ppinchuk Feb 28, 2025
490573d
Formatting
ppinchuk Feb 28, 2025
233fb1a
Reformat
ppinchuk Feb 28, 2025
b0a6687
Linter fixes
ppinchuk Feb 28, 2025
305f15e
Add nsrdb attrs
ppinchuk Feb 28, 2025
d31116f
Fix test
ppinchuk Feb 28, 2025
24c501b
Fix typo
ppinchuk Mar 4, 2025
4378b31
Remove bad name
ppinchuk Mar 21, 2025
2ef9fdc
Add guards for dask req
ppinchuk Mar 21, 2025
9a8911b
Merge functions
ppinchuk Mar 21, 2025
10e882c
Add `filename_from_h5pyd` function
ppinchuk Apr 1, 2025
eb80b8d
Add test for multiple files
ppinchuk Apr 1, 2025
b2bd8ed
Add `open_mfdataset_hsds` implementation
ppinchuk Apr 1, 2025
9dd880c
Rename dimension
ppinchuk Apr 1, 2025
94039ef
`fsspec` now a core req
ppinchuk Apr 1, 2025
bc02b6a
Fix for windows
ppinchuk Apr 2, 2025
8c9f953
ensure that rexarray can open mf hsds with list input
grantbuster Apr 2, 2025
b057a12
docstrings
grantbuster Apr 2, 2025
47ff8c1
Merge pull request #204 from NREL/gb/xr_hsds_list
grantbuster Apr 2, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
click>=7.0
dask
h5py>=2.10.0,!=3.0.0
h5pyd>=0.18.0
numpy>=1.16
Expand All @@ -9,3 +10,4 @@ scikit-learn>=1.3
scipy>=1.3
toml>=0.10.0
packaging
xarray>=2024.07.0
Empty file added rex/external/__init__.py
Empty file.
135 changes: 135 additions & 0 deletions rex/external/encondings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
{
"air_temperature": {
"dtype": "i2",
"scale_factor": 0.1
},
"alpha": {
"dtype": "u1",
"scale_factor": 0.01
},
"aod": {
"dtype": "u2",
"scale_factor": 0.001
},
"asymmetry": {
"dtype": "i1",
"scale_factor": 0.01
},
"cld_opd_dcomp": {
"dtype": "u2",
"scale_factor": 0.01
},
"cld_press_acha": {
"dtype": "u2",
"scale_factor": 1
},
"cld_reff_dcomp": {
"dtype": "u2",
"scale_factor": 0.01
},
"clearsky_dhi": {
"dtype": "u2",
"scale_factor": 1
},
"clearsky_dni": {
"dtype": "u2",
"scale_factor": 1
},
"clearsky_ghi": {
"dtype": "u2",
"scale_factor": 1
},
"cloud_fill_flag": {
"dtype": "u1",
"scale_factor": 1
},
"cloud_type": {
"dtype": "i1",
"scale_factor": 1
},
"dew_point": {
"dtype": "i2",
"scale_factor": 0.1
},
"dhi": {
"dtype": "u2",
"scale_factor": 1
},
"dni": {
"dtype": "u2",
"scale_factor": 1
},
"fill_flag": {
"dtype": "u1",
"scale_factor": 1
},
"ghi": {
"dtype": "u2",
"scale_factor": 1
},
"inversemoninobukhovlength": {
"dtype": "i2",
"scale_factor": 0.01
},
"ozone": {
"dtype": "u2",
"scale_factor": 0.001
},
"precipitationrate": {
"dtype": "u2",
"scale_factor": 0.1
},
"pressure": {
"dtype": "u2",
"scale_factor": 10
},
"relativehumidity": {
"dtype": "u2",
"scale_factor": 0.01
},
"relative_humidity": {
"dtype": "i1",
"scale_factor": 0.01
},

"solar_zenith_angle": {
"dtype": "u2",
"scale_factor": 0.01
},
"ssa": {
"dtype": "u1",
"scale_factor": 0.01
},
"surface_albedo": {
"dtype": "u1",
"scale_factor": 0.01
},
"surface_pressure": {
"dtype": "u2",
"scale_factor": 1
},
"temperature": {
"dtype": "i2",
"scale_factor": 0.01
},
"total_precipitable_water": {
"dtype": "u1",
"scale_factor": 0.1
},
"winddirection": {
"dtype": "u2",
"scale_factor": 0.01
},
"wind_direction": {
"dtype": "u2",
"scale_factor": 0.01
},
"windspeed": {
"dtype": "u2",
"scale_factor": 0.01
},
"wind_speed": {
"dtype": "u2",
"scale_factor": 0.01
}
}
Loading