Giter Site home page Giter Site logo

tamsat_alert's People

Contributors

guygriffiths avatar rossmaidment avatar emilyblack avatar

Watchers

James Cloos avatar  avatar Helen Greatrex avatar  avatar

Forkers

aklilu

tamsat_alert's Issues

Cryptic error when no data area is selected

When running tamsat_alert.tamsat_alert() in a region where there is no data (i.e. all values are NaN), the error given is:

/usr/lib/python3/dist-packages/scipy/stats/_distn_infrastructure.py:1838: RuntimeWarning: invalid value encountered in multiply
  lower_bound = self.a * scale + loc
/usr/lib/python3/dist-packages/scipy/stats/_distn_infrastructure.py:1839: RuntimeWarning: invalid value encountered in multiply
  upper_bound = self.b * scale + loc
/usr/lib/python3/dist-packages/scipy/stats/_distn_infrastructure.py:1663: RuntimeWarning: invalid value encountered in double_scalars
  x = np.asarray((x - loc)/scale, dtype=dtyp)
/usr/lib/python3/dist-packages/matplotlib/axes/_axes.py:6016: RuntimeWarning: divide by zero encountered in true_divide
  m = (m.astype(float) / db) / m.sum()
/usr/lib/python3/dist-packages/matplotlib/axes/_axes.py:6016: RuntimeWarning: invalid value encountered in true_divide
  m = (m.astype(float) / db) / m.sum()
/usr/lib/python3/dist-packages/matplotlib/mlab.py:1587: RuntimeWarning: divide by zero encountered in double_scalars
  return 1./(np.sqrt(2*np.pi)*sigma)*np.exp(-0.5 * (1./sigma*(x - mu))**2)
/usr/lib/python3/dist-packages/matplotlib/mlab.py:1587: RuntimeWarning: invalid value encountered in multiply
  return 1./(np.sqrt(2*np.pi)*sigma)*np.exp(-0.5 * (1./sigma*(x - mu))**2)
/usr/lib/python3/dist-packages/matplotlib/axes/_base.py:2787: UserWarning: Attempting to set identical left==right results
in singular transformations; automatically expanding.
left=0.0, right=0.0
  'left=%s, right=%s') % (left, right))

This should ideally throw an exception describing the underlying issue (i.e. the data parameter contains no data)

Undocumented parameters to tamsat_alert()

The parameters precipitation_rate_str and temperature_str are not documented, despite being arguments to tamsat_alert(). It's not entirely clear, but it looks like the precipitation_rate_str refers to the name of the variable used for precipitation (i.e. rfe - rainfall estimate), not actually the precipitation rate.

met_ts_varname is not enforced

Although the documentation states that met_ts_varname must be either "precipitation" or "temperature", this is not checked, and the code will fail with:

    112     if met_ts_varname == "temperature":
    113         tmp = fc_data[temperature_str]
--> 114     fc_data_no_leaps = strip_leap_days(tmp)
    115 
    116     # Remove leap years from data

UnboundLocalError: local variable 'tmp' referenced before assignment

rather than a more meaningful error message.

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.