Skip to content
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

Gb/bc debug #232

Merged
merged 9 commits into from
Oct 21, 2024
Merged

Gb/bc debug #232

merged 9 commits into from
Oct 21, 2024

Conversation

grantbuster
Copy link
Member

No description provided.

@grantbuster grantbuster marked this pull request as ready for review October 17, 2024 19:44
@grantbuster grantbuster requested a review from bnb32 October 17, 2024 19:44
…dataset() which will default to a dask array manager if chunks is specified and load into memory as numpy arrays in chunks is None.
Copy link
Collaborator

@bnb32 bnb32 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I reverted the last commit in the chunks=None PR so feel free to merge that in. After that this all looks good to me.

@@ -232,7 +232,7 @@ def pre_load(self):
recommended to improve performance with the new sup3r data handler
access patterns"""
super().pre_load()
if hasattr(self.bias_fut_dh.data, 'compute'):
if hasattr(self.bias_fut_dh, 'compute'):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Needing to account for the rex handlers not having a data attribute is another reason to default to using the Loaders eventually. This will also allow us to remove the pre load methods that just check if theres a compute method or not (aka rex handler or sup3r handler)



@pytest.mark.parametrize('compute', (False, True))
def test_sup3rdataset_slicing(compute):
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good test, thanks!

>>> xds = xr.Dataset(...)
>>> ds = Sup3rDataset(hourly=xds)
>>> ds.hourly # returns Sup3rX object
>>> ds[feature] # returns a single dataarray
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good additions. The Sup3rX vs Sup3rDataset stuff is the most complicated part of the refactor imo but looks like it didn't take too long to figure out.

@grantbuster grantbuster merged commit f864740 into bnb/dh_refactor Oct 21, 2024
2 of 7 checks passed
@grantbuster grantbuster deleted the gb/bc_debug branch October 21, 2024 20:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants