def model_is_ready(self, model, **kwargs): """Checks whether a model's status is FINISHED. """ check_resource_type(model, MODEL_PATH, message="A model id is needed.") resource = self.get_model(model, **kwargs) return resource_is_ready(resource)
def source_is_ready(self, source): """Checks whether a source' status is FINISHED. """ check_resource_type(source, SOURCE_PATH, message="A source id is needed.") source = self.get_source(source) return resource_is_ready(source)
def dataset_is_ready(self, dataset): """Check whether a dataset' status is FINISHED. """ check_resource_type(dataset, DATASET_PATH, message="A dataset id is needed.") resource = self.get_dataset(dataset) return resource_is_ready(resource)
def pca_is_ready(self, pca, **kwargs): """Checks whether a pca's status is FINISHED. """ check_resource_type(pca, PCA_PATH, message="A PCA id is needed.") resource = self.get_pca(pca, **kwargs) return resource_is_ready(resource)
def anomaly_is_ready(self, anomaly, **kwargs): """Checks whether an anomaly detector's status is FINISHED. """ check_resource_type(anomaly, ANOMALY_PATH, message="An anomaly id is needed.") resource = self.get_anomaly(anomaly, **kwargs) return resource_is_ready(resource)
def topic_model_is_ready(self, topic_model, **kwargs): """Checks whether a topic model's status is FINISHED. """ check_resource_type(topic_model, TOPIC_MODEL_PATH, message="A topic model id is needed.") resource = self.get_topic_model(topic_model, **kwargs) return resource_is_ready(resource)
def lda_is_ready(self, lda, **kwargs): """Checks whether an LDA's status is FINISHED. """ check_resource_type(lda, LDA_PATH, message="An LDA id is needed.") resource = self.get_lda(lda, **kwargs) return resource_is_ready(resource)
def fusion_is_ready(self, fusion, **kwargs): """Checks whether a fusion's status is FINISHED. """ check_resource_type(fusion, FUSION_PATH, message="A fusion id is needed.") resource = self.get_fusion(fusion, **kwargs) return resource_is_ready(resource)
def cluster_is_ready(self, cluster, **kwargs): """Checks whether a cluster's status is FINISHED. """ check_resource_type(cluster, CLUSTER_PATH, message="A cluster id is needed.") resource = self.get_cluster(cluster, **kwargs) return resource_is_ready(resource)
def time_series_is_ready(self, time_series, **kwargs): """Checks whether a time series's status is FINISHED. """ check_resource_type(time_series, TIME_SERIES_PATH, message="A time series id is needed.") resource = self.get_time_series(time_series, **kwargs) return resource_is_ready(resource)
def linear_regression_is_ready(self, linear_regression, **kwargs): """Checks whether a linear regressioin's status is FINISHED. """ check_resource_type(linear_regression, LINEAR_REGRESSION_PATH, message="A linear regression id is needed.") resource = self.get_linear_regression(linear_regression, **kwargs) return resource_is_ready(resource)
def deepnet_is_ready(self, deepnet, **kwargs): """Checks whether a deepnet's status is FINISHED. """ check_resource_type(deepnet, DEEPNET_PATH, message="A deepnet id is needed.") resource = self.get_deepnet(deepnet, **kwargs) return resource_is_ready(resource)
def ensemble_is_ready(self, ensemble): """Checks whether a ensemble's status is FINISHED. """ check_resource_type(ensemble, ENSEMBLE_PATH, message="An ensemble id is needed.") resource = self.get_ensemble(ensemble) return resource_is_ready(resource)
def logistic_regression_is_ready(self, logistic_regression, **kwargs): """Checks whether a logistic regressioin's status is FINISHED. """ check_resource_type(logistic_regression, LOGISTIC_REGRESSION_PATH, message="A logistic regression id is needed.") resource = self.get_logistic_regression(logistic_regression, **kwargs) return resource_is_ready(resource)
def optiml_is_ready(self, optiml, **kwargs): """Checks whether an optiml's status is FINISHED. """ check_resource_type(optiml, OPTIML_PATH, message="An optiml id is needed.") resource = self.get_optiml(optiml, **kwargs) return resource_is_ready(resource)
def lacks_info(model, inner_key="model"): """Whether the information in `model` is not enough to use it locally """ try: return not (resource_is_ready(model) and \ check_model_structure(model, inner_key) and \ check_model_fields(model)) except Exception: return True