How to use the a2ml.api.azure.exceptions.AzureException function in a2ml

To help you get started, we’ve selected a few a2ml examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github augerai / a2ml / a2ml / api / azure / model.py View on Github external
def _get_experiment(self):
        from azureml.core import Experiment
        from .project import AzureProject

        ws = AzureProject(self.ctx)._get_ws()
        experiment_name = self.ctx.config.get('experiment/name', None)
        if experiment_name is None:
            raise AzureException('Please specify Experiment name...')
        experiment = Experiment(ws, experiment_name)

        return ws, experiment
github augerai / a2ml / a2ml / api / azure / project.py View on Github external
def _get_name(self, name = None):
        if name is None:
            name =  self.ctx.config.get('name', None)
        if name is None:
            raise AzureException('Please provide project name...')
        return name
github augerai / a2ml / a2ml / api / azure / credentials.py View on Github external
def verify(self):
        if self.ctx.config.get('use_server'):
            if not self.subscription_id or \
               not self.directory_tenant_id or \
               not self.application_client_id or \
               not self.client_secret:
               raise AzureException('Please provide azure.json file with Azure AD application and service principal.')

        elif self.subscription_id is None:
            raise AzureException('Please provide your credentials to Azure...')

        return True
github augerai / a2ml / a2ml / api / azure / experiment.py View on Github external
def history(self):
        ws = AzureProject(self.ctx)._get_ws()
        experiment_name = self.ctx.config.get('experiment/name', None)
        if experiment_name is None:
            raise AzureException('Please specify Experiment name...')
        experiment = Experiment(ws, experiment_name)
        runs = Run.list(experiment)
        result = []
        for run in runs:
            details = run.get_details()
            st = dt.datetime.strptime(
                details['startTimeUtc'], '%Y-%m-%dT%H:%M:%S.%fZ')
            et = dt.datetime.strptime(
                details['endTimeUtc'], '%Y-%m-%dT%H:%M:%S.%fZ')
            duratin = str(et-st)
            result.append({
                'id': run.id,
                'start time': details['startTimeUtc'],
                'duratin': duratin,
                'status': details['status']
            })
github augerai / a2ml / a2ml / api / azure / credentials.py View on Github external
def verify(self):
        if self.ctx.config.get('use_server'):
            if not self.subscription_id or \
               not self.directory_tenant_id or \
               not self.application_client_id or \
               not self.client_secret:
               raise AzureException('Please provide azure.json file with Azure AD application and service principal.')

        elif self.subscription_id is None:
            raise AzureException('Please provide your credentials to Azure...')

        return True
github augerai / a2ml / a2ml / api / azure / experiment.py View on Github external
def start(self):
        model_type = self.ctx.config.get('model_type')
        if not model_type:
            raise AzureException('Please specify model type...')
        primary_metric = self.ctx.config.get(
            'experiment/metric','spearman_correlation')
        if not primary_metric:
            raise AzureException('Please specify primary metric...')
        #TODO: check if primary_metric is constent with model_type
        target = self.ctx.config.get('target')
        if not target:
            raise AzureException('Please specify target column...')

        dataset_name = self.ctx.config.get('dataset', None)
        if dataset_name is None:
            raise AzureException('Please specify Dataset name...')
        experiment_name = self._fix_experiment_name(
            self.ctx.config.get('experiment/name', dataset_name))
        cluster_name = self._fix_cluster_name(
            self.ctx.config.get('cluster/name', 'cpucluster'))
github augerai / a2ml / a2ml / api / azure / dataset.py View on Github external
def delete(self, name = None):
        ws = self._get_ws()
        if name is None:
            name = self.ctx.config.get('dataset', None)
        if name is None:
            raise AzureException('Please specify dataset name...')
        ds = Dataset.get_by_name(ws, name)
        ds.unregister_all_versions()
        self._select(None, False)
        self.ctx.log('Deleted dataset %s' % name)
        return {'deleted': name}