Skip to content
Snippets Groups Projects
Commit d090a669 authored by Hock, Martin's avatar Hock, Martin
Browse files

Push comments and TODOS

parent 374040e6
No related branches found
No related tags found
No related merge requests found
......@@ -6,11 +6,15 @@ File consists of several functions for the calculation rules of FAIR Quality KPI
def test_function():
print("You called the test function.")
# Function to calculate KPIS that use sums
# Or function to calculate the mass with sum?
def kpi_sum(*args):
return sum(args[0])
# if arguments are handed over not as a list: sum(list(args))
# KPI for calculating some real complicated metric
if __name__ == "__main__":
print(
......
......@@ -10,12 +10,16 @@ import json
# TODO
# - Docstrings
# - Beschreibung von Teilen (-> properties)
# - Gute String Darstellung
# - Minimalbeispiel für KPIs
# - Export als GraphViz
# - Erlaube Listen bei add_component und add_assembly ?
# - Zukunft: Erlaube Clone bei Assembly (jede Component muss durch Klon ersetzt werden)
# - Beschreibung von Teilen (-> properties) -> Raus aus dem Konstruktor rein in ein dict. (Deep-Copy)
# - Minimalbeispiel für KPIs -> halb umgesetzt -> mit get_components veranschaulichen
# - Erlaube Clone bei Assembly (jedes child muss durch durch Klon ersetzt werden)
# - Änderungen an Beispiel umsetzen
# - Erlaube Listen bei add_component und add_assembly (-> Nä Semester)
# - Gute String Darstellung -> Ist so schon ok bisher? -> Nä Semester
# - Export als GraphViz -> Nä Semeseter
class ComponentCategory(Enum):
BATTERY = auto()
......
......@@ -106,6 +106,8 @@ scooterwheel = LegoComponent("Vorderrad", ComponentCategory.WHEEL,
TeuresRad["Designnummer"],
TeuresRad["Preis [Euro]"], TeuresRad["Gewicht [g]"],
0)
# TODO component with copy of dict from json
# Cloning is necessary because each lego object gets a unique id so you can't use the same part twice
scooterwheel2 = scooterwheel.clone()
scooterwheel2.name = "Hinterrad"
......@@ -130,6 +132,9 @@ for c in scooter.components:
for a in scooter.assemblies:
# only checking one layer deep here
listofmasses.append(a.mass)
# TODO example with get_component_list
print(listofmasses)
print(kpi_sum(listofmasses))
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment