Comments (5)
Hi,
Thanks for signaling.
Actually, the change you suggested has been implemented in the 'develop' branch, in the pm4py.objects.conversion.log.versions.to_trace_log.apply method, changing "include_case_attributes=" to True from False
from pm4py-core.
Thanks. I assume you mean the changes done in 27577e1?
However, what I meant is that it is impossible to know which attributes was used as trace identifier or case_glue
as you denote it in PM4PY after having obtained the TraceLog
. There might be multiple case attributes
so it would not be clear (without computation) which one was used.
from pm4py-core.
Hi,
In the 'develop' branch now, when the trace log is converted to event log, and the include_case_attributes is (as default) True, then it is checked that the attribute "concept:name" is present, and if not is added considering the case id glue
A.k.a. the code changes as follows:
if include_case_attributes:
for k in event.keys():
if k.startswith(case_attribute_prefix):
trace_attr[k.replace(case_attribute_prefix, '')] = event[k]
if xes.DEFAULT_TRACEID_KEY not in trace_attr:
trace_attr[xes.DEFAULT_TRACEID_KEY] = trace_attr[case_glue]
from pm4py-core.
Just trying this with the new v1.0.19 and now I get this error when trying to convert an EventLog with case_id patient
to a TraceLog:
Error in py_call_impl(callable, dots$args, dots$keywords) :
KeyError: 'patient'
Detailed traceback:
File "C:\Users\felixm\AppData\Local\CONTIN~1\ANACON~1\envs\R-RETI~1\lib\site-packages\pm4py\objects\conversion\log\factory.py", line 14, in apply
return VERSIONS[variant](log, parameters=parameters)
File "C:\Users\felixm\AppData\Local\CONTIN~1\ANACON~1\envs\R-RETI~1\lib\site-packages\pm4py\objects\conversion\log\versions\to_trace_log.py", line 26, in apply
case_attribute_prefix=case_pref, enable_deepcopy=enable_deepcopy)
File "C:\Users\felixm\AppData\Local\CONTIN~1\ANACON~1\envs\R-RETI~1\lib\site-packages\pm4py\objects\conversion\log\versions\to_trace_log.py", line 66, in transform_event_log_to_trace_log
trace_attr[xes.DEFAULT_TRACEID_KEY] = trace_attr[case_glue]
It seems that you assume that all case attributes have some kind of prefix? Could this limitation be dropped? In many cases attributes have a domain specific meaning and it would be weird having to rename it. It also prevents me from converting an R event log to PM4PY an back without changes.
Edit:
Just to add, for my use case on converting from bupaR to PM4PY and back I can workaround this issue by simply adding an artificial attribute and not converting trace attributes. So, the comment is more on the general PM4PY design choice. :)
from pm4py-core.
Hi,
Sorry for that. The bug you are seeing is obviously an error introduced by my side on last release. Indeed, it should be
trace_attr[xes.DEFAULT_TRACEID_KEY] = glue
I've pushed this hotfix into release 1.0.20
For the remainder of your observations, there could be two options:
- provide to the conversion to trace log a list of attributes to consider as trace attributes
- provide an utility to "move later" event attributes to trace level
from pm4py-core.
Related Issues (20)
- Time range filter not working with timezone-naive timestamps HOT 2
- dfg created using dfg_visualizer not detecting the starting activity of the process. I am using correlation miner without case id. HOT 1
- pm4py.write.write_bpmn(...) produces invalid BPMN schema HOT 2
- pm4py.llm.openai_query() does not work HOT 1
- Trouble Generating Log File with 'Extensive' Playout Variant in Petri Net Simulation from .pmml File HOT 1
- GPU-based process mining HOT 3
- pm4py.convert.convert_to_petri_net(bpmn) not support inclusiveGateway HOT 1
- Missing PEP 561-compliancy HOT 1
- OCDFG: Visualization issue when having only one activity to show HOT 1
- Suggestion: Integration of Azure OpenAI API HOT 1
- Duplicated sequence from activity to Exclusive Gateway in BPMN visualization HOT 7
- Convert_to_process_tree not working HOT 3
- Method get_event_attribute_values does not get attributes. HOT 4
- Event order is incorrect when adjacent events have only miliseconds difference HOT 3
- TLS certificate expired HOT 2
- Getting a False soundness result for the simplest BPMN model HOT 2
- HELP: Is it possible to convert a BPMN to a TPN file? HOT 1
- ocel interleavings discovery throws TypeError HOT 7
- petrinet to bpmn HOT 4
- SSL Down PM4PY.FIT.FRAUNHOFER.DE website HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pm4py-core.