Skip to content

Commit 45de907

Browse files
committed
Merge branch '1.8.0' into py310
2 parents 72d5cb8 + de14203 commit 45de907

File tree

6 files changed

+36
-7
lines changed

6 files changed

+36
-7
lines changed

.github/workflows/lint.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ jobs:
1010
python-version: ["3.9"]
1111

1212
steps:
13+
- name: Update apt cache
14+
run: |
15+
sudo apt-get update || sudo apt-get update --fix-missing
1316
- name: System Dependencies
1417
run: |
1518
sudo apt install -y build-essential \

.github/workflows/pytest.yml

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ jobs:
1818
steps:
1919
- name: System Dependencies
2020
run: |
21+
sudo apt-get update
2122
sudo apt install -y build-essential \
2223
libcairo2-dev \
2324
pkg-config \
@@ -47,8 +48,8 @@ jobs:
4748
- name: pytest
4849
run: |
4950
# python3.9 -m pytest --capture=sys --capture=fd --cov=atomsci/ -vv atomsci/ddm/test/unit
50-
python3.9 -m pytest --capture=sys --capture=fd --cov=atomsci/ -vv atomsci/modac/test/unit
51-
cd atomsci/ddm/test/unit && python3.9 -m pytest -n 2 --capture=sys --capture=fd --cov=atomsci -vv
51+
cd atomsci/modac/test/unit && python3.9 -m pytest --capture=sys --capture=fd --cov=atomsci/ -vv
52+
cd ../../../../atomsci/ddm/test/unit && python3.9 -m pytest -m "not moe_required" -n 2 --capture=sys --capture=fd --cov=atomsci -vv
5253
env:
5354
ENV: test
5455

@@ -64,6 +65,7 @@ jobs:
6465
steps:
6566
- name: System Dependencies
6667
run: |
68+
sudo apt-get update
6769
sudo apt install -y build-essential \
6870
libcairo2-dev \
6971
pkg-config \
@@ -110,6 +112,7 @@ jobs:
110112
steps:
111113
- name: System Dependencies
112114
run: |
115+
sudo apt-get update
113116
sudo apt install -y build-essential \
114117
libcairo2-dev \
115118
pkg-config \
@@ -139,8 +142,8 @@ jobs:
139142
- name: pytest
140143
run: |
141144
# TODO: Run this test with pytest for paralell testing
142-
# python3.9 -m pytest -n 2 --capture=sys --capture=fd --cov=atomsci -vv atomsci/ddm/test/integrative
143145
cd atomsci/ddm/test/integrative && ./integrative_batch_chunk_tests 1
146+
echo 'done'
144147
env:
145148
ENV: test
146149

@@ -156,6 +159,7 @@ jobs:
156159
steps:
157160
- name: System Dependencies
158161
run: |
162+
sudo apt-get update
159163
sudo apt install -y build-essential \
160164
libcairo2-dev \
161165
pkg-config \
@@ -202,6 +206,7 @@ jobs:
202206
steps:
203207
- name: System Dependencies
204208
run: |
209+
sudo apt-get update
205210
sudo apt install -y build-essential \
206211
libcairo2-dev \
207212
pkg-config \

atomsci/ddm/pipeline/model_wrapper.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1491,7 +1491,6 @@ def train(self, pipeline):
14911491
em = perf.EpochManager(self,
14921492
prediction_type="hybrid",
14931493
model_dataset=pipeline.data,
1494-
transformers=self.transformers,
14951494
is_ki=self.params.is_ki,
14961495
production=self.params.production,
14971496
ki_convert_ratio=self.params.ki_convert_ratio)
@@ -1532,7 +1531,7 @@ def train(self, pipeline):
15321531
valid_loss_ep /= (valid_data.n_ki + valid_data.n_bind)
15331532

15341533
train_perf, valid_perf, test_perf = em.update_epoch(ei,
1535-
train_dset=train_dset, valid_dset=valid_dset, test_dset=test_dset, fold='final')
1534+
train_dset=train_dset, valid_dset=valid_dset, test_dset=test_dset)
15361535

15371536
self.log.info("Epoch %d: training %s = %.3f, training loss = %.3f, validation %s = %.3f, validation loss = %.3f, test %s = %.3f" % (
15381537
ei, pipeline.metric_type, train_perf, train_loss_ep, pipeline.metric_type, valid_perf, valid_loss_ep,

atomsci/ddm/test/integrative/hybrid/test_hybrid.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,26 @@ def clean():
2020
if os.path.isfile("./output/"+f):
2121
os.remove("./output/"+f)
2222

23+
def test_is_hybrid():
24+
"""Test to see of the model pipeline is built correctly"""
25+
with open("H1_hybrid.json", "r") as f:
26+
hp_params = json.load(f)
27+
28+
script_dir = parse.__file__.strip("parameter_parser.py").replace("/pipeline/", "")
29+
python_path = sys.executable
30+
hp_params["script_dir"] = script_dir
31+
hp_params["python_path"] = python_path
32+
hp_params["descriptor_type"] = "rdkit_raw"
33+
34+
params = parse.wrapper(hp_params)
35+
if not os.path.isfile(params.dataset_key):
36+
params.dataset_key = os.path.join(params.script_dir, params.dataset_key)
37+
38+
print("Train a hybrid models with MOE descriptors")
39+
pl = mp.ModelPipeline(params)
40+
41+
assert pl.params.model_type == 'hybrid'
42+
2343
@pytest.mark.moe_required
2444
def test():
2545
"""Test full model pipeline: Curate data, fit model, and predict property for new compounds"""

atomsci/ddm/test/integrative/integrative_batch_chunk_tests

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ for folder in "${folders[@]}"; do
4141
if [[ -f "$file" && "$folder" != "__pycache__/" ]]; then
4242
cd "$folder"
4343
echo "Testing $folder"
44-
pytest --capture=sys --capture=fd --cov=atomsci -vv
44+
pytest -m "not moe_required" --capture=sys --capture=fd --cov=atomsci -vv
4545
cd ..
4646
else
4747
echo "Skipping folder: $folder. Not a test directory."

atomsci/ddm/test/integrative/wenzel_NN/config_wenzel_fit_NN.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@
3535

3636
"comment": "Results",
3737
"comment": "----------------------------------------",
38-
"result_dir": "result"
38+
"result_dir": "result",
39+
40+
"seed":0
3941
}
4042

0 commit comments

Comments
 (0)