Skip to content

Commit 6ee6622

Browse files
committed
revert yaml
1 parent 3b4d93f commit 6ee6622

File tree

2 files changed

+11
-29
lines changed

2 files changed

+11
-29
lines changed

.pre-commit-config.yaml

Lines changed: 5 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -4,49 +4,27 @@ repos:
44
- id: black
55
name: black
66
entry: black
7-
language: python
7+
language: system
88
types: [python]
99
require_serial: true
1010
- id: check-added-large-files
1111
name: Check for added large files
1212
entry: check-added-large-files
13-
language: python
13+
language: system
1414
- id: check-toml
1515
name: Check Toml
1616
entry: check-toml
17-
language: python
17+
language: system
1818
types: [toml]
1919
- id: check-yaml
2020
name: Check Yaml
2121
entry: check-yaml
22-
language: python
22+
language: system
2323
types: [yaml]
2424
- id: end-of-file-fixer
2525
name: Fix End of Files
2626
entry: end-of-file-fixer
27-
language: python
28-
types: [text]
29-
stages: [pre-commit, pre-push, manual]
30-
exclude: docs/
31-
- id: flake8
32-
name: flake8
33-
entry: flake8
34-
language: python
35-
types: [python]
36-
require_serial: true
37-
args:
38-
- --ignore=D212,W503,C901
39-
- id: pyupgrade
40-
name: pyupgrade
41-
description: Automatically upgrade syntax for newer versions.
42-
entry: pyupgrade
43-
language: python
44-
types: [python]
45-
args: [--py39-plus, --keep-runtime-typing]
46-
- id: trailing-whitespace
47-
name: Trim Trailing Whitespace
48-
entry: trailing-whitespace-fixer
49-
language: python
27+
language: system
5028
types: [text]
5129
stages: [pre-commit, pre-push, manual]
5230
exclude: docs/

drevalpy/experiment.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"""Main module for running the drug response prediction experiment."""
22

3+
import importlib
34
import json
45
import os
56
import shutil
@@ -17,6 +18,11 @@
1718
from .models.drp_model import DRPModel
1819
from .pipeline_function import pipeline_function
1920

21+
if importlib.util.find_spec("ray"):
22+
import ray
23+
else:
24+
ray = None
25+
2026

2127
def drug_response_experiment(
2228
models: list[type[DRPModel]],
@@ -1038,8 +1044,6 @@ def hpam_tune_raytune(
10381044
:param path_data: path to the data directory, e.g., data/
10391045
:returns: best hyperparameters
10401046
"""
1041-
import ray
1042-
10431047
if len(hpam_set) == 1:
10441048
return hpam_set[0]
10451049
ray.init(_temp_dir=os.path.join(os.path.expanduser("~"), "raytmp"))

0 commit comments

Comments
 (0)