def fall_rate(self): w = forecastio.get_weather() if w.get('currently') is None: return FALL_RATE intens = float(w['currently']['precipIntensity']) return FALL_RATE*(1.0+intens)*(0.7+0.3*random.random())
def next_flake(self): w = forecastio.get_weather() if w.get('currently') is None: return FLAKE_PERIOD prob = float(w['currently']['precipProbability']) return FLAKE_PERIOD*(1.1-prob**2)*(1.0+0.1*random.random())