Skip to content
This repository has been archived by the owner on Sep 7, 2022. It is now read-only.

Commit

Permalink
Update cli.py
Browse files Browse the repository at this point in the history
  • Loading branch information
cthoyt committed Nov 20, 2018
1 parent ceaf63e commit d99b09a
Showing 1 changed file with 15 additions and 16 deletions.
31 changes: 15 additions & 16 deletions src/biokeen/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,23 +7,23 @@
from collections import OrderedDict

import click

import pykeen
from bio2bel.constants import get_global_connection
from biokeen.build import ensure_compath, ensure_drugbank, ensure_hippie, iterate_source_paths
from biokeen.cli_utils.bio_2_bel_utils import install_bio2bel_module
from biokeen.cli_utils.cli_print_msg_helper import print_intro, print_welcome_message
from biokeen.cli_utils.cli_query_helper import select_database
from pykeen.cli import (
_configure_evaluation_specific_parameters, device_prompt, execution_mode_specific_prompt, model_selection_prompt,
output_direc_prompt, training_file_prompt,
random_seed_prompt)
prompt_device, prompt_embedding_model, prompt_evaluation_parameters, prompt_execution_parameters,
prompt_output_directory, prompt_random_seed, prompt_training_file,
)
from pykeen.constants import EXECUTION_MODE, HPO_MODE, TRAINING_MODE, TRAINING_SET_PATH
from pykeen.predict import start_predictions_piepline
from pykeen.utilities.cli_utils.cli_print_msg_helper import (
print_execution_mode_message, print_section_divider, print_training_set_message,
)

from biokeen.build import ensure_compath, ensure_drugbank, ensure_hippie, iterate_source_paths
from biokeen.cli_utils.bio_2_bel_utils import install_bio2bel_module
from biokeen.cli_utils.cli_print_msg_helper import print_intro, print_welcome_message
from biokeen.cli_utils.cli_query_helper import select_database

connection_option = click.option(
'-c',
'--connection',
Expand Down Expand Up @@ -53,7 +53,7 @@ def prompt_config(connection, rebuild):
config[TRAINING_SET_PATH] = install_bio2bel_module(name=database_name, connection=connection, rebuild=rebuild)
else:
print_training_set_message()
config = training_file_prompt(config)
prompt_training_file(config)

print_section_divider()

Expand All @@ -67,27 +67,27 @@ def prompt_config(connection, rebuild):
print_section_divider()

# Step 4: Ask for model
model_name = model_selection_prompt()
model_name = prompt_embedding_model()
print_section_divider()

# Step 5: Query parameters depending on the selected execution mode
config = execution_mode_specific_prompt(config=config, model_name=model_name)
prompt_execution_parameters(config=config, model_name=model_name)
print_section_divider()

config.update(_configure_evaluation_specific_parameters(config[EXECUTION_MODE]))
prompt_evaluation_parameters(config)

print_section_divider()

# Step 6: Please select a random seed
config = random_seed_prompt(config=config)
prompt_random_seed(config)
print_section_divider()

# Step 7: Query device to train on
config = device_prompt(config=config)
prompt_device(config)
print_section_divider()

# Step 8: Define output directory
config = output_direc_prompt(config=config)
prompt_output_directory(config)
print_section_divider()

return config
Expand All @@ -104,7 +104,6 @@ def main(): # noqa: D401
@click.option('-r', '--rebuild', is_flag=True)
def start(config, connection, rebuild):
"""Start BioKEEN pipeline."""

if config is None:
config = prompt_config(connection, rebuild)
else:
Expand Down

0 comments on commit d99b09a

Please sign in to comment.