r4pm 0.4.0__cp38-cp38-macosx_11_0_arm64.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. r4pm/__init__.py +81 -0
  2. r4pm/__init__.pyi +125 -0
  3. r4pm/bindings/__init__.py +42 -0
  4. r4pm/bindings/__init__.pyi +140 -0
  5. r4pm/bindings/bindings.py +108 -0
  6. r4pm/bindings/bindings.pyi +73 -0
  7. r4pm/bindings/core/__init__.py +6 -0
  8. r4pm/bindings/core/__init__.pyi +7 -0
  9. r4pm/bindings/core/event_data/__init__.py +5 -0
  10. r4pm/bindings/core/event_data/__init__.pyi +6 -0
  11. r4pm/bindings/core/event_data/case_centric/__init__.py +5 -0
  12. r4pm/bindings/core/event_data/case_centric/__init__.pyi +6 -0
  13. r4pm/bindings/core/event_data/case_centric/utils/__init__.py +5 -0
  14. r4pm/bindings/core/event_data/case_centric/utils/__init__.pyi +6 -0
  15. r4pm/bindings/core/event_data/case_centric/utils/activity_projection.py +28 -0
  16. r4pm/bindings/core/event_data/case_centric/utils/activity_projection.pyi +21 -0
  17. r4pm/bindings/core/process_models/__init__.py +5 -0
  18. r4pm/bindings/core/process_models/__init__.pyi +6 -0
  19. r4pm/bindings/core/process_models/object_centric/__init__.py +5 -0
  20. r4pm/bindings/core/process_models/object_centric/__init__.pyi +6 -0
  21. r4pm/bindings/core/process_models/object_centric/ocdfg/__init__.py +5 -0
  22. r4pm/bindings/core/process_models/object_centric/ocdfg/__init__.pyi +6 -0
  23. r4pm/bindings/core/process_models/object_centric/ocdfg/object_centric_dfg_struct.py +27 -0
  24. r4pm/bindings/core/process_models/object_centric/ocdfg/object_centric_dfg_struct.pyi +20 -0
  25. r4pm/bindings/discovery/__init__.py +6 -0
  26. r4pm/bindings/discovery/__init__.pyi +7 -0
  27. r4pm/bindings/discovery/case_centric/__init__.py +6 -0
  28. r4pm/bindings/discovery/case_centric/__init__.pyi +7 -0
  29. r4pm/bindings/discovery/case_centric/alphappp/__init__.py +5 -0
  30. r4pm/bindings/discovery/case_centric/alphappp/__init__.pyi +6 -0
  31. r4pm/bindings/discovery/case_centric/alphappp/full.py +30 -0
  32. r4pm/bindings/discovery/case_centric/alphappp/full.pyi +21 -0
  33. r4pm/bindings/discovery/case_centric/dfg.py +27 -0
  34. r4pm/bindings/discovery/case_centric/dfg.pyi +20 -0
  35. r4pm/bindings/discovery/object_centric/__init__.py +5 -0
  36. r4pm/bindings/discovery/object_centric/__init__.pyi +6 -0
  37. r4pm/bindings/discovery/object_centric/oc_declare.py +30 -0
  38. r4pm/bindings/discovery/object_centric/oc_declare.pyi +21 -0
  39. r4pm/df/__init__.py +20 -0
  40. r4pm/df/__init__.pyi +116 -0
  41. r4pm/df/ocel_export.py +33 -0
  42. r4pm/df/ocel_import.py +72 -0
  43. r4pm/df/xes_export.py +13 -0
  44. r4pm/df/xes_import.py +18 -0
  45. r4pm/py.typed +0 -0
  46. r4pm/r4pm.cpython-38-darwin.so +0 -0
  47. r4pm-0.4.0.dist-info/METADATA +183 -0
  48. r4pm-0.4.0.dist-info/RECORD +51 -0
  49. r4pm-0.4.0.dist-info/WHEEL +4 -0
  50. r4pm-0.4.0.dist-info/licenses/LICENSE-APACHE +201 -0
  51. r4pm-0.4.0.dist-info/licenses/LICENSE-MIT +21 -0
