How to use the sos.utils.env function in sos

To help you get started, we’ve selected a few sos 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 vatlab / sos / test / test_r_targets.py View on Github external
def setUp(self):
        env.reset()
        subprocess.call('sos remove -s', shell=True)
        self.temp_files = []
github vatlab / sos / test / test_dag.py View on Github external
def setUp(self):
        env.reset()
        subprocess.call('sos remove -s', shell=True)
        self.temp_files = []
github vatlab / sos / misc / celery / sos_task.py View on Github external
# bioinformatics can be running for long time...
        # let me assume a longest running time of 1 month
        walltime = sos_dict['_runtime']['walltime'] if 'walltime' in sos_dict['_runtime'] else 60*60*24*30

        if isinstance(walltime, str):
            if walltime.count(':') > 2:
                raise ValueError('Incorrect format.')
            try:
                walltime = sum([int(val)*60**idx  for idx, val in enumerate(walltime.split(':')[-1::-1])])
            except Exception:
                raise ValueError('Unacceptable walltime {} (can be "HH:MM:SS" or a number (seconds))'.format(walltime))

        # tell subprocess where pysos.runtime is
        self.proc_results.append(
            self.celery_execute_task.apply_async(
                (task, env.verbosity, env.sig_mode)
            ))
github vatlab / sos / src / sos / jupyter / preview.py View on Github external
    parser.error = lambda msg: env.logger.warning(msg)
    return parser
github stephenslab / dsc / src / __main__.py View on Github external
def __exit__(self, *args):
        self.end = time.time()
        self.secs = self.end - self.start
        self.msecs = self.secs * 1000  # millisecs
        if self.verbose:
            env.logger.info('Elapsed time ``%.03f`` seconds.' % self.secs)
github vatlab / sos / sos / celery / sos_step.py View on Github external
def submit_task(self, task):
        # if concurrent is set, create a pool object
        from .celery import celery_execute_task
        self.proc_results.append(
            celery_execute_task.apply_async(
                (task, env.verbosity, env.sig_mode)
            ))
github vatlab / sos / sos / sos_executor.py View on Github external
def __init__(self, workflow, args=[], config_file=None, nested=False):
        Base_Executor.__init__(self, workflow, args, config_file, nested=nested)
        if hasattr(env, 'accessed_vars'):
            delattr(env, 'accessed_vars')