# Path: rvic/core/share.py
# TIMEUNITS = 'days since ' + REFERENCE_STRING  # do not change (MUST BE DAYS)!
# 
# SECSPERDAY = HOURSPERDAY * SECSPERHOUR
# 
# MINSPERDAY = HOURSPERDAY * MINSPERHOUR
# 
# HOURSPERDAY = 24.
# 
# TIMESTAMPFORM = '%Y-%m-%d-%H'
# 
# Path: rvic/core/log.py
# LOG_NAME = 'rvic'


import numpy as np
from netCDF4 import num2date, date2num
from datetime import datetime
from dateutil.relativedelta import relativedelta
from .share import TIMEUNITS, SECSPERDAY, MINSPERDAY, HOURSPERDAY, \
    TIMESTAMPFORM
from logging import getLogger
from .log import LOG_NAME
            if (self.timesteps * self.dt / SECSPERDAY) % self.rest_n == 0.0:
                flag = True
        elif self.rest_option == 'nsecond':
            if (self.timesteps * self.dt / SECSPERDAY) >= self.rest_n:
                flag = True
        elif self.rest_option == 'nminutes':
            if (self.timesteps * self.dt / MINSPERDAY) % self.rest_n == 0.0:
                flag = True
        elif self.rest_option == 'nminute':
            if (self.timesteps * self.dt / MINSPERDAY) >= self.rest_n:
                flag = True
        elif self.rest_option == 'nhours':
            if (self.timesteps * self.dt / HOURSPERDAY) % self.rest_n == 0.0:
                flag = True
        elif self.rest_option == 'nhour':
            if (self.timesteps * self.dt / HOURSPERDAY) >= self.rest_n:
                flag = True
        elif self.rest_option == 'ndays':
            if (self.timesteps * self.dt) % self.rest_n == 0.0:
                flag = True
        elif self.rest_option == 'nday':
            if (self.timesteps * self.dt) >= self.rest_n:
                flag = True
        elif self.rest_option == 'nmonths':
            temp = ord_to_datetime(self.time_ord + self.dt, TIMEUNITS,
                                   calendar=self.calendar)
            if relativedelta(temp,
                             self.start_date).months % self.rest_n == 0.0:
                flag = True
        elif self.rest_option == 'nmonth':

# Path: rvic/core/share.py
# TIMEUNITS = 'days since ' + REFERENCE_STRING  # do not change (MUST BE DAYS)!
# 
# SECSPERDAY = HOURSPERDAY * SECSPERHOUR
# 
# MINSPERDAY = HOURSPERDAY * MINSPERHOUR
# 
# HOURSPERDAY = 24.
# 
# TIMESTAMPFORM = '%Y-%m-%d-%H'
# 
# Path: rvic/core/log.py
# LOG_NAME = 'rvic'


# Path: rvic/core/time_utility.py
import numpy as np
from netCDF4 import num2date, date2num
from datetime import datetime
from dateutil.relativedelta import relativedelta
from .share import TIMEUNITS, SECSPERDAY, MINSPERDAY, HOURSPERDAY, \
    TIMESTAMPFORM
from logging import getLogger
from .log import LOG_NAME

            if (self.timesteps * self.dt / SECSPERDAY) % self.rest_n == 0.0:
                flag = True
        elif self.rest_option == 'nsecond':
            if (self.timesteps * self.dt / SECSPERDAY) >= self.rest_n:
                flag = True
        elif self.rest_option == 'nminutes':
            if (self.timesteps * self.dt / MINSPERDAY) % self.rest_n == 0.0:
                flag = True
        elif self.rest_option == 'nminute':
            if (self.timesteps * self.dt / MINSPERDAY) >= self.rest_n:
                flag = True
        elif self.rest_option == 'nhours':
            if (self.timesteps * self.dt / HOURSPERDAY) % self.rest_n == 0.0:
                flag = True
        elif self.rest_option == 'nhour':
            if (self.timesteps * self.dt / HOURSPERDAY) >= self.rest_n:
                flag = True
        elif self.rest_option == 'ndays':
            if (self.timesteps * self.dt) % self.rest_n == 0.0:
                flag = True
        elif self.rest_option == 'nday':
            if (self.timesteps * self.dt) >= self.rest_n:
                flag = True
        elif self.rest_option == 'nmonths':
            temp = ord_to_datetime(self.time_ord + self.dt, TIMEUNITS,
                                   calendar=self.calendar)
            if relativedelta(temp,
                             self.start_date).months % self.rest_n == 0.0:
                flag = True
        elif self.rest_option == 'nmonth':

            temp = ord_to_datetime(self.time_ord + self.dt, TIMEUNITS,