Commit c996bd82 authored by thecml's avatar thecml
Browse files

removed client

parent 44e162df
"""
client.py
====================================
A command line application that can create various datasets for AIR.
"""
import argparse
import paths as pt
from src.data import (load_and_clean_data,
make_screening_data,
make_alarm_data,
make_dataset_full,
make_dataset_count,
make_dataset_emb,
make_dataset_ohe,
make_dataset_ordinal)
def str2bool(v):
if isinstance(v, bool):
return v
if v.lower() in ('yes', 'true', 't', 'y', '1'):
return True
elif v.lower() in ('no', 'false', 'f', 'n', '0'):
return False
else:
raise argparse.ArgumentTypeError('Boolean value expected.')
def parse_arguments():
parser = argparse.ArgumentParser(description='A command line application that' +
' can create various datasets for AIR.')
parser.add_argument('--dataset-version', type=str, default="emb",
choices=['emb', 'ohe', 'count', 'ordinal'],
help='string indicating dataset version')
return parser.parse_args()
def main():
parsed_args = parse_arguments()
dataset_version = parsed_args.dataset_version
print(f"Client started. Using this configuration:")
print(f"Raw data dictionary: {pt.RAW_DATA_DIR_2021}")
print(f"Dataset version: {dataset_version}")
print("Now parsing and cleaning data ...")
load_and_clean_data.main()
print("Making screenings ...")
make_screening_data.main()
print("Making full dataset ...")
make_dataset_full.main()
print("Making alarm dataset ...")
make_alarm_data.main()
if dataset_version == "emb":
print("Making dataset with embedded ats ...")
make_dataset_emb.main()
elif dataset_version == "ohe":
print("Making dataset with one-hot-encoded ats ...")
make_dataset_ohe.main()
elif dataset_version == "count":
print("Making dataset with ats columns as counts ...")
make_dataset_count.main()
else:
print("Making dataset with ats columns as ordinal values ...")
make_dataset_ordinal.main()
print("\nCompleted generating datasets at:")
print(f"Interim data dictionary: {pt.INTERIM_DATA_DIR}")
print(f"Processed data dictionary: {pt.PROCESSED_DATA_DIR}\n")
if __name__ == "__main__":
main()
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment