small update to get better query mode working
This commit is contained in:
parent
ef011cda55
commit
d41712e010
4 changed files with 164 additions and 234 deletions
|
@ -94,6 +94,7 @@ class CourseBuilder:
|
|||
|
||||
# generate a compound column --query-compound column:sum
|
||||
if args.query_compound:
|
||||
print(args.query_compound)
|
||||
df_q.loc[:,'form-of-instruction.sum'] = df_q['form-of-instruction'].apply(lambda x: sum(list(x.values())))
|
||||
|
||||
# --query-sort is parameterized as min:credits - hence direction:column
|
||||
|
@ -112,6 +113,7 @@ class CourseBuilder:
|
|||
# set value transforms
|
||||
if args.query_template:
|
||||
|
||||
# no idea yet how to parameterize this
|
||||
ww = 'written'
|
||||
#df_q['form-of-exam'] = 'Schriftlich' if df_q.loc[:,'form-of-exam'] == 'written' else 'was anderes'
|
||||
# mm = Template("{'written':'S','oral':'mündlich'}[${v}]")?
|
||||
|
@ -122,7 +124,7 @@ class CourseBuilder:
|
|||
'sum.credits': df_q['credits'].sum()
|
||||
}])
|
||||
|
||||
# set labels
|
||||
# set labels directly!
|
||||
if args.query_labels:
|
||||
df_q.columns = args.query_labels
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Concept
|
||||
# concept
|
||||
|
||||
The concept behind coursebuilder is to store curricula descriptions in `YAML` files that can be versioned in a git repository. Unlike classic databases an observable and well defined versioning is paramount in these descriptions as they are the legal foundation for study and exam regulations.
|
||||
The concept behind coursebuilder is to store curricula descriptions in `YAML` files that can be versioned in a git repository. Unlike classic databases, an observable and well defined versioning is paramount in these descriptions as they are the legal foundation for study and exam regulations.
|
||||
|
||||
The following pieces play together here:
|
||||
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
|
||||
# debug make file for testing
|
||||
build_dir := build
|
||||
target_en := ${build_dir}/table.en.pdf
|
||||
target_de := ${build_dir}/table.de.pdf
|
||||
|
|
164
test/schema.yaml
164
test/schema.yaml
|
@ -19,18 +19,13 @@ instructor:
|
|||
de: "Modulverantwortlicher / Modulverantwortliche"
|
||||
en: "module instructor"
|
||||
|
||||
|
||||
#
|
||||
# Kürzel / ID
|
||||
#
|
||||
id:
|
||||
type: str
|
||||
translatable: false
|
||||
label: {
|
||||
de: "Kürzel",
|
||||
en: "code"
|
||||
}
|
||||
|
||||
label: { de: "Kürzel", en: "code" }
|
||||
|
||||
#
|
||||
# Qualifikationsziele
|
||||
|
@ -49,10 +44,7 @@ id:
|
|||
|
||||
goal:
|
||||
type: str
|
||||
label: {
|
||||
de: "Qualifikationsziele",
|
||||
en: "educational goal"
|
||||
}
|
||||
label: { de: "Qualifikationsziele", en: "educational goal" }
|
||||
|
||||
#
|
||||
# Modulinhalte
|
||||
|
@ -65,10 +57,7 @@ goal:
|
|||
|
||||
content:
|
||||
type: str
|
||||
label: {
|
||||
de: "Modulinhalte",
|
||||
en: "content"
|
||||
}
|
||||
label: { de: "Modulinhalte", en: "content" }
|
||||
|
||||
#
|
||||
# Lehrform
|
||||
|
@ -83,35 +72,16 @@ content:
|
|||
#
|
||||
form-of-instruction:
|
||||
type: multikey
|
||||
label: {
|
||||
de: "Lehrform(en)",
|
||||
en: "form of instruction"
|
||||
}
|
||||
keys: {
|
||||
'lecture' : {
|
||||
de: "Vorlesung",
|
||||
en: "lecture"
|
||||
},
|
||||
'lecture_seminar' : {
|
||||
de: "Seminaristische Vorlesung",
|
||||
en: "lecture and seminar"
|
||||
},
|
||||
'seminar' : {
|
||||
de: "Seminar",
|
||||
en: "seminar"
|
||||
},
|
||||
'exersise' : {
|
||||
de: "Übung",
|
||||
en: "lab exersise"
|
||||
},
|
||||
'pc_lab' : {
|
||||
de: "Rechnergestütztes Praktikum",
|
||||
en: "PC exersise"
|
||||
},
|
||||
'project' : {
|
||||
de: "Project",
|
||||
en: "project"
|
||||
}
|
||||
label: { de: "Lehrform(en)", en: "form of instruction" }
|
||||
keys:
|
||||
{
|
||||
"lecture": { de: "Vorlesung", en: "lecture" },
|
||||
"lecture_seminar":
|
||||
{ de: "Seminaristische Vorlesung", en: "lecture and seminar" },
|
||||
"seminar": { de: "Seminar", en: "seminar" },
|
||||
"exersise": { de: "Übung", en: "lab exersise" },
|
||||
"pc_lab": { de: "Rechnergestütztes Praktikum", en: "PC exersise" },
|
||||
"project": { de: "Project", en: "project" },
|
||||
}
|
||||
template:
|
||||
de: "{key} ({value}SWS)"
|
||||
|
@ -130,10 +100,7 @@ form-of-instruction:
|
|||
|
||||
prerequisites:
|
||||
type: str
|
||||
label: {
|
||||
de: "Voraussetzungen für die Teilnahme",
|
||||
en: "prerequisites"
|
||||
}
|
||||
label: { de: "Voraussetzungen für die Teilnahme", en: "prerequisites" }
|
||||
|
||||
#
|
||||
# Literatur und multimediale Lehr- und Lernprogramme
|
||||
|
@ -143,9 +110,10 @@ prerequisites:
|
|||
#
|
||||
teaching-material:
|
||||
type: str
|
||||
label: {
|
||||
label:
|
||||
{
|
||||
de: "Literatur und multimediale Lehr- und Lernprogramme",
|
||||
en: "media of instruction"
|
||||
en: "media of instruction",
|
||||
}
|
||||
|
||||
#
|
||||
|
@ -153,83 +121,60 @@ teaching-material:
|
|||
#
|
||||
author-of-indenture:
|
||||
type: str
|
||||
label: {
|
||||
de: "Lehrbriefautor",
|
||||
en: "author of indenture"
|
||||
}
|
||||
label: { de: "Lehrbriefautor", en: "author of indenture" }
|
||||
|
||||
#
|
||||
# Verwendung in (Studienprogramm)
|
||||
#
|
||||
used-in:
|
||||
type: str
|
||||
label: {
|
||||
de: "Verwendung",
|
||||
en: "used in study programs"
|
||||
}
|
||||
label: { de: "Verwendung", en: "used in study programs" }
|
||||
|
||||
#
|
||||
# Arbeitsaufwand
|
||||
#
|
||||
workload:
|
||||
type: str
|
||||
label: {
|
||||
de: "Arbeitsaufwand / Gesamtworkload",
|
||||
en: "workload"
|
||||
}
|
||||
label: { de: "Arbeitsaufwand / Gesamtworkload", en: "workload" }
|
||||
#
|
||||
# credits/ECTS
|
||||
#
|
||||
credits:
|
||||
type: num
|
||||
unit: ECTS
|
||||
label: {
|
||||
label:
|
||||
{
|
||||
en: "credits and weight of mark",
|
||||
de: "Kreditpunkte und Gewichtung der Note in der Gesamtnote"
|
||||
de: "Kreditpunkte und Gewichtung der Note in der Gesamtnote",
|
||||
}
|
||||
template:
|
||||
de: "{value}CP, Gewichtung: {value}CP von 120CP "
|
||||
en: "{value}CP, weight: {value} / 120 "
|
||||
|
||||
|
||||
#
|
||||
# Leistungsnachweis
|
||||
#
|
||||
form-of-exam:
|
||||
type: enum
|
||||
label: {
|
||||
de: "Leistungsnachweis",
|
||||
en: "form of examination"
|
||||
}
|
||||
values: {
|
||||
'written' : {
|
||||
de: "Schriftliche Prüfung",
|
||||
en: "written exam"
|
||||
},
|
||||
'oral' : {
|
||||
de: "Mündliche Prüfung",
|
||||
en: "oral exam"
|
||||
},
|
||||
'alternative' : {
|
||||
de: "Alternative Prüfungunsleistung",
|
||||
en: "alternative examination"
|
||||
}
|
||||
label: { de: "Leistungsnachweis", en: "form of examination" }
|
||||
values:
|
||||
{
|
||||
"written": { de: "Schriftliche Prüfung", en: "written exam" },
|
||||
"oral": { de: "Mündliche Prüfung", en: "oral exam" },
|
||||
"alternative":
|
||||
{ de: "Alternative Prüfungunsleistung", en: "alternative examination" },
|
||||
}
|
||||
spec: true
|
||||
template:
|
||||
de: "{value} ({spec})"
|
||||
en: "{value} ({spec})"
|
||||
|
||||
|
||||
#
|
||||
# Semester
|
||||
#
|
||||
term:
|
||||
type: multinum
|
||||
label: {
|
||||
de: "Semester",
|
||||
en: "term"
|
||||
}
|
||||
label: { de: "Semester", en: "term" }
|
||||
template:
|
||||
de: "{value}\\. Semester"
|
||||
en: "{value}\\. semester"
|
||||
|
@ -239,19 +184,12 @@ term:
|
|||
#
|
||||
frequency:
|
||||
type: enum
|
||||
label: {
|
||||
de: "Häufigkeit des Angebots",
|
||||
en: "frequency of Offer"
|
||||
}
|
||||
values: {
|
||||
'once_per_term' : {
|
||||
de: "jedes Semester",
|
||||
en: "every semester"
|
||||
},
|
||||
'once_per_year' : {
|
||||
de: "einmal im Studienjahr",
|
||||
en: "once per study year"
|
||||
}
|
||||
label: { de: "Häufigkeit des Angebots", en: "frequency of Offer" }
|
||||
values:
|
||||
{
|
||||
"once_per_term": { de: "jedes Semester", en: "every semester" },
|
||||
"once_per_year":
|
||||
{ de: "einmal im Studienjahr", en: "once per study year" },
|
||||
}
|
||||
|
||||
#
|
||||
|
@ -271,19 +209,15 @@ duration:
|
|||
#
|
||||
kind:
|
||||
type: enum
|
||||
label: {
|
||||
de: 'Art der Veranstaltung (Pflicht, Wahl, etc.)',
|
||||
en: 'kind of module (compulsory, elective)'
|
||||
}
|
||||
values: {
|
||||
'compulsory': {
|
||||
de: "Pflicht",
|
||||
en: "compulsory"
|
||||
},
|
||||
'elective' : {
|
||||
de: "Wahl/Wahlpflicht",
|
||||
en: "elective"
|
||||
label:
|
||||
{
|
||||
de: "Art der Veranstaltung (Pflicht, Wahl, etc.)",
|
||||
en: "kind of module (compulsory, elective)",
|
||||
}
|
||||
values:
|
||||
{
|
||||
"compulsory": { de: "Pflicht", en: "compulsory" },
|
||||
"elective": { de: "Wahl/Wahlpflicht", en: "elective" },
|
||||
}
|
||||
|
||||
#
|
||||
|
@ -291,10 +225,4 @@ kind:
|
|||
#
|
||||
remarks:
|
||||
type: str
|
||||
label: {
|
||||
de: "Besonderes",
|
||||
en: "remarks"
|
||||
}
|
||||
|
||||
|
||||
|
||||
label: { de: "Besonderes", en: "remarks" }
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue