Code Monkey home page Code Monkey logo

Comments (7)

aaronspring avatar aaronspring commented on May 27, 2024 2

maybe we just leave this. probably this should rather be addressed in xskillscore

from climpred.

aaronspring avatar aaronspring commented on May 27, 2024 1

When running pytest we quite a few warnings. Should get rid of those if possible. Some of them are I guess only based on some \s for latex style docstrings but others come from the metrics.

from climpred.

aaronspring avatar aaronspring commented on May 27, 2024

very often I get this kind of warning. I guess it happens always when we have a nan masked grid cell and then divide by that. also happens for pearson_r and all the compute skills

from climpred.

aaronspring avatar aaronspring commented on May 27, 2024

this Nan warning happens inside xskillscore.pearson_r when applying it to masked values (land grid cells for ocean output.)

from climpred.

bradyrx avatar bradyrx commented on May 27, 2024

There's a suggestion here for how to handle it: https://stackoverflow.com/questions/29688168/mean-nanmean-and-warning-mean-of-empty-slice

This suggests to only wrap places you know you'll get the warning, e.g.

# I expect to see RuntimeWarnings in this block
with warnings.catch_warnings():
    warnings.simplefilter("ignore", category=RuntimeWarning)
    foo = np.nanmean(x, axis=1)

Although I could see this becoming messy to put everywhere. Or perhaps we have a decorator we can put around pearson_r and other stats wrappers.

from climpred.

aaronspring avatar aaronspring commented on May 27, 2024

a nicer and also probabily more performant way would be to only apply the metric when the inputs are not nan. the result is also nan, but to mask the area where the metric will be applied. dont know how thats possible but we did something similar for predictability_horizon

from climpred.

bradyrx avatar bradyrx commented on May 27, 2024

You could replace NaNs with -999 or something, then after the fact re-replace them with NaN.

from climpred.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.