Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Q
quality-kpi
Manage
Activity
Members
Labels
Plan
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Stumpe, Marius
quality-kpi
Commits
d090a669
Commit
d090a669
authored
2 years ago
by
Hock, Martin
Browse files
Options
Downloads
Patches
Plain Diff
Push comments and TODOS
parent
374040e6
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
functions/calculation_rules.py
+5
-1
5 additions, 1 deletion
functions/calculation_rules.py
functions/classes.py
+10
-6
10 additions, 6 deletions
functions/classes.py
test-classes.py
+5
-0
5 additions, 0 deletions
test-classes.py
with
20 additions
and
7 deletions
functions/calculation_rules.py
+
5
−
1
View file @
d090a669
...
...
@@ -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
(
...
...
This diff is collapsed.
Click to expand it.
functions/classes.py
+
10
−
6
View file @
d090a669
...
...
@@ -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
()
...
...
This diff is collapsed.
Click to expand it.
test-classes.py
+
5
−
0
View file @
d090a669
...
...
@@ -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
))
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment