From e41dbaab8f22e3ba26dc798e1bc9ed801928930f Mon Sep 17 00:00:00 2001 From: ale94mleon Date: Sun, 17 Jul 2022 20:34:22 +0200 Subject: [PATCH] extra changes --- conda/moldrug/script.py | 30 ------------------------------ moldrug/_version.py | 4 ++-- moldrug/data/config_yaml.py | 8 ++++---- tests/test_moldrug.py | 2 +- 4 files changed, 7 insertions(+), 37 deletions(-) delete mode 100644 conda/moldrug/script.py diff --git a/conda/moldrug/script.py b/conda/moldrug/script.py deleted file mode 100644 index fdd6410..0000000 --- a/conda/moldrug/script.py +++ /dev/null @@ -1,30 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- -import subprocess, yaml - -def run(command:str, shell:bool = True, executable:str = '/bin/bash', Popen:bool = False): - """This function is just a useful wrapper around subprocess.Popen, subprocess.run - - Args: - command (str): Any command to execute on Linux - shell (bool, optional): keyword of Popen and Run. Defaults to True. - executable (str, optional): keyword of Popen and Run. Defaults to '/bin/bash'. - Popen (bool, optional): If True it will launch popen if not Run. Defaults to False. - - Raises: - RuntimeError: In case of non-zero exit status. - - Returns: - object: the processes returned by Popen or Run. - """ - if Popen: - #In this case you could acces the pid as: run.pid - process = subprocess.Popen(command, shell = shell, executable = executable, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text = True) - else: - process = subprocess.run(command, shell = shell, executable = executable, stdout=subprocess.PIPE, stderr=subprocess.PIPE, text = True) - returncode = process.returncode - if returncode != 0: - print(f'Command {command} returned non-zero exit status {returncode}') - raise RuntimeError(process.stderr) - return process - diff --git a/moldrug/_version.py b/moldrug/_version.py index 9a54edc..6e5f8b5 100644 --- a/moldrug/_version.py +++ b/moldrug/_version.py @@ -1,5 +1,5 @@ # coding: utf-8 # file generated by setuptools_scm # don't change, don't track in version control -__version__ = version = '0.0.1b9.post1.dev0' -__version_tuple__ = version_tuple = (0, 0, 1, 'dev0') +__version__ = version = '0.0.1b9.post1.dev22' +__version_tuple__ = version_tuple = (0, 0, 1, 'dev22') diff --git a/moldrug/data/config_yaml.py b/moldrug/data/config_yaml.py index 94a7c41..d47e736 100644 --- a/moldrug/data/config_yaml.py +++ b/moldrug/data/config_yaml.py @@ -3,7 +3,7 @@ r_x0161 = """ main: type: GA - njobs: 3 + njobs: 2 seed_smiles: COC(=O)C=1C=CC(=CC1)S(=O)(=O)N costfunc: Cost costfunc_kwargs: @@ -18,11 +18,11 @@ - 22.5 - 22.5 exhaustiveness: 4 - ncores: 4 + ncores: 6 num_modes: 1 crem_db_path: /home/ale/GITLAB/bi_crem_database/replacements02_sc2.5.db - maxiter: 10 - popsize: 10 + maxiter: 2 + popsize: 2 beta: 0.001 pc: 1 get_similar: False diff --git a/tests/test_moldrug.py b/tests/test_moldrug.py index 13a2c7f..502c5fa 100644 --- a/tests/test_moldrug.py +++ b/tests/test_moldrug.py @@ -2,7 +2,7 @@ # -*- coding: utf-8 -*- from rdkit import Chem from moldrug import utils, fitness -from moldrug.data import receptors, ligands, boxes +from moldrug.data import receptors, ligands, boxes, config_yaml import tempfile, os, gzip, shutil, requests from multiprocessing import cpu_count