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

Fix some merge fails

parent 5254dc43
No related branches found
No related tags found
1 merge request!3Merge to main to create "WS2223" Version
Pipeline #928676 failed
%% Cell type:markdown id:c9328cd1 tags:
# FAIRe Qualitäts-KPIs
Name:
Datum:
%% Cell type:markdown id:2ee8746d tags:
## Einführung
FAIRe Qualitäts-KPIs schaffen eine transparente und nachvollziehbare Entscheidungsgrundlage. In dieser Lerneinheit sollen sie die Methodik erlernen, indem sie LEGO-Autos zusammenbauen, deren Qualitäts-KPIs bestimmen und miteinander vergleichen.
### Werkzeug für den Zusammenbau
Der Zusammenbau der Autos erfolgt virtuell. Als Werkzeug steht Ihnen das Modul `classes` zur Verfügung. In diesem sind unterschiedliche Klassen und Methoden implementiert (Objektorientierung). Sie erzeugen jeweils Objekte der Klassen. Ein Objekt ist dabei die virtuelle Abbildung eines realen Bauteiles. Die Eigenschaften des Bauteiles werden über die Eigenschaften des Objektes abgebildet.
### Berechnung der Qualitäts-KPIs
KPIs (Key Performance Indikatoren) sind Kenngrößen des Systems. Sie werden über Berechnungsvorschriften (`calculation_rules`) bestimmt. Diese Berechnungsvorschriften sind von Ihnen als python-Funktionen im Modul `calculation_results` zu implementieren.
### Datenblätter
Für den Zusammenbau stehen Ihnen verschiedene Bauteile in unterschiedlichen Ausführungen zur Verfügung. Sie nutzen die Datenblätter, die als `json-Dateien` zur Verfügung gestellt werden, um Ihre Autos zusammenzubauen.
%% Cell type:markdown id:1c702114 tags:
## Eigene Module und Minimalbeispiel
Für die Ausarbeitung nutzen wir zwei eigene Module (Python-Dateien), die im Ordner `functions` gespeichert sind.
Das Modul `calculation_rules` erweitern Sie während der Ausarbeitung. Um die Änderungen zu nutzen, müssen Sie das Notebook neu starten.
Im Modul `classes` befinden sich die Klassen `LegoComponent, LegoAssembly, AggergationLayer, KPIEncoder` und die Funktion `print_assembly_tree`.
`LegoComponent` bildet einzelne Komponenten ab, während `LegoAssembly` zusammengesetzte Aggregationsebenen abdeckt, also Bauteil, Baugruppe und System. Zur Unterscheidung dient die Klasse Aggregationslayer, diese ist für `LegoComponent` immer `Component`, muss für `LegoAssembly` aber entsprechend auf `SYSTEM, ASSEMBLY` oder `SUBASSEMBLY` gesetzt werden.
Mit einem Minimalbeispiel wird Ihnen gezeigt, wie sie die Module nutzen. Dabei wird nur aus Achse, Rahmen und Reifen ein Tretroller gebaut.
%% Cell type:code id:b2778dee tags:
``` python
# import modules
import json
import pprint
from functions import calculation_rules
from functions import classes
## ## Create the wheels and axles as single components first
# Look up the specific item you want from the provided json files, we can load the full file into a dict
with open('datasheets/axles.json') as json_file:
axles = json.load(json_file)
# Pick a specific axle via its 'item number'
print(axles['32073'])
# Create the component with the dict:
front_axle = classes.LegoComponent('front axle',axles['32073'])
# Both name and the data dict are optional parameters. You can view, add or edit the properties just any dict:
print(front_axle.properties['name'])
# Both label and the data dict are optional parameters. You can view, add or edit the properties just any dict:
print(front_axle.properties['label'])
front_axle.properties['color']= 'grey'
# Viewing dicts in one line is not easy to read, a better output comes with pretty print (pprint):
pprint.pprint(front_axle.properties)
# Create the second axle
back_axle = classes.LegoComponent()
back_axle.properties['name'] = 'back axle'
back_axle.properties['label'] = 'back axle'
back_axle.properties.update(axles['32073'])
# Do not use = here, otherwise you'd overwrite existing properties.
back_axle.properties['color'] = 'grey'
```
%% Output
{'item description': 'Axle 5 studs', 'category': 'axle', 'price [Euro]': 0.001, 'mass [g]': 0.66, 'delivery time [days]': 3, 'Abmessung [studs]': 5}
front axle
{'Abmessung [studs]': 5,
'category': 'axle',
'color': 'grey',
'delivery time [days]': 3,
'item description': 'Axle 5 studs',
'mass [g]': 0.66,
'name': 'front axle',
'price [Euro]': 0.001}
{'item number.1': 32073, 'item description': 'Axle 5 studs', 'category': 'axle', 'price [Euro]': 0.001, 'mass [g]': 0.66, 'delivery time [days]': 3, 'Abmessung [studs]': 5}
---------------------------------------------------------------------------
KeyError Traceback (most recent call last)
Cell In[1], line 18
16 front_axle = classes.LegoComponent('front axle',axles['32073'])
17 # Both name and the data dict are optional parameters. You can view, add or edit the properties just any dict:
---> 18 print(front_axle.properties['name'])
19 front_axle.properties['color']= 'grey'
20 # Viewing dicts in one line is not easy to read, a better output comes with pretty print (pprint):
KeyError: 'name'
%% Cell type:code id:b4a8e8c8 tags:
``` python
# Now wheels
with open('datasheets/wheels.json') as json_file:
wheels = json.load(json_file)
# Adding the color here already as dict, and the surface as key-value argument.
# Multiple of both are supported, but only in this
#front_wheel = classes.LegoComponent('front wheel', wheels['2903'],{'color':'yellow'},winter='true')
front_wheel = classes.LegoComponent('front wheel', wheels['2903'],surface='rough', paint = 'glossy')
# front_
pprint.pprint(front_wheel.properties)
# We included a clone function, so you can easily create multiple items:
back_wheel = front_wheel.clone()
```
%% Output
{'category': 'wheel',
'color': 'yellow',
'data source': 'https://www.bricklink.com/v2/catalog/catalogitem.page?P=2903c02#T=C',
'delivery time [days]': 5,
'diameter [mm]': 81.6,
'item description': 'wheel 81,6',
'item number.1': 2903,
'mass [g]': 30.0,
'name': 'front wheel',
'paint': 'glossy',
'price [Euro]': 1.31,
'related items': 2902,
'surface': 'rough'}
%% Cell type:code id:bd3c7a6b tags:
``` python
# Also need a frame
with open('datasheets/Gestell.json') as json_file:
Gestelle = json.load(json_file)
Gestellbeschreibung = "Technic, Brick 1 x 8 with Holes"
Gestell = Gestelle[Gestellbeschreibung]
```
%% Cell type:markdown id:3b69752c tags:
### Modul calculation_results
Sie können die unterschiedlichen Funktionen (Berechnungsvorschriften) aufrufen. Beachten Sie dabei die Übergabe- und Rückgabewerte.
%% Cell type:code id:294c680b tags:
``` python
# test the import
calculation_rules.test_function()
```
%% Cell type:markdown id:a2c87a3c tags:
### Modul classes
Wir bauen ein Auto zusammen.
%% Cell type:code id:8db386db tags:
``` python
```
%% Cell type:code id:8f2ae9f4 tags:
``` python
```
%% Cell type:markdown id:de070039 tags:
## Aufgabe: Aufbau eines ersten Fahrzeugs
Bauen Sie ein erstes Fahrzeug aus den gegebenen LEGO-Teilen auf.
Das Fahrzeug muss aus Baugruppen, Bauteilen und Komponenten bestehen. Es muss mindestens vier Räder haben und sich durch den elektrischen Antrieb fortbewegen können.
%% Cell type:markdown id:05a8eb21 tags:
### Beschreibung des Fahrzeuges
Beschreiben Sie kurz und präzise Ihr Fahrzeug.
%% Cell type:code id:ccaf3043 tags:
``` python
# initialize componentens
```
%% Cell type:code id:1ea61422 tags:
``` python
# read out properties from datasheets
```
%% Cell type:code id:36f981df tags:
``` python
# set properties
```
%% Cell type:code id:24400d94 tags:
``` python
# export car and its properties
```
%% Cell type:markdown id:c1fef7f0 tags:
## Aufgabe: Bestimmung der Qualität mittels KPIs
Bestimmen Sie die Qualität Ihres Fahrzeugs mittels KPIs.
Die Qualität des Fahrzeugs ist mit mindestens einem KPI je Qualitätsdimension (Aufwand, Verfügbarkeit, Akzeptanz) zu bestimmen. Enwickeln Sie zunächst sinnvolle KPIs, welche mit den gegebenen Daten umsetzbar sind. Halten Sie die Berechnungsvorschriften im Jupyter Notebook fest. Implementieren Sie deren Berechnung für das Gesamtsystem "Fahrzeug" mittels einzelner Funktionen im Skript `calculation_rules`. Sie können zusätzlich Ihre Methoden auch auf die niedrigeren Aggregationsebenen anwenden.
%% Cell type:markdown id:d5f02096 tags:
### Beschreibung KPI
Beschreiben Sie den jeweiligen KPI und geben Sie seine Berechnungsvorschrift an.
$$
a = \frac{b}{c} + d
$$
%% Cell type:code id:59eabafc tags:
``` python
# calculate the KPIs for your car
```
%% Cell type:code id:c774b381 tags:
``` python
# print your KPIs
```
%% Cell type:markdown id:89c75440 tags:
## Aufgabe: Aufbau eines zweiten Fahrzeugs
Setzen Sie sich ein Ziel, welche Qualitätsdimensionen in einem zweiten Fahrzeug verbessert werden sollen und bauen Sie dementsprechend ein zweites Fahrzeug aus den gegebenen LEGO-Teilen auf.
Das Fahrzeug muss aus Baugruppen, Bauteilen und Komponenten bestehen. Es muss mindestens vier Räder haben und sich durch den elektrischen Antrieb fortbewegen können. Die Verwendung eines Getriebes zwischen Motor und Antriebsachse(n) ist verpflichtend. Es sind nur die gegebenen LEGO-Teile zu verwenden.
%% Cell type:markdown id:3cef0828 tags:
### Beschreibung
Beschreiben Sie, welche Verbesserung Sie vornehmen.
...
%% Cell type:markdown id:73c454f2 tags:
### Aufbau des zweiten Fahrzeuges
Beschreiben Sie kurz und präzise den Aufbau des zweiten Fahrzeugs
%% Cell type:code id:ea18e735 tags:
``` python
# build a second car
```
%% Cell type:code id:b3438fc4 tags:
``` python
# read out properties from datasheets
```
%% Cell type:code id:0b7336fb tags:
``` python
# set properties
```
%% Cell type:code id:446abbca tags:
``` python
# export car and its properties
```
%% Cell type:markdown id:89e54480 tags:
### KPIs des zweiten Fahrzeuges
Bestimmen Sie die KPIs des zweiten Fahrzeuges
%% Cell type:code id:762a1e93 tags:
``` python
# calculate the KPIs for your car
```
%% Cell type:code id:1ed67328 tags:
``` python
# print your KPIs
```
%% Cell type:markdown id:e413cd84 tags:
## Aufgabe: Darstellung und Vergleich der Ergebnisse
Stellen Sie die Ergebnisse für beide Fahrzeuge übersichtlich dar.
Die entwickelten KPIs müssen dargestellt und die Datengrundlage ersichtlich sein.
Eine geeignete grafische Darstellung für die Gegenüberstellung der Ergebnisse für beide Fahrzeuge ist zu wählen.
%% Cell type:code id:b0f93e22 tags:
``` python
# plot the data, save diagramm as svg-file
```
%% Cell type:markdown id:62ff04b2 tags:
### Interpretation der Ergebnisse
Interpretieren Sie ihre Ergebnisse. Vergleichen Sie die KPIs ihrer Autos. Konnten Sie ihre gewünschte Verbesserung erzielen?
%% Cell type:markdown id:a0840fbf tags:
## Aufgabe: Exportieren Sie ihre Daten
Exportieren/ Speichern Sie alle relevaten Daten ab.
%% Cell type:code id:a4bdfc7a tags:
``` python
# export all relevant data
```
......
{
"32073":{
"item number":32073,
"item description":"Axle 5 studs",
"category":"axle",
"price [Euro]":0.001,
"mass [g]":0.66,
"delivery time [days]":3,
"Abmessung [studs]":5
},
"44294":{
"item number":44294,
"item description":"Axle 7 studs",
"category":"axle",
"price [Euro]":0.01,
"mass [g]":1.05,
"delivery time [days]":3,
"Abmessung [studs]":7
},
"3707":{
"item number":3707,
"item description":"Axle 8 studs",
"category":"axle",
"price [Euro]":0.01,
"mass [g]":1.18,
"delivery time [days]":3,
"Abmessung [studs]":8
},
"60485":{
"item number":60485,
"item description":"Axle 9 studs",
"category":"axle",
"price [Euro]":0.01,
"mass [g]":1.3,
"delivery time [days]":7,
"Abmessung [studs]":9
},
"3737":{
"item number":3737,
"item description":"Axle 10 studs",
"category":"axle",
"price [Euro]":0.01,
"mass [g]":1.49,
"delivery time [days]":7,
"Abmessung [studs]":10
},
"23948":{
"item number":23948,
"item description":"Axle 11 studs",
"category":"axle",
"price [Euro]":0.15,
"mass [g]":1.65,
"delivery time [days]":3,
"Abmessung [studs]":11
},
"3708":{
"item number":3708,
"item description":"Axle 12 studs",
"category":"axle",
"price [Euro]":0.02,
"mass [g]":1.82,
"delivery time [days]":7,
"Abmessung [studs]":12
},
"50451":{
"item number":50451,
"item description":"Axle 16 studs",
"category":"axle",
"price [Euro]":0.75,
"mass [g]":2.37,
"delivery time [days]":3,
"Abmessung [studs]":16
}
}
\ No newline at end of file
{
"8878-1":{
"item number":"8878-1",
"item description":"Power Functions Rechargeable Battery Box",
"category":"battery",
"price [Euro]":55,
"mass [g] [g]":83.94,
"delivery time [days]":8,
"data source":"https:\/\/www.bricklink.com\/v2\/catalog\/catalogitem.page?S=8878-1#T=S&O={%22iconly%22:0}",
"output voltage [V]":7.4,
"dimensions [cm]":"15 x 15 x 3,5"
},
"8881-1":{
"item number":"8881-1",
"item description":"Power Functions Battery Box",
"category":"battery",
"price [Euro]":12,
"mass [g] [g]":179.4,
"delivery time [days]":3,
"data source":"https:\/\/www.bricklink.com\/v2\/catalog\/catalogitem.page?S=8881-1#T=S&O={%22iconly%22:0}",
"output voltage [V]":9.0,
"dimensions [cm]":"8,8 x 6,3 x 3,2"
},
"88000-1":{
"item number":"88000-1",
"item description":"Lego AAA Battery Box",
"category":"battery",
"price [Euro]":30,
"mass [g] [g]":97.24,
"delivery time [days]":6,
"data source":"https:\/\/www.brickowl.de\/catalog\/lego-aaa-battery-box-set-88000",
"output voltage [V]":9.0,
"dimensions [cm]":"15,3 x 15,1 x 3,9"
},
"2847c01":{
"item number":"2847c01",
"item description":"Electric 9V Battery Box",
"category":"battery",
"price [Euro]":2,
"mass [g] [g]":172.7,
"delivery time [days]":3,
"data source":"https:\/\/www.bricklink.com\/v2\/catalog\/catalogitem.page?P=2847c01&name=Electric%209V%20Battery%20Box%204%20x%2014%20x%204%20with%20Red%20Buttons%20and%20Contact%20Plate%20with%20Dark%20Gray%20Base%20(2846%20\/%202847c00)&category=%5BElectric,%20Battery%20Box%5D#T=S&O={%22iconly%22:0}",
"output voltage [V]":9.0,
"dimensions [cm]":"11,2 x 3,2 x 3,2"
},
"59510":{
"item number":59510,
"item description":"LEGO Power Functions Battery Box ",
"category":"battery",
"price [Euro]":18,
"mass [g] [g]":165.3,
"delivery time [days]":3,
"data source":"https:\/\/www.brickowl.de\/catalog\/lego-power-functions-battery-box-with-beam-connectors-with-on-off-sticker-59510",
"output voltage [V]":9.0,
"dimensions [cm]":"8,8 x 6,4 x 3,2"
},
"84599":{
"item number":84599,
"item description":"Electric 9V Power Functions Battery Box (Rechargeable)",
"category":"battery",
"price [Euro]":120,
"mass [g] [g]":82.0,
"delivery time [days]":8,
"data source":"https:\/\/www.bricklink.com\/v2\/catalog\/catalogitem.page?P=84599&name=Electric%209V%20Battery%20Box%20Power%20Functions%20(Rechargeable)%20with%20Dark%20Bluish%20Gray%20Bottom&category=%5BElectric,%20Battery%20Box%5D#T=S&O={%22iconly%22:0}",
"output voltage [V]":9.0,
"dimensions [cm]":"15 x 15 x 3,5"
}
}
\ No newline at end of file
{
"39790":{
"item number":39790,
"item description":"Technic, Liftarm, Modified Frame Thick 11 x 15 Open Center",
"category":"frame",
"price [Euro]":2.19,
"mass [g]":12.96,
"delivery time [days]":3,
"data source":"https:\/\/www.bricklink.com\/v2\/catalog\/catalogitem.page?P=39790#T=C",
"Abmessung [studs]":"11 x 15 x 1"
},
"32532":{
"item number":32532,
"item description":"Technic, Brick 6 x 8 Open Center",
"category":"frame",
"price [Euro]":0.18,
"mass [g]":8.0,
"delivery time [days]":3,
"data source":"https:\/\/www.bricklink.com\/v2\/catalog\/catalogitem.page?P=32532#T=C",
"Abmessung [studs]":"6 x 8 x 1"
},
"32531":{
"item number":32531,
"item description":"Technic, Brick 4 x 6 Open Center",
"category":"frame",
"price [Euro]":0.1,
"mass [g]":5.0,
"delivery time [days]":3,
"data source":"https:\/\/www.bricklink.com\/v2\/catalog\/catalogitem.page?P=32531&idColor=11#T=C&C=11",
"Abmessung [studs]":"4 x 6 x 1"
},
"3700":{
"item number":3700,
"item description":"Technic, Brick 1 x 2 with Hole",
"category":"frame",
"price [Euro]":0.01,
"mass [g]":0.82,
"delivery time [days]":3,
"data source":"https:\/\/www.bricklink.com\/v2\/catalog\/catalogitem.page?P=3700#T=C",
"Abmessung [studs]":"1 x 2"
},
"3701":{
"item number":3701,
"item description":"Technic, Brick 1 x 4 with Holes",
"category":"frame",
"price [Euro]":0.01,
"mass [g]":1.46,
"delivery time [days]":3,
"data source":"https:\/\/www.bricklink.com\/v2\/catalog\/catalogitem.page?P=3701#T=C",
"Abmessung [studs]":"1 x 4 x 1"
},
"3702":{
"item number":3702,
"item description":"Technic, Brick 1 x 8 with Holes",
"category":"frame",
"price [Euro]":0.01,
"mass [g]":2.85,
"delivery time [days]":5,
"data source":"https:\/\/www.bricklink.com\/v2\/catalog\/catalogitem.page?P=3702#T=C",
"Abmessung [studs]":"1 x 8 x 1"
},
"2730":{
"item number":2730,
"item description":"Technic, Brick 1 x 10 with Holes",
"category":"frame",
"price [Euro]":0.01,
"mass [g]":3.67,
"delivery time [days]":5,
"data source":"https:\/\/www.bricklink.com\/v2\/catalog\/catalogitem.page?P=2730#T=C",
"Abmessung [studs]":"1 x 10 x 1"
},
"3895":{
"item number":3895,
"item description":"Technic, Brick 1 x 12 with Holes",
"category":"frame",
"price [Euro]":0.03,
"mass [g]":4.2,
"delivery time [days]":5,
"data source":"https:\/\/www.bricklink.com\/v2\/catalog\/catalogitem.page?P=3895#T=C",
"Abmessung [studs]":"1 x 12 x 1"
},
"32018":{
"item number":32018,
"item description":"Technic, Brick 1 x 14 with Holes",
"category":"frame",
"price [Euro]":0.03,
"mass [g]":4.92,
"delivery time [days]":5,
"data source":"https:\/\/www.bricklink.com\/v2\/catalog\/catalogitem.page?P=32018#T=C",
"Abmessung [studs]":"1 x 14 x 1"
},
"3703":{
"item number":3703,
"item description":"Technic, Brick 1 x 16 with Holes",
"category":"frame",
"price [Euro]":0.07,
"mass [g]":5.87,
"delivery time [days]":5,
"data source":"https:\/\/www.bricklink.com\/v2\/catalog\/catalogitem.page?P=3703#T=C",
"Abmessung [studs]":"1 x 16 x 1"
},
"32524":{
"item number":32524,
"item description":"Technic, Liftarm Thick 1 x 7",
"category":"frame",
"price [Euro]":0.01,
"mass [g]":1.79,
"delivery time [days]":3,
"data source":"https:\/\/www.bricklink.com\/v2\/catalog\/catalogitem.page?P=32524&name=Technic,%20Liftarm%20Thick%201%20x%207&category=%5BTechnic,%20Liftarm%5D#T=S&O={%22iconly%22:0}",
"Abmessung [studs]":"1 x 7"
},
"40490":{
"item number":40490,
"item description":"Technic, Liftarm Thick 1 x 9",
"category":"frame",
"price [Euro]":0.02,
"mass [g]":2.59,
"delivery time [days]":3,
"data source":"https:\/\/www.bricklink.com\/v2\/catalog\/catalogitem.page?P=40490&name=Technic,%20Liftarm%20Thick%201%20x%209&category=%5BTechnic,%20Liftarm%5D#T=S&O={%22iconly%22:0}",
"Abmessung [studs]":"1 x 9"
},
"32525":{
"item number":32525,
"item description":"Technic, Liftarm Thick 1 x 11",
"category":"frame",
"price [Euro]":0.02,
"mass [g]":2.8,
"delivery time [days]":3,
"data source":"https:\/\/www.bricklink.com\/v2\/catalog\/catalogitem.page?P=32525&name=Technic,%20Liftarm%20Thick%201%20x%2011&category=%5BTechnic,%20Liftarm%5D#T=S&O={%22iconly%22:0}",
"Abmessung [studs]":"1 x 11"
},
"41239":{
"item number":41239,
"item description":"Technic, Liftarm Thick 1 x 13",
"category":"frame",
"price [Euro]":0.05,
"mass [g]":3.3,
"delivery time [days]":5,
"data source":"https:\/\/www.bricklink.com\/v2\/catalog\/catalogitem.page?P=41239&name=Technic,%20Liftarm%20Thick%201%20x%2013&category=%5BTechnic,%20Liftarm%5D#T=S&O={%22iconly%22:0}",
"Abmessung [studs]":"1 x 13"
},
"32278":{
"item number":32278,
"item description":"Technic, Liftarm Thick 1 x 15",
"category":"frame",
"price [Euro]":0.05,
"mass [g]":4.0,
"delivery time [days]":3,
"data source":"https:\/\/www.bricklink.com\/v2\/catalog\/catalogitem.page?P=32278&name=Technic,%20Liftarm%20Thick%201%20x%2015&category=%5BTechnic,%20Liftarm%5D#T=S&O={%22iconly%22:0}",
"Abmessung [studs]":"1 x 15"
},
"3713":{
"item number":3713,
"item description":"Technic Bush",
"category":"frame",
"price [Euro]":0.01,
"mass [g]":0.14,
"delivery time [days]":3,
"data source":"https:\/\/www.bricklink.com\/v2\/catalog\/catalogitem.page?P=3713&name=Technic%20Bush&category=%5BTechnic%5D#T=S&O={%22iconly%22:0}",
"Abmessung [studs]":1
},
"32123":{
"item number":32123,
"item description":"Technic Bush 1\/2 Smooth",
"category":"frame",
"price [Euro]":0.01,
"mass [g]":0.01,
"delivery time [days]":3,
"data source":"https:\/\/www.bricklink.com\/v2\/catalog\/catalogitem.page?P=4265c&name=Technic%20Bush%201\/2%20Smooth&category=%5BTechnic%5D#T=S&O={%22iconly%22:0}",
"Abmessung [studs]":1
},
"3749":{
"item number":3749,
"item description":"Technic, Axle 1L with Pin without Friction Ridges",
"category":"frame",
"price [Euro]":0.01,
"mass [g]":0.22,
"delivery time [days]":5,
"data source":"https:\/\/www.bricklink.com\/v2\/catalog\/catalogitem.page?P=3749&name=Technic,%20Axle%20%201L%20with%20Pin%20without%20Friction%20Ridges&category=%5BTechnic,%20Axle%5D#T=S&O={%22iconly%22:0}",
"Abmessung [studs]":"0,75 x 2 x 0,55"
},
"6538":{
"item number":6538,
"item description":"Technic, Axle Connector 2L (Ridged Undetermined Type)",
"category":"frame",
"price [Euro]":0.03,
"mass [g]":0.4,
"delivery time [days]":5,
"data source":"https:\/\/www.bricklink.com\/v2\/catalog\/catalogitem.page?P=6538#T=C",
"Abmessung [studs]":"?"
},
"6536":{
"item number":6536,
"item description":"Technic, Axle and Pin Connector Perpendicular",
"category":"frame",
"price [Euro]":0.01,
"mass [g]":0.39,
"delivery time [days]":7,
"data source":"https:\/\/www.bricklink.com\/v2\/catalog\/catalogitem.page?P=6536&name=Technic,%20Axle%20and%20Pin%20Connector%20Perpendicular&category=%5BTechnic,%20Connector%5D#T=S&O={%22iconly%22:0}",
"Abmessung [studs]":"1x 2 x 1"
},
"32138":{
"item number":32138,
"item description":"Technic, Pin Double with Axle Hole",
"category":"frame",
"price [Euro]":0.01,
"mass [g]":0.96,
"delivery time [days]":3,
"data source":"https:\/\/www.bricklink.com\/v2\/catalog\/catalogitem.page?P=32138&name=Technic,%20Pin%20Double%20with%20Axle%20Hole&category=%5BTechnic,%20Pin%5D#T=S&O={%22iconly%22:0}",
"Abmessung [studs]":"?"
},
"14720":{
"item number":14720,
"item description":"Technic, Liftarm, Modified H-Shape Thick 3 x 5 Perpendicular",
"category":"frame",
"price [Euro]":0.08,
"mass [g]":2.29,
"delivery time [days]":3,
"data source":"https:\/\/www.bricklink.com\/v2\/catalog\/catalogitem.page?P=14720&name=Technic,%20Liftarm,%20Modified%20H-Shape%20Thick%203%20x%205%20Perpendicular&category=%5BTechnic,%20Liftarm%5D#T=S&O={%22iconly%22:0}",
"Abmessung [studs]":"3 x 5 x 1"
},
"48989":{
"item number":48989,
"item description":"Technic, Pin Connector Perpendicular 3L with 4 Pins",
"category":"frame",
"price [Euro]":0.01,
"mass [g]":1.22,
"delivery time [days]":5,
"data source":"https:\/\/www.bricklink.com\/v2\/catalog\/catalogitem.page?P=48989&name=Technic,%20Pin%20Connector%20Perpendicular%203L%20with%204%20Pins&category=%5BTechnic,%20Connector%5D#T=S&O={%22iconly%22:0}",
"Abmessung [studs]":"3 x 3 x 1"
},
"55615":{
"item number":55615,
"item description":"Technic, Pin Connector Perpendicular 3 x 3 Bent with 4 Pins",
"category":"frame",
"price [Euro]":0.1,
"mass [g]":1.9,
"delivery time [days]":5,
"data source":"https:\/\/www.bricklink.com\/v2\/catalog\/catalogitem.page?P=55615&name=Technic,%20Pin%20Connector%20Perpendicular%203%20x%203%20Bent%20with%204%20Pins&category=%5BTechnic,%20Connector%5D#T=S&O={%22iconly%22:0}",
"Abmessung [studs]":"4 x 4 x 1"
},
"32556":{
"item number":32556,
"item description":"Technic, Pin 3L without Friction Ridges",
"category":"frame",
"price [Euro]":0.1,
"mass [g]":0.25,
"delivery time [days]":3,
"data source":"https:\/\/www.bricklink.com\/v2\/catalog\/catalogitem.page?P=32556&name=Technic,%20Pin%203L%20without%20Friction%20Ridges&category=%5BTechnic,%20Pin%5D#T=S&O={%22iconly%22:0}",
"Abmessung [studs]":1
},
"3673":{
"item number":3673,
"item description":"Technic, Pin without Friction Ridges",
"category":"frame",
"price [Euro]":0.01,
"mass [g]":0.16,
"delivery time [days]":3,
"data source":"https:\/\/www.bricklink.com\/v2\/catalog\/catalogitem.page?P=3673&name=Technic,%20Pin%20without%20Friction%20Ridges&category=%5BTechnic,%20Pin%5D#T=S&O={%22iconly%22:0}",
"Abmessung [studs]":1
},
"32054":{
"item number":32054,
"item description":"Technic, Pin 4L with Friction Ridges and Stop Bush",
"category":"frame",
"price [Euro]":0.01,
"mass [g]":0.33,
"delivery time [days]":3,
"data source":"https:\/\/www.bricklink.com\/v2\/catalog\/catalogitem.page?P=32054&name=Technic,%20Pin%203L%20with%20Friction%20Ridges%20and%20Stop%20Bush&category=%5BTechnic,%20Pin%5D#T=S&O={%22iconly%22:0}",
"Abmessung [studs]":1
}
}
\ No newline at end of file
{
"3647":{
"item number":3647,
"item description":"Gear 8 Tooth",
"category":"gear",
"price [Euro]":0.14,
"mass [g]":0.16,
"delivery time [days]":11
},
"94925":{
"item number":94925,
"item description":"Gear 16 Tooth",
"category":"gear",
"price [Euro]":0.2,
"mass [g]":0.7,
"delivery time [days]":12
},
"32269":{
"item number":32269,
"item description":"Gear 20 Tooth",
"category":"gear",
"price [Euro]":0.36,
"mass [g]":1.4,
"delivery time [days]":13
},
"3648":{
"item number":3648,
"item description":"Gear 24 Tooth",
"category":"gear",
"price [Euro]":0.32,
"mass [g]":1.17,
"delivery time [days]":11
},
"3650":{
"item number":3650,
"item description":"Gear 24 Tooth Crown",
"category":"gear",
"price [Euro]":0.09,
"mass [g]":1.03,
"delivery time [days]":13
},
"3649":{
"item number":3649,
"item description":"Gear 40 Tooth",
"category":"gear",
"price [Euro]":0.81,
"mass [g]":3.76,
"delivery time [days]":11
},
"32498":{
"item number":32498,
"item description":"Gear 36 Tooth",
"category":"gear",
"price [Euro]":0.88,
"mass [g]":3.5,
"delivery time [days]":12
},
"6588":{
"item number":6588,
"item description":"Gear Worm Gearbox",
"category":"gear",
"price [Euro]":1.63,
"mass [g]":4.5,
"delivery time [days]":11
},
"4716":{
"item number":4716,
"item description":"Gear Worm Screw",
"category":"gear",
"price [Euro]":0.54,
"mass [g]":0.6,
"delivery time [days]":12
}
}
\ No newline at end of file
{
"8882-1":{
"input voltage [V]":9
},
"8883-1":{
"input voltage [V]":9
},
"88003-1":{
"input voltage [V]":9
},
"nan":{
"input voltage [V]":9
}
}
\ No newline at end of file
{
"4265":{
"item number":4265,
"item description":"wheel 14",
"category":"wheel",
"related items":59895,
"price [Euro]":0.02,
"mass [g]":0.5,
"delivery time [days]":5,
"data source":"https:\/\/www.bricklink.com\/v2\/catalog\/catalogitem.page?P=4265cc01#T=C",
"diameter [mm]":14.0
},
"3482":{
"item number":3482,
"item description":"wheel 24",
"category":"wheel",
"related items":3483,
"price [Euro]":0.01,
"mass [g]":3.0,
"delivery time [days]":5,
"data source":"https:\/\/www.bricklink.com\/v2\/catalog\/catalogitem.page?P=3482c01#T=C",
"diameter [mm]":24.0
},
"56904":{
"item number":56904,
"item description":"wheel 43,2",
"category":"wheel",
"related items":30699,
"price [Euro]":0.11,
"mass [g]":13.0,
"delivery time [days]":5,
"data source":"https:\/\/www.bricklink.com\/v2\/catalog\/catalogitem.page?P=56904c02#T=C",
"diameter [mm]":43.2
},
"41896":{
"item number":41896,
"item description":"wheel 56",
"category":"wheel",
"related items":41897,
"price [Euro]":0.45,
"mass [g]":23.0,
"delivery time [days]":5,
"data source":"https:\/\/www.bricklink.com\/v2\/catalog\/catalogitem.page?P=41896c04#T=C",
"diameter [mm]":56.0
},
"2903":{
"item number":2903,
"item description":"wheel 81,6",
"category":"wheel",
"related items":2902,
"price [Euro]":1.31,
"mass [g]":30.0,
"delivery time [days]":5,
"data source":"https:\/\/www.bricklink.com\/v2\/catalog\/catalogitem.page?P=2903c02#T=C",
"diameter [mm]":81.6
},
"88517":{
"item number":88517,
"item description":"wheel 100,6",
"category":"wheel",
"related items":11957,
"price [Euro]":1.25,
"mass [g]":40.0,
"delivery time [days]":5,
"data source":"https:\/\/www.bricklink.com\/v2\/catalog\/catalogitem.page?P=88517c02#T=C",
"diameter [mm]":100.6
}
}
\ No newline at end of file
......@@ -6,14 +6,13 @@ from enum import Enum, auto
import uuid
from typing import List, Dict, Optional
import json
import copy
import operator
# TODO
# - Docstrings
# - Beschreibung von Teilen (-> properties) -> Raus aus dem Konstruktor rein in ein dict. (Deep-Copy)
# - Erstmal als Shallow Copy umgesetzt, wir verwenden momentan keine nested dicts
# - Deep Copy erstmal beibehalten auf branch dev-bh
# - Minimalbeispiel für KPIs -> halb umgesetzt -> mit get_components veranschaulichen
# - Änderungen an Beispiel umsetzen
......@@ -23,16 +22,6 @@ import operator
# - Export als GraphViz -> Nä Semeseter
class ComponentCategory(Enum):
BATTERY = auto()
MOTOR = auto()
FRAME = auto()
WHEEL = auto()
AXLE = auto()
GEAR = auto()
class AggregationLayer(Enum):
SYSTEM = auto()
ASSEMBLY = auto()
......@@ -50,7 +39,6 @@ class LegoComponent:
self.properties['label'] = label
if datasheet is not None:
self.properties.update(datasheet)
self.properties[]
for prop in more_properties:
if isinstance(prop, dict):
self.properties.update(prop)
......
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