Пример #1
0
    def prepare_for_model_run(self, model_time):
        if self.wind is None:
            msg = "wind object not defined for " + self.__class__.__name__
            raise ReferencedObjectNotSet(msg)

        if self.water is None:
            msg = "water object not defined for " + self.__class__.__name__
            raise ReferencedObjectNotSet(msg)
Пример #2
0
    def prepare_for_model_run(self, _model_time):
        if self.wind is None:
            raise ReferencedObjectNotSet("wind object not defined for {}"
                                         .format(self.__class__.__name__))

        if self.water is None:
            raise ReferencedObjectNotSet("water object not defined for {}"
                                         .format(self.__class__.__name__))
Пример #3
0
    def prepare_for_model_run(self):
        '''
        if wind attribute is not set, raise ReferencedObjectNotSet excpetion
        '''
        super(WindMover, self).prepare_for_model_run()

        if self.on and self.wind is None:
            msg = "wind object not defined for WindMover"
            raise ReferencedObjectNotSet(msg)
Пример #4
0
    def prepare_for_model_run(self, model_time):
        """
        Make sure we are up to date with the referenced time series
        """
        if self.wind is None:
            msg = "wind object not defined for WindMover"
            raise ReferencedObjectNotSet(msg)

        model_time = date_to_sec(model_time)

        self.create_running_average_timeseries(self._past_hours_to_average,
                                               model_time)
Пример #5
0
 def prepare_for_model_run(self, sc):
     """
     Override for weatherers so they can initialize correct 'mass_balance'
     key and set initial value to 0.0
     """
     if self.on:
         # almost all weatherers require wind, water, waves so raise
         # exception here if none is found
         for attr in ('wind', 'water', 'waves'):
             if hasattr(self, attr) and getattr(self, attr) is None:
                 msg = (attr + " object not defined for " +
                        self.__class__.__name__)
                 raise ReferencedObjectNotSet(msg)