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

Test raise if compute #224

Merged
merged 18 commits into from Jan 12, 2021
Merged

Conversation

ahuang11
Copy link
Member

@ahuang11 ahuang11 commented Nov 14, 2020

#218

I moved the check for negative values in weights under np apply_ufunc

        # Throw error if there are negative weights.
        if weights.min() < 0:
            raise ValueError(
                "Weights has a minimum below 0. Please submit a weights array "
                "of positive numbers."
            )

@@ -51,8 +77,9 @@ def test_skipna_returns_same_value_as_dropped_pairwise_nans(a_1d_nan, b_1d_nan,
"""Tests that DataArrays with pairwise nans return the same result
as the same two with those nans dropped."""
a_dropped, b_dropped, _ = drop_nans(a_1d_nan, b_1d_nan)
res_with_nans = metric(a_1d_nan, b_1d_nan, "time", skipna=True)
res_dropped_nans = metric(a_dropped, b_dropped, "time")
with raise_if_dask_computes():
Copy link
Collaborator

Choose a reason for hiding this comment

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

thats a nice one. could be implemented allover the package

Comment on lines 57 to 58
# return a dummy context manager so
# that this can be used for non-dask objects
Copy link
Collaborator

Choose a reason for hiding this comment

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

If I'm being nit-picky, you should change this to a """ docstring for style.

@bradyrx
Copy link
Collaborator

bradyrx commented Dec 6, 2020

Looks like some trailing whitespace issues from doc8 as well. I think we got rid of doc8 at climpred because it's kind of a nuisance and rst style isn't as important to us.

@aaronspring
Copy link
Collaborator

Same here. What’s the status?

@aaronspring aaronspring mentioned this pull request Jan 8, 2021
4 tasks
@ahuang11
Copy link
Member Author

ahuang11 commented Jan 9, 2021

Not sure what this means

Fix End of Files.........................................................Failed
- hook id: end-of-file-fixer
- exit code: 1
- files were modified by this hook

Fixing docs/source/api/xskillscore.Contingency.rst

@aaronspring
Copy link
Collaborator

Some listing thing. I usually just git add and pre-commit again

@@ -46,3 +46,4 @@
~Contingency.observation_category_edges
~Contingency.observations
~Contingency.table

Copy link
Member

Choose a reason for hiding this comment

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

Remove this line. Probably git added this by mistake

@raybellwaves
Copy link
Member

Think you need to rebase again to pick up #234 for example

@ahuang11
Copy link
Member Author

I don't think so; when I pull and push it says everything up to date...

@raybellwaves
Copy link
Member

Sorry for the testing here. Looks like I finally got it on the last one.

Probably still best if you merge my PR ahuang11#1

@ahuang11
Copy link
Member Author

Feel free to do whichever.

@raybellwaves
Copy link
Member

I thought I could merge PR in your repo but I can't. I think I can push to the branch though

@raybellwaves raybellwaves merged commit 7f04738 into xarray-contrib:master Jan 12, 2021
@raybellwaves
Copy link
Member

Thanks @ahuang11

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.

None yet

4 participants