Skip to content

Commit

Permalink
cleaning up
Browse files Browse the repository at this point in the history
  • Loading branch information
alexkcode committed Mar 6, 2024
1 parent edb7a40 commit d32e8ab
Showing 1 changed file with 0 additions and 22 deletions.
22 changes: 0 additions & 22 deletions tests/data/scripts/create_test_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,26 +28,6 @@ def write_test_sample(reader: csv.reader, writer: csv.writer, property_test_case
if has_prop:
break

def get_test_sample(src_data: pd.DataFrame, property_test_cases: List[str]) -> pd.DataFrame:
# check that all test cases exist at least once in data set
assert len(src_data) > 0
contains_test_cases = []
for p in property_test_cases:
has_related_name = src_data['Property Name'].map(lambda x: True if p in str(x) else False)
contains_test_cases.append(np.any(has_related_name))
assert np.all(contains_test_cases)
test_cases = src_data['Property Name'].str.contains('|'.join(property_test_cases), na=False)
return src_data[test_cases]

def copy_test_data_sample(
test_data: pd.DataFrame,
test_data_file_path: pathlib.Path
) -> pathlib.Path:
if not os.path.exists(test_data_file_path):
os.makedirs(os.path.dirname(test_data_file_path), exist_ok=True)
test_data.to_csv(test_data_file_path, index=False)
return test_data_file_path

def main():
# the first console argument is technically the python script so we skip that
src_arg = sys.argv[1]
Expand All @@ -56,8 +36,6 @@ def main():
src_path = curr_path / src_arg
target_path = curr_path / target_arg

# src_data = get_and_clean_csv(src_path)
# test_data = get_test_sample(src_data, property_test_cases)
csvfile = open(get_src_file_path(src_path), 'r')
src_csv = csv.reader(csvfile)

Expand Down

0 comments on commit d32e8ab

Please sign in to comment.