checkint before trying to switch over to datafiles
This commit is contained in:
parent
d41712e010
commit
f45f7b715b
2 changed files with 10 additions and 6 deletions
|
@ -94,8 +94,9 @@ class CourseBuilder:
|
||||||
|
|
||||||
# generate a compound column --query-compound column:sum
|
# generate a compound column --query-compound column:sum
|
||||||
if args.query_compound:
|
if args.query_compound:
|
||||||
print(args.query_compound)
|
# print('{}.sum'.format(args.query_compound))
|
||||||
df_q.loc[:,'form-of-instruction.sum'] = df_q['form-of-instruction'].apply(lambda x: sum(list(x.values())))
|
df_q.loc[:,'{}.sum'.format(args.query_compound)] = df_q[args.query_compound].apply(lambda x: sum(list(x.values())))
|
||||||
|
print(df_q)
|
||||||
|
|
||||||
# --query-sort is parameterized as min:credits - hence direction:column
|
# --query-sort is parameterized as min:credits - hence direction:column
|
||||||
if args.query_sort:
|
if args.query_sort:
|
||||||
|
@ -120,9 +121,9 @@ class CourseBuilder:
|
||||||
# print(mm.format(v=mm))
|
# print(mm.format(v=mm))
|
||||||
|
|
||||||
# lets get crazy to create a summary table!
|
# lets get crazy to create a summary table!
|
||||||
df_summary = pd.DataFrame([{
|
# df_summary = pd.DataFrame([{
|
||||||
'sum.credits': df_q['credits'].sum()
|
# 'sum.credits': df_q['credits'].sum()
|
||||||
}])
|
# }])
|
||||||
|
|
||||||
# set labels directly!
|
# set labels directly!
|
||||||
if args.query_labels:
|
if args.query_labels:
|
||||||
|
@ -132,7 +133,7 @@ class CourseBuilder:
|
||||||
|
|
||||||
print(q_as_md)
|
print(q_as_md)
|
||||||
|
|
||||||
print(df_summary.to_markdown(tablefmt='grid',index=False))
|
# print(df_summary.to_markdown(tablefmt='grid',index=False))
|
||||||
|
|
||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
|
|
|
@ -38,4 +38,7 @@ debug-query:
|
||||||
debug-query-book:
|
debug-query-book:
|
||||||
python ${coursebuilder} -s schema.yaml -b book.yaml -q "kind=='compulsory'" -qs min:credits -qc form-of-instruction -qf name credits form-of-instruction -ql Modulname Kürzel Kreditpunkte
|
python ${coursebuilder} -s schema.yaml -b book.yaml -q "kind=='compulsory'" -qs min:credits -qc form-of-instruction -qf name credits form-of-instruction -ql Modulname Kürzel Kreditpunkte
|
||||||
|
|
||||||
|
debug-query-full:
|
||||||
|
python ${coursebuilder} -s ~/Documents/MaACS/MHB/schema.yaml -b ~/Documents/MaACS/MHB/book.yaml -q "kind=='compulsory_elective'" -qc form-of-instruction -qf name form-of-instruction.sum credits term -ql Modulname SWS Kreditpunkte Semester
|
||||||
|
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue