def test_get_df_user_input(): """ Check for input type""" try: data_compile.get_df_user(1) raise Exception() except TypeError: pass try: data_compile.get_df_user('text') raise Exception() except TypeError: pass
def test_get_df_user_edge_cases(): """ Check for edge cases""" edge_cases = [ path + '/samples/empty.txt', path + '/samples/less_than_4.txt' ] try: data_compile.get_df_user([edge_cases[0]]) raise Exception() except ValueError: pass try: data_compile.get_df_user([edge_cases[1]]) raise Exception() except ValueError: pass
def test_atom_connect_col(): """ Check for existed connect_to column""" # dataframe already have connect_to column [_, test_bond] = data_compile.get_df(path + '/samples/user.txt') test_df = data_compile.get_df_user([path + '/samples/user.txt']) try: data_compile.atom_connect(test_df, test_bond) raise Exception() except ValueError: pass
def test_atom_periodic_number_convert_periodic_col(): """ Check for existed periodic number column""" # dataframe already have periodic column test_df = data_compile.get_df_user([path + '/samples/user.txt']) try: data_compile.atom_periodic_number_convert(test_df) raise Exception() except ValueError: pass
from optimol import data_compile import pandas as pd import os print('testing') id_list = data_compile.get_id() print(id_list) # print(os.getcwd()) user_set = data_compile.get_df_user(['user.txt']) # print(user_set) # this give the dataframes from database using the id data = data_compile.get_df_database(id_list[34]) for item in data: print(item) user_set = data_compile.get_df_user(['user.txt']) print(user_set)