featureforge icon indicating copy to clipboard operation
featureforge copied to clipboard

in stats manager, booking_duration=None is not supported

Open francolq opened this issue 8 years ago • 1 comments

This code from the documentation is not working because of this:

>>> from featureforge.experimentation.stats_manager import StatsManager
>>> sm = StatsManager(None, 'Your-database-name')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/francolq/.virtualenvs/lq-research/local/lib/python2.7/site-packages/featureforge/experimentation/stats_manager.py", line 62, in __init__
    self.booking_delta = timedelta(seconds=booking_duration)
TypeError: unsupported type for timedelta seconds component: NoneType

francolq avatar Apr 15 '16 21:04 francolq

Talking with @jmansilla we have decided to make a change in the StatsManager API. Until now we have: def __init__(self, booking_duration, db_name, db_uri=None, keep_running_on_errors=True)

The idea is move db_name in first place and make booking_duration optional with None as default value. If booking_duration is not provided, it will mean that the booking duration will not be take in count and the ticket cannot be stolen by other process. Finally the new interface: def __init__(self, db_name, booking_duration=None, db_uri=None, keep_running_on_errors=True)

jbigatti avatar Oct 14 '16 14:10 jbigatti