Пример #1
0
def _validate(start, k_ar, dates, method):
    """
    Checks the date and then returns an integer
    """
    from datetime import datetime
    if isinstance(start, (basestring, datetime)):
        start_date = start
        start = _index_date(start, dates)
    if 'mle' not in method and start < k_ar:
        raise ValueError("Start must be >= k_ar for conditional MLE or "
                "dynamic forecast. Got %s" % start_date)
Пример #2
0
def _validate(start, k_ar, dates, method):
    """
    Checks the date and then returns an integer
    """
    from datetime import datetime
    if isinstance(start, (string_types, datetime)):
        start_date = start
        start = _index_date(start, dates)
    if 'mle' not in method and start < k_ar:
        raise ValueError("Start must be >= k_ar for conditional MLE or "
                         "dynamic forecast. Got %s" % start_date)
    return start