def _compute_and_check(self, dataset_pool): if has_this_method(self, "pre_check"): self.debug.print_debug("Running pre_check() for " + self.__class__.__module__,4) self.pre_check(dataset_pool) else: self.debug.print_debug("No pre_check() defined for " + self.__class__.__module__,4) values = self.compute(dataset_pool) if has_this_method(self, "post_check"): self.debug.print_debug("Running post_check() for " + self.__class__.__module__,4) self.post_check(values, dataset_pool) else: self.debug.print_debug("No post_check() defined for " + self.__class__.__module__,4) return values
def _compute_and_check(self, dataset_pool): if has_this_method(self, "pre_check"): self.debug.print_debug( "Running pre_check() for " + self.__class__.__module__, 4) self.pre_check(dataset_pool) else: self.debug.print_debug( "No pre_check() defined for " + self.__class__.__module__, 4) values = self.compute(dataset_pool) if has_this_method(self, "post_check"): self.debug.print_debug( "Running post_check() for " + self.__class__.__module__, 4) self.post_check(values, dataset_pool) else: self.debug.print_debug( "No post_check() defined for " + self.__class__.__module__, 4) return values
def get_dependencies(self): """Return variables and attributes needed to compute this variable. This is returned as a list of tuples where the first element is the name of the particular dataset and the second element is the variable name. It does not work through the dependencies tree. """ if has_this_method(self, "dependencies"): return self.dependencies() return []
def get_dependencies(self): """Return variables and attributes needed to compute this variable. This is returned as a list of tuples where the first element is the name of the particular dataset and the second element is the variable name. It does not work through the dependencies tree. """ dependencies = [] if has_this_method(self, "dependencies"): dependencies = self.dependencies() parser = LagVariableParser() for i in range(len(dependencies)): variable_name = dependencies[i] dependencies[i] = parser.add_this_lag_offset_to_this_short_name(variable_name, self.lag_offset) return dependencies
def get_dependencies(self): """Return variables and attributes needed to compute this variable. This is returned as a list of tuples where the first element is the name of the particular dataset and the second element is the variable name. It does not work through the dependencies tree. """ dependencies = [] if has_this_method(self, "dependencies"): dependencies = self.dependencies() parser = LagVariableParser() for i in range(len(dependencies)): variable_name = dependencies[i] dependencies[ i] = parser.add_this_lag_offset_to_this_short_name( variable_name, self.lag_offset) return dependencies