Skip to content

Commit

Permalink
Feat/ray bump (#47)
Browse files Browse the repository at this point in the history
* fix ray requirements

* update `node_id`

* fix the `dock` runner too

* fix `screen.py`
  • Loading branch information
davidegraff authored Dec 14, 2022
1 parent 80e2a3c commit df22914
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 6 deletions.
4 changes: 2 additions & 2 deletions environment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ dependencies:
- python=3.8
- openbabel
- openmm
- rdkit
- pip:
- colorama
- configargparse
- h5py
- numpy
- ray
- ray[default]>=2.0
- rdkit
- pandas
- scikit_learn
- scipy
Expand Down
3 changes: 2 additions & 1 deletion pyscreener/docking/dock/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,8 @@ def run(sim: Simulation) -> Optional[List[float]]:
scores = DOCKRunner.parse_logfile(logfile)
score = None if scores is None else reduce_scores(scores, sim.reduction, k=sim.k)

sim.result = Result(sim.smi, name, re.sub("[:,.]", "", ray.state.current_node_id()), score)
node_id = re.sub("[:,.]", "", ray.util.get_node_ip_address())
sim.result = Result(sim.smi, name, node_id, score)

return scores

Expand Down
2 changes: 1 addition & 1 deletion pyscreener/docking/screen.py
Original file line number Diff line number Diff line change
Expand Up @@ -313,7 +313,7 @@ def collect_files(self, path: Optional[Union[str, Path]] = None):
out_path = Path(path or self.path)
out_path.mkdir(parents=True, exist_ok=True)

output_id = re.sub(r"[:,.]", "", ray.state.current_node_id())
output_id = re.sub(r"[:,.]", "", ray.util.get_node_ip_address())
tmp_tar = (self.tmp_dir / output_id).with_suffix(".tar.gz")

with tarfile.open(tmp_tar, "w:gz") as tar:
Expand Down
3 changes: 2 additions & 1 deletion pyscreener/docking/vina/runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,8 @@ def run(sim: Simulation) -> Optional[List[float]]:
else:
score = utils.reduce_scores(np.array(scores), sim.reduction, k=sim.k)

sim.result = Result(sim.smi, name, re.sub("[:,.]", "", ray.state.current_node_id()), score)
node_id = re.sub("[:,.]", "", ray.util.get_node_ip_address())
sim.result = Result(sim.smi, name, node_id, score)

return scores

Expand Down
2 changes: 1 addition & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ install_requires =
numpy
pandas
pdbfixer
ray[default]
ray[default]>=2.0
scipy
tqdm

Expand Down

0 comments on commit df22914

Please sign in to comment.