Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
OPTIS_App
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Package registry
Container registry
Model registry
Operate
Terraform modules
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
OPTIS
OPTIS_App
Commits
5fb8d600
Commit
5fb8d600
authored
1 year ago
by
Aleksandra Dimitrova
Browse files
Options
Downloads
Patches
Plain Diff
format check for the uploaded event log
parent
284b3407
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
backend/__pycache__/eventlog.cpython-311.pyc
+0
-0
0 additions, 0 deletions
backend/__pycache__/eventlog.cpython-311.pyc
backend/eventlog.py
+32
-1
32 additions, 1 deletion
backend/eventlog.py
with
32 additions
and
1 deletion
backend/__pycache__/eventlog.cpython-311.pyc
+
0
−
0
View file @
5fb8d600
No preview for this file type
This diff is collapsed.
Click to expand it.
backend/eventlog.py
+
32
−
1
View file @
5fb8d600
...
@@ -95,6 +95,36 @@ def convert_to_dataframe(name):
...
@@ -95,6 +95,36 @@ def convert_to_dataframe(name):
return
event_log_df
return
event_log_df
def
format_check
(
name
):
event_log
=
convert_to_dataframe
(
name
)
allowed_columns
=
{
'
CaseID
'
,
'
Activity
'
,
'
StartTimestamp
'
,
'
EndTimestamp
'
}
allowed_activities
=
{
'
place order
'
,
'
arrange standard order
'
,
'
arrange custom order
'
,
'
pick from stock A
'
,
'
pick from stock B
'
,
'
pick from stock C
'
,
'
manufacture A
'
,
'
manufacture B
'
,
'
pack A
'
,
'
pack B
'
,
'
pack C
'
,
'
attempt delivery A
'
,
'
attempt delivery B
'
,
'
attempt delivery C
'
,
'
order completed
'
}
for
column_name
in
event_log
.
columns
:
if
column_name
not
in
allowed_columns
:
return
False
for
index
,
event
in
event_log
.
iterrows
():
case_id
=
event
[
'
CaseID
'
]
if
not
isinstance
(
case_id
,
int
):
return
False
activity
=
event
[
'
Activity
'
]
if
activity
not
in
allowed_activities
:
return
False
start
=
event
[
'
StartTimestamp
'
]
if
not
isinstance
(
start
,
float
):
return
False
end
=
event
[
'
EndTimestamp
'
]
if
not
isinstance
(
end
,
float
):
return
False
return
True
def
get_active_cases
(
name
):
def
get_active_cases
(
name
):
event_log_df
=
convert_to_dataframe
(
name
)
event_log_df
=
convert_to_dataframe
(
name
)
...
@@ -280,7 +310,8 @@ def show_active_cases(name):
...
@@ -280,7 +310,8 @@ def show_active_cases(name):
def
main
():
def
main
():
# generate_event_log(10000)
# generate_event_log(10000)
print
(
get_state
(
5
,
"
eventlog.csv
"
))
# print(get_state(5, "eventlog.xes"))
print
(
format_check
(
"
eventlog.xes
"
))
if
__name__
==
"
__main__
"
:
if
__name__
==
"
__main__
"
:
...
...
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