Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
D
DSI Parser Frontend
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
DigitalDynamicMeasurement
DSI Parser Frontend
Commits
6b2b3df6
Commit
6b2b3df6
authored
1 year ago
by
Benedikt
Browse files
Options
Downloads
Patches
Plain Diff
added Issue Creation function
parent
320e2a88
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
issue.md
+11
-9
11 additions, 9 deletions
issue.md
main.py
+22
-0
22 additions, 0 deletions
main.py
with
33 additions
and
9 deletions
issue.md
+
11
−
9
View file @
6b2b3df6
There was an issue with the following unit conversion:
-
Left unit: {}
-
Right unit: {}
| Which unit | User entered input | Parsed input |
| ---------- | ------------------ | ------------ |
| Left unit | {} | {} |
| Right unit | {} | {} |
### Result/Expectation:
| Calculation | Result | Expectation | Did match |
|-------------|--------|-------------|-----------|
| Base unit | {} | | [
]
|
| factor
*
left = right | {} | | [] |
| factor
*
right = left | {} | | [] |
| factor
*
left = base | {} | | [] |
| factor
*
base = left | {} | | [] |
| factor
*
right = base | {} | | [] |
| factor
*
base = right | {} | | [] |
| Base unit | {} | | [
]
|
| factor
*
left = right | {} | | [
] |
| factor
*
right = left | {} | | [
] |
| factor
*
left = base | {} | | [
] |
| factor
*
base = left | {} | | [
] |
| factor
*
right = base | {} | | [
] |
| factor
*
base = right | {} | | [
] |
If there was an error with the calculation, please fill out the table above. Feel free to also add additional info here:
...
...
This diff is collapsed.
Click to expand it.
main.py
+
22
−
0
View file @
6b2b3df6
...
...
@@ -6,6 +6,7 @@ import warnings
import
itertools
import
math
import
bokehCssPTB
from
urllib.parse
import
quote
from
dsiParser
import
dsiParser
from
bokeh.plotting
import
curdoc
,
figure
from
bokeh.layouts
import
column
,
row
...
...
@@ -190,6 +191,10 @@ class page():
curdoc
().
add_root
(
self
.
compareRow
)
self
.
dsiCompGraphGen
=
dsiCompGraphGen
(
self
.
dsiInput1
,
self
.
dsiInput2
)
curdoc
().
add_root
(
self
.
dsiCompGraphGen
.
widget
)
self
.
createIssueButton
=
Button
(
label
=
"
Report conversion error
"
,
disabled
=
True
)
# self.createIssueButton.on_click(self.createIssueUrl)
curdoc
().
add_root
(
self
.
dsiCompGraphGen
.
widget
)
curdoc
().
add_root
(
self
.
createIssueButton
)
def
compare
(
self
):
self
.
dsiInput1
.
parseInput
()
...
...
@@ -211,4 +216,21 @@ class page():
self
.
compaReresult
.
text
=
"
The two units are not equal
"
self
.
compaReresult
.
css_classes
=
[
"
msg-negative
"
]
self
.
dsiCompGraphGen
.
flush
()
self
.
createIssueButton
.
disabled
=
False
self
.
createIssueButton
.
button_type
=
"
danger
"
self
.
createIssueButton
.
js_on_event
(
"
button_click
"
,
CustomJS
(
code
=
f
"
window.open(
'
{
self
.
createIssueUrl
()
}
'
,
'
_blank
'
);
"
))
def
createIssueUrl
(
self
):
quantitiesToAdd
=
[
self
.
dsiInput1
.
dsiInput
.
value
,
str
(
self
.
dsiInput1
.
dsiTree
),
self
.
dsiInput2
.
dsiInput
.
value
,
str
(
self
.
dsiInput2
.
dsiTree
),
str
(
self
.
dsiCompGraphGen
.
baseUnit
),
self
.
dsiCompGraphGen
.
scalfactorAB
,
self
.
dsiCompGraphGen
.
scalfactorBA
,
self
.
dsiCompGraphGen
.
scalfactorABase
,
self
.
dsiCompGraphGen
.
scalfactorBaseA
,
self
.
dsiCompGraphGen
.
scalfactorBBase
,
self
.
dsiCompGraphGen
.
scalfactorBaseB
]
templateStr
=
open
(
'
./issue.md
'
).
read
()
filledResult
=
templateStr
.
format
(
*
quantitiesToAdd
)
filledTitle
=
f
'
Unexpected comparison result:
{
self
.
dsiInput1
.
dsiInput
.
value
}
to
{
self
.
dsiInput2
.
dsiInput
.
value
}
'
issueUrl
=
r
'
https://gitlab1.ptb.de/digitaldynamicmeasurement/dsi-parser-frontend/-/issues/new?
'
title
=
quote
(
filledTitle
)
body
=
quote
(
filledResult
)
url
=
issueUrl
+
'
issue[title]=
'
+
title
+
'
&issue[description]=
'
+
body
return
url
thisPage
=
page
()
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