Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/pytest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,8 @@ jobs:
- name: pytest
run: |
# python3.9 -m pytest --capture=sys --capture=fd --cov=atomsci/ -vv atomsci/ddm/test/unit
python3.9 -m pytest --capture=sys --capture=fd --cov=atomsci/ -vv atomsci/modac/test/unit
cd atomsci/ddm/test/unit && python3.9 -m pytest -n 2 --capture=sys --capture=fd --cov=atomsci -vv
cd atomsci/modac/test/unit && python3.9 -m pytest --capture=sys --capture=fd --cov=atomsci/ -vv
cd ../../../../atomsci/ddm/test/unit && python3.9 -m pytest -m "not moe_required" -n 2 --capture=sys --capture=fd --cov=atomsci -vv
env:
ENV: test

Expand Down Expand Up @@ -139,8 +139,8 @@ jobs:
- name: pytest
run: |
# TODO: Run this test with pytest for paralell testing
# python3.9 -m pytest -n 2 --capture=sys --capture=fd --cov=atomsci -vv atomsci/ddm/test/integrative
cd atomsci/ddm/test/integrative && ./integrative_batch_chunk_tests 1
echo 'done'
env:
ENV: test

Expand Down
3 changes: 1 addition & 2 deletions atomsci/ddm/pipeline/model_wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -1491,7 +1491,6 @@ def train(self, pipeline):
em = perf.EpochManager(self,
prediction_type="hybrid",
model_dataset=pipeline.data,
transformers=self.transformers,
is_ki=self.params.is_ki,
production=self.params.production,
ki_convert_ratio=self.params.ki_convert_ratio)
Expand Down Expand Up @@ -1532,7 +1531,7 @@ def train(self, pipeline):
valid_loss_ep /= (valid_data.n_ki + valid_data.n_bind)

train_perf, valid_perf, test_perf = em.update_epoch(ei,
train_dset=train_dset, valid_dset=valid_dset, test_dset=test_dset, fold='final')
train_dset=train_dset, valid_dset=valid_dset, test_dset=test_dset)

self.log.info("Epoch %d: training %s = %.3f, training loss = %.3f, validation %s = %.3f, validation loss = %.3f, test %s = %.3f" % (
ei, pipeline.metric_type, train_perf, train_loss_ep, pipeline.metric_type, valid_perf, valid_loss_ep,
Expand Down
20 changes: 20 additions & 0 deletions atomsci/ddm/test/integrative/hybrid/test_hybrid.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,26 @@ def clean():
if os.path.isfile("./output/"+f):
os.remove("./output/"+f)

def test_is_hybrid():
"""Test to see of the model pipeline is built correctly"""
with open("H1_hybrid.json", "r") as f:
hp_params = json.load(f)

script_dir = parse.__file__.strip("parameter_parser.py").replace("/pipeline/", "")
python_path = sys.executable
hp_params["script_dir"] = script_dir
hp_params["python_path"] = python_path
hp_params["descriptor_type"] = "rdkit_raw"

params = parse.wrapper(hp_params)
if not os.path.isfile(params.dataset_key):
params.dataset_key = os.path.join(params.script_dir, params.dataset_key)

print("Train a hybrid models with MOE descriptors")
pl = mp.ModelPipeline(params)

assert pl.params.model_type == 'hybrid'

@pytest.mark.moe_required
def test():
"""Test full model pipeline: Curate data, fit model, and predict property for new compounds"""
Expand Down
2 changes: 1 addition & 1 deletion atomsci/ddm/test/integrative/integrative_batch_chunk_tests
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ for folder in "${folders[@]}"; do
if [[ -f "$file" && "$folder" != "__pycache__/" ]]; then
cd "$folder"
echo "Testing $folder"
pytest --capture=sys --capture=fd --cov=atomsci -vv
pytest -m "not moe_required" --capture=sys --capture=fd --cov=atomsci -vv
cd ..
else
echo "Skipping folder: $folder. Not a test directory."
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@

"comment": "Results",
"comment": "----------------------------------------",
"result_dir": "result"
"result_dir": "result",

"seed":0
}

Loading