@@ -0,0 +1,6 @@
1
+ """Type stubs."""
2
+ from typing import List
3
+
4
+ from . import ocdfg as ocdfg
5
+
6
+ __all__: List[str]
@@ -0,0 +1,5 @@
1
+ """Auto-generated module."""
2
+
3
+ from .object_centric_dfg_struct import *
4
+
5
+ __all__ = []
@@ -0,0 +1,6 @@
1
+ """Type stubs."""
2
+ from typing import List
3
+
4
+ from .object_centric_dfg_struct import *
5
+
6
+ __all__: List[str]
@@ -0,0 +1,27 @@
1
+ """
2
+ Auto-generated bindings for core.process_models.object_centric.ocdfg.object_centric_dfg_struct
3
+
4
+ DO NOT EDIT - Generated by build.rs
5
+ """
6
+ from typing import Any, Dict, List, Optional
7
+
8
+ def discover_dfg_from_locel(locel: str) -> Dict[str, Any]:
9
+ """
10
+ Construct a [`OCDirectlyFollowsGraph`] from an [`IndexLinkedOCEL`]
11
+
12
+ Args:
13
+ locel: Registry ID for IndexLinkedOCEL
14
+
15
+ Returns:
16
+ Dict[str, Any]
17
+ """
18
+ import json
19
+ from ......r4pm import call_binding
20
+ args_dict = {}
21
+ args_dict["locel"] = locel
22
+ result = call_binding("process_mining::core::process_models::object_centric::ocdfg::object_centric_dfg_struct::discover_dfg_from_locel", json.dumps(args_dict))
23
+ return json.loads(result)
24
+
25
+ __all__ = [
26
+ "discover_dfg_from_locel",
27
+ ]
@@ -0,0 +1,20 @@
1
+ """
2
+ Type stubs for core.process_models.object_centric.ocdfg.object_centric_dfg_struct
3
+
4
+ DO NOT EDIT - Generated by build.rs
5
+ """
6
+ from typing import Any, Dict, List, Optional
7
+
8
+ def discover_dfg_from_locel(locel: str) -> Dict[str, Any]:
9
+ """
10
+ Construct a [`OCDirectlyFollowsGraph`] from an [`IndexLinkedOCEL`]
11
+
12
+ Args:
13
+ locel: Registry ID for IndexLinkedOCEL
14
+
15
+ Returns:
16
+ Dict[str, Any]
17
+ """
18
+ ...
19
+
20
+ __all__: List[str]
@@ -0,0 +1,6 @@
1
+ """Auto-generated module."""
2
+
3
+ from . import case_centric
4
+ from . import object_centric
5
+
6
+ __all__ = ["case_centric", "object_centric"]
@@ -0,0 +1,7 @@
1
+ """Type stubs."""
2
+ from typing import List
3
+
4
+ from . import case_centric as case_centric
5
+ from . import object_centric as object_centric
6
+
7
+ __all__: List[str]
@@ -0,0 +1,6 @@
1
+ """Auto-generated module."""
2
+
3
+ from . import alphappp
4
+ from .dfg import *
5
+
6
+ __all__ = ["alphappp"]
@@ -0,0 +1,7 @@
1
+ """Type stubs."""
2
+ from typing import List
3
+
4
+ from . import alphappp as alphappp
5
+ from .dfg import *
6
+
7
+ __all__: List[str]
@@ -0,0 +1,5 @@
1
+ """Auto-generated module."""
2
+
3
+ from .full import *
4
+
5
+ __all__ = []
@@ -0,0 +1,6 @@
1
+ """Type stubs."""
2
+ from typing import List
3
+
4
+ from .full import *
5
+
6
+ __all__: List[str]
@@ -0,0 +1,30 @@
1
+ """
2
+ Auto-generated bindings for discovery.case_centric.alphappp.full
3
+
4
+ DO NOT EDIT - Generated by build.rs
5
+ """
6
+ from typing import Any, Dict, List, Optional
7
+
8
+ def discover_alphaplusplusplus(log_proj: str, config: Optional[Dict[str, Any]] = None) -> Dict[str, Any]:
9
+ """
10
+ Discover a [`PetriNet`] using the Alpha+++ Process Discovery algorithm
11
+
12
+ Args:
13
+ log_proj: Registry ID for EventLogActivityProjection
14
+ config: Algorithm parameters for Alpha+++
15
+
16
+ Returns:
17
+ Dict[str, Any]
18
+ """
19
+ import json
20
+ from .....r4pm import call_binding
21
+ args_dict = {}
22
+ args_dict["log_proj"] = log_proj
23
+ if config is not None:
24
+ args_dict["config"] = config
25
+ result = call_binding("process_mining::discovery::case_centric::alphappp::full::alphappp_discover_petri_net", json.dumps(args_dict))
26
+ return json.loads(result)
27
+
28
+ __all__ = [
29
+ "discover_alphaplusplusplus",
30
+ ]
@@ -0,0 +1,21 @@
1
+ """
2
+ Type stubs for discovery.case_centric.alphappp.full
3
+
4
+ DO NOT EDIT - Generated by build.rs
5
+ """
6
+ from typing import Any, Dict, List, Optional
7
+
8
+ def discover_alphaplusplusplus(log_proj: str, config: Optional[Dict[str, Any]] = None) -> Dict[str, Any]:
9
+ """
10
+ Discover a [`PetriNet`] using the Alpha+++ Process Discovery algorithm
11
+
12
+ Args:
13
+ log_proj: Registry ID for EventLogActivityProjection
14
+ config: Algorithm parameters for Alpha+++
15
+
16
+ Returns:
17
+ Dict[str, Any]
18
+ """
19
+ ...
20
+
21
+ __all__: List[str]
@@ -0,0 +1,27 @@
1
+ """
2
+ Auto-generated bindings for discovery.case_centric.dfg
3
+
4
+ DO NOT EDIT - Generated by build.rs
5
+ """
6
+ from typing import Any, Dict, List, Optional
7
+
8
+ def discover_dfg(event_log: str) -> Dict[str, Any]:
9
+ """
10
+ Discover [`DirectlyFollowsGraph`] with default classifier
11
+
12
+ Args:
13
+ event_log: Registry ID for EventLog
14
+
15
+ Returns:
16
+ Dict[str, Any]
17
+ """
18
+ import json
19
+ from ....r4pm import call_binding
20
+ args_dict = {}
21
+ args_dict["event_log"] = event_log
22
+ result = call_binding("process_mining::discovery::case_centric::dfg::discover_dfg", json.dumps(args_dict))
23
+ return json.loads(result)
24
+
25
+ __all__ = [
26
+ "discover_dfg",
27
+ ]
@@ -0,0 +1,20 @@
1
+ """
2
+ Type stubs for discovery.case_centric.dfg
3
+
4
+ DO NOT EDIT - Generated by build.rs
5
+ """
6
+ from typing import Any, Dict, List, Optional
7
+
8
+ def discover_dfg(event_log: str) -> Dict[str, Any]:
9
+ """
10
+ Discover [`DirectlyFollowsGraph`] with default classifier
11
+
12
+ Args:
13
+ event_log: Registry ID for EventLog
14
+
15
+ Returns:
16
+ Dict[str, Any]
17
+ """
18
+ ...
19
+
20
+ __all__: List[str]
@@ -0,0 +1,5 @@
1
+ """Auto-generated module."""
2
+
3
+ from .oc_declare import *
4
+
5
+ __all__ = []
@@ -0,0 +1,6 @@
1
+ """Type stubs."""
2
+ from typing import List
3
+
4
+ from .oc_declare import *
5
+
6
+ __all__: List[str]
@@ -0,0 +1,30 @@
1
+ """
2
+ Auto-generated bindings for discovery.object_centric.oc_declare
3
+
4
+ DO NOT EDIT - Generated by build.rs
5
+ """
6
+ from typing import Any, Dict, List, Optional
7
+
8
+ def discover_oc_declare(locel: str, options: Optional[Dict[str, Any]] = None) -> List[Any]:
9
+ """
10
+ Discover behavioral OC-DECLARE constraints
11
+
12
+ Args:
13
+ locel: Registry ID for SlimLinkedOCEL
14
+ options: Options for the automatic discovery of OC-DECLARE constraints
15
+
16
+ Returns:
17
+ List[Any]
18
+ """
19
+ import json
20
+ from ....r4pm import call_binding
21
+ args_dict = {}
22
+ args_dict["locel"] = locel
23
+ if options is not None:
24
+ args_dict["options"] = options
25
+ result = call_binding("process_mining::discovery::object_centric::oc_declare::discover_behavior_constraints", json.dumps(args_dict))
26
+ return json.loads(result)
27
+
28
+ __all__ = [
29
+ "discover_oc_declare",
30
+ ]
@@ -0,0 +1,21 @@
1
+ """
2
+ Type stubs for discovery.object_centric.oc_declare
3
+
4
+ DO NOT EDIT - Generated by build.rs
5
+ """
6
+ from typing import Any, Dict, List, Optional
7
+
8
+ def discover_oc_declare(locel: str, options: Optional[Dict[str, Any]] = None) -> List[Any]:
9
+ """
10
+ Discover behavioral OC-DECLARE constraints
11
+
12
+ Args:
13
+ locel: Registry ID for SlimLinkedOCEL
14
+ options: Options for the automatic discovery of OC-DECLARE constraints
15
+
16
+ Returns:
17
+ List[Any]
18
+ """
19
+ ...
20
+
21
+ __all__: List[str]
r4pm/df/__init__.py ADDED
@@ -0,0 +1,20 @@
1
+ """
2
+ Simple DataFrame API for r4pm
3
+
4
+ Import/Export:
5
+ - import_xes, export_xes: XES event logs
6
+ - import_ocel, import_ocel_pm4py, ...: OCEL2 object-centric logs
7
+ """
8
+ from .ocel_import import (
9
+ import_ocel,
10
+ import_ocel_pm4py,
11
+ import_ocel_xml,
12
+ import_ocel_xml_pm4py,
13
+ import_ocel_json,
14
+ import_ocel_json_pm4py,
15
+ rs_ocel_to_pm4py
16
+ )
17
+ from .ocel_export import export_ocel, export_ocel_pm4py
18
+
19
+ from .xes_import import import_xes
20
+ from .xes_export import export_xes
r4pm/df/__init__.pyi ADDED
@@ -0,0 +1,116 @@
1
+ from typing import Any, Dict, Optional
2
+ import polars as pl
3
+
4
+ # ============================================================================
5
+ # XES Import/Export
6
+ # ============================================================================
7
+
8
+ def import_xes(
9
+ path: str,
10
+ date_format: Optional[str] = None,
11
+ print_debug: Optional[bool] = None
12
+ ) -> tuple[pl.DataFrame, str]:
13
+ """
14
+ Import XES event log.
15
+
16
+ Args:
17
+ path: Path to .xes or .xes.gz file
18
+ date_format: Optional date format for parsing (see chrono strftime)
19
+ print_debug: Enable debug output
20
+
21
+ Returns:
22
+ Tuple of (DataFrame with events, JSON string with log metadata)
23
+ """
24
+ ...
25
+
26
+ def export_xes(df: pl.DataFrame, path: str) -> None:
27
+ """
28
+ Export DataFrame as XES file.
29
+
30
+ Args:
31
+ df: Polars DataFrame with event data
32
+ path: Output path (.xes or .xes.gz)
33
+ """
34
+ ...
35
+
36
+ # ============================================================================
37
+ # OCEL Import
38
+ # ============================================================================
39
+
40
+ def rs_ocel_to_pm4py(ocel_rs: Dict[str, pl.DataFrame]) -> Any:
41
+ """
42
+ Convert Polars OCEL DataFrames to PM4PY OCEL object.
43
+
44
+ Args:
45
+ ocel_rs: Dict of DataFrames from import_ocel_xml/json
46
+
47
+ Returns:
48
+ PM4PY OCEL object
49
+ """
50
+ ...
51
+
52
+ def import_ocel_xml(path: str) -> Dict[str, pl.DataFrame]:
53
+ """
54
+ Import OCEL2 from XML.
55
+
56
+ Returns:
57
+ Dict with DataFrames: 'events', 'objects', 'relations', 'o2o', 'object_changes'
58
+ """
59
+ ...
60
+
61
+ def import_ocel_xml_pm4py(path: str) -> Any:
62
+ """
63
+ Import OCEL2 XML and convert to PM4PY format.
64
+ """
65
+ ...
66
+
67
+ def import_ocel_json(path: str) -> Dict[str, pl.DataFrame]:
68
+ """
69
+ Import OCEL2 from JSON.
70
+
71
+ Returns:
72
+ Dict with DataFrames: 'events', 'objects', 'relations', 'o2o', 'object_changes'
73
+ """
74
+ ...
75
+
76
+ def import_ocel_json_pm4py(path: str) -> Any:
77
+ """
78
+ Import OCEL2 JSON and convert to PM4PY format.
79
+ """
80
+ ...
81
+
82
+ def import_ocel(path: str) -> dict[str, pl.DataFrame]:
83
+ """
84
+ Import OCEL2 from File.
85
+
86
+ Returns:
87
+ Dict with DataFrames: 'events', 'objects', 'relations', 'o2o', 'object_changes'
88
+ """
89
+ ...
90
+
91
+ def import_ocel_pm4py(path: str):
92
+ """Import OCEL2 JSON and convert to PM4PY format."""
93
+ ...
94
+
95
+
96
+ def export_ocel(ocel: dict[str, pl.DataFrame], path: str):
97
+ """
98
+ Export Polars OCEL DataFrames to File
99
+
100
+ Args:
101
+ ocel: Dict of DataFrames from import_ocel_xml/json
102
+ path: Output path (e.g., .ocel.xml or .ocel.json)
103
+
104
+ """
105
+ ...
106
+
107
+ def export_ocel_pm4py(ocel, path: str):
108
+ """
109
+ Export PM4Py OCEL to File
110
+
111
+ Args:
112
+ ocel: PM4Py OCEL object
113
+ path: Output path (e.g., .ocel.xml or .ocel.json)
114
+
115
+ """
116
+ ...
r4pm/df/ocel_export.py ADDED
@@ -0,0 +1,33 @@
1
+ import polars
2
+
3
+ from ..r4pm import export_ocel_rs
4
+
5
+ def export_ocel(ocel: dict[str, polars.DataFrame], path: str):
6
+ """
7
+ Export Polars OCEL DataFrames to File
8
+
9
+ Args:
10
+ ocel: Dict of DataFrames from import_ocel_xml/json
11
+ path: Output path (e.g., .ocel.xml or .ocel.json)
12
+
13
+ """
14
+ export_ocel_rs(ocel, path)
15
+
16
+
17
+ def export_ocel_pm4py(ocel, path: str):
18
+ """
19
+ Export PM4Py OCEL to File
20
+
21
+ Args:
22
+ ocel: PM4Py OCEL object
23
+ path: Output path (e.g., .ocel.xml or .ocel.json)
24
+
25
+ """
26
+ ocel = {
27
+ "events": polars.from_pandas(ocel.events),
28
+ "objects": polars.from_pandas(ocel.objects),
29
+ "relations": polars.from_pandas(ocel.relations),
30
+ "object_changes": polars.from_pandas(ocel.object_changes),
31
+ "o2o": polars.from_pandas(ocel.o2o),
32
+ }
33
+ export_ocel_rs(ocel, path)
r4pm/df/ocel_import.py ADDED
@@ -0,0 +1,72 @@
1
+ import polars as pl
2
+
3
+ from ..r4pm import import_ocel_xml_rs, import_ocel_json_rs, import_ocel_rs
4
+
5
+ def rs_ocel_to_pm4py(ocel_rs: dict[str, pl.DataFrame]):
6
+ """
7
+ Convert Polars OCEL DataFrames to PM4PY OCEL object.
8
+
9
+ Args:
10
+ ocel_rs: Dict of DataFrames from import_ocel_xml/json
11
+
12
+ Returns:
13
+ PM4PY OCEL object
14
+ """
15
+ import pm4py
16
+ ocel_pm4py = pm4py.ocel.OCEL(
17
+ events=ocel_rs["events"].to_pandas().convert_dtypes(),
18
+ objects=ocel_rs["objects"].to_pandas().convert_dtypes(),
19
+ relations=ocel_rs["relations"].to_pandas().convert_dtypes(),
20
+ object_changes=ocel_rs["object_changes"].to_pandas().convert_dtypes(),
21
+ globals={},
22
+ o2o=ocel_rs["o2o"].to_pandas().convert_dtypes(),
23
+ parameters={
24
+ pm4py.objects.ocel.obj.Parameters.EVENT_ID: "ocel:eid",
25
+ pm4py.objects.ocel.obj.Parameters.EVENT_ACTIVITY: "ocel:activity",
26
+ pm4py.objects.ocel.obj.Parameters.EVENT_TIMESTAMP: "ocel:timestamp",
27
+ pm4py.objects.ocel.obj.Parameters.OBJECT_ID: "ocel:oid",
28
+ pm4py.objects.ocel.obj.Parameters.OBJECT_TYPE: "ocel:type",
29
+ pm4py.objects.ocel.obj.Parameters.QUALIFIER: "ocel:qualifier",
30
+ pm4py.objects.ocel.obj.Parameters.CHANGED_FIELD: "ocel:field",
31
+ },
32
+ )
33
+ return ocel_pm4py
34
+
35
+ def import_ocel_xml(path: str) -> dict[str, pl.DataFrame]:
36
+ """
37
+ Import OCEL2 from XML.
38
+
39
+ Returns:
40
+ Dict with DataFrames: 'events', 'objects', 'relations', 'o2o', 'object_changes'
41
+ """
42
+ return import_ocel_xml_rs(path)
43
+
44
+ def import_ocel_xml_pm4py(path: str):
45
+ """Import OCEL2 XML and convert to PM4PY format."""
46
+ return rs_ocel_to_pm4py(import_ocel_xml(path))
47
+
48
+ def import_ocel_json(path: str) -> dict[str, pl.DataFrame]:
49
+ """
50
+ Import OCEL2 from JSON.
51
+
52
+ Returns:
53
+ Dict with DataFrames: 'events', 'objects', 'relations', 'o2o', 'object_changes'
54
+ """
55
+ return import_ocel_json_rs(path)
56
+
57
+ def import_ocel_json_pm4py(path: str):
58
+ """Import OCEL2 JSON and convert to PM4PY format."""
59
+ return rs_ocel_to_pm4py(import_ocel_json(path))
60
+
61
+ def import_ocel(path: str) -> dict[str, pl.DataFrame]:
62
+ """
63
+ Import OCEL2 from File.
64
+
65
+ Returns:
66
+ Dict with DataFrames: 'events', 'objects', 'relations', 'o2o', 'object_changes'
67
+ """
68
+ return import_ocel_rs(path)
69
+
70
+ def import_ocel_pm4py(path: str):
71
+ """Import OCEL2 JSON and convert to PM4PY format."""
72
+ return rs_ocel_to_pm4py(import_ocel(path))
r4pm/df/xes_export.py ADDED
@@ -0,0 +1,13 @@
1
+ import polars
2
+
3
+ from ..r4pm import export_xes_rs
4
+
5
+ def export_xes(df: polars.DataFrame, path: str):
6
+ """
7
+ Export DataFrame as XES file.
8
+
9
+ Args:
10
+ df: Polars DataFrame with event data
11
+ path: Output path (.xes or .xes.gz)
12
+ """
13
+ return export_xes_rs(df, path)
r4pm/df/xes_import.py ADDED
@@ -0,0 +1,18 @@
1
+ from typing import Optional
2
+ import polars
3
+
4
+ from ..r4pm import import_xes_rs
5
+
6
+ def import_xes(path: str, date_format: Optional[str] = None, print_debug: Optional[bool] = None) -> tuple[polars.DataFrame, str]:
7
+ """
8
+ Import XES event log.
9
+
10
+ Args:
11
+ path: Path to .xes or .xes.gz file
12
+ date_format: Optional date format for parsing (see chrono strftime)
13
+ print_debug: Enable debug output
14
+
15
+ Returns:
16
+ Tuple of (DataFrame with events, JSON string with log metadata)
17
+ """
18
+ return import_xes_rs(path, date_format, print_debug)
r4pm/py.typed ADDED
File without changes
Binary file