MCPcopy Create free account
hub / github.com/codemeta/codemeta / aggregate

Function aggregate

scripts/aggregate.py:59–73  ·  view source on GitHub ↗

Get all columns from properties_description.csv and files in crosswalks/, and concatenates them; returning a list of columns.

()

Source from the content-addressed store, hash-verified

57 return sorted(os.listdir(SOURCE_DIR))
58
59def aggregate():
60 """Get all columns from properties_description.csv and files in
61 crosswalks/, and concatenates them; returning a list of columns."""
62
63 # Get the three left-most columns from properties_description.csv
64 with open(PROP_DESC_PATH) as fd:
65 prop_desc = columns_from_rows(csv.reader(fd))
66
67 # Get the other columns, one per .csv file in crosswalks/
68 columns = []
69 for filename in list_crosswalks():
70 if filename.endswith('.csv'):
71 columns.append(read_terms(prop_desc, filename))
72
73 return prop_desc + columns
74
75def rm_file(filename):
76 """Removes a file if it exists, does nothing otherwise."""

Callers 1

mainFunction · 0.85

Calls 3

columns_from_rowsFunction · 0.85
list_crosswalksFunction · 0.85
read_termsFunction · 0.85

Tested by

no test coverage detected