Skip to content

Commit

Permalink
refactor and clean up imports
Browse files Browse the repository at this point in the history
  • Loading branch information
apriltuesday committed Feb 16, 2024
1 parent 9b5aef9 commit a1f20e0
Show file tree
Hide file tree
Showing 12 changed files with 409 additions and 435 deletions.
9 changes: 3 additions & 6 deletions eva_sub_cli/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,11 @@
import csv
import os
from ebi_eva_common_pyutils.config import WritableConfig
from ebi_eva_common_pyutils.logger import logging_config

from eva_sub_cli import SUB_CLI_CONFIG_FILE, __version__
from eva_sub_cli.validators.docker_validator import DockerValidator
from eva_sub_cli.validators.native_validator import NativeValidator
from eva_sub_cli.reporter import READY_FOR_SUBMISSION_TO_EVA
from eva_sub_cli.validators.validator import READY_FOR_SUBMISSION_TO_EVA
from eva_sub_cli.submit import StudySubmitter

VALIDATE = 'validate'
Expand Down Expand Up @@ -58,14 +57,12 @@ def orchestrate_process(submission_dir, vcf_files_mapping, vcf_files, assembly_f
if executor == DOCKER:
with DockerValidator(vcf_files_mapping, submission_dir, metadata_json, metadata_xlsx,
submission_config=sub_config) as validator:
validator.validate()
validator.report()
validator.validate_and_report()
# default to native execution
else:
with NativeValidator(vcf_files_mapping, submission_dir, metadata_json, metadata_xlsx,
submission_config=sub_config) as validator:
validator.validate()
validator.report()
validator.validate_and_report()
if SUBMIT in tasks:
with StudySubmitter(submission_dir, vcf_files, metadata_file, submission_config=sub_config,
username=username, password=password) as submitter:
Expand Down
396 changes: 0 additions & 396 deletions eva_sub_cli/reporter.py

This file was deleted.

2 changes: 1 addition & 1 deletion eva_sub_cli/submit.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

from eva_sub_cli import SUB_CLI_CONFIG_FILE, __version__, SUBMISSION_WS_VAR
from eva_sub_cli.auth import get_auth
from eva_sub_cli.reporter import READY_FOR_SUBMISSION_TO_EVA
from eva_sub_cli.validators.validator import READY_FOR_SUBMISSION_TO_EVA

SUB_CLI_CONFIG_KEY_SUBMISSION_ID = "submission_id"
SUB_CLI_CONFIG_KEY_SUBMISSION_UPLOAD_URL = "submission_upload_url"
Expand Down
1 change: 0 additions & 1 deletion eva_sub_cli/validators/docker_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,6 @@ def get_docker_validation_cmd(self):
return docker_cmd

def run_docker_validator(self):
self.verify_files_present()
# check if docker container is ready for running validation
self.verify_docker_env()

Expand Down
3 changes: 1 addition & 2 deletions eva_sub_cli/validators/native_validator.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,10 @@ def __init__(self, mapping_file, output_dir, metadata_json=None, metadata_xlsx=N
self.assembly_checker_path = assembly_checker_path
self.biovalidator_path = biovalidator_path

def validate(self):
def _validate(self):
self.run_validator()

def run_validator(self):
self.verify_files_present()
self.verify_executables_installed()
try:
command = self.get_validation_cmd()
Expand Down
Loading

0 comments on commit a1f20e0

Please sign in to comment.