Spaces:
Running
Running
Andrea Maldonado
commited on
Commit
·
5108dc0
1
Parent(s):
8dcad92
Merges demo_icpm24
Browse files- .github/workflows/test_gedi.yml +62 -1
- gedi/__init__.py +1 -1
- main.py +3 -45
.github/workflows/test_gedi.yml
CHANGED
@@ -6,7 +6,6 @@ on:
|
|
6 |
branches:
|
7 |
- main
|
8 |
- bpm24
|
9 |
-
- demo-icpm24
|
10 |
workflow_dispatch:
|
11 |
|
12 |
# Specifies the jobs that are to be run
|
@@ -184,3 +183,65 @@ jobs:
|
|
184 |
- name: Run test
|
185 |
run:
|
186 |
python main.py -a config_files/test/experiment_test.json
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
6 |
branches:
|
7 |
- main
|
8 |
- bpm24
|
|
|
9 |
workflow_dispatch:
|
10 |
|
11 |
# Specifies the jobs that are to be run
|
|
|
183 |
- name: Run test
|
184 |
run:
|
185 |
python main.py -a config_files/test/experiment_test.json
|
186 |
+
|
187 |
+
test_grid_experiments_script:
|
188 |
+
runs-on: ubuntu-latest
|
189 |
+
|
190 |
+
# Setting up a python envronment for the test script to run
|
191 |
+
steps:
|
192 |
+
- name: Checkout code
|
193 |
+
uses: actions/checkout@v4
|
194 |
+
|
195 |
+
- name: Set up Python
|
196 |
+
uses: actions/setup-python@v5
|
197 |
+
with:
|
198 |
+
python-version: 3.9
|
199 |
+
|
200 |
+
- name: Install dependencies
|
201 |
+
run: |
|
202 |
+
sudo apt-get install build-essential python3 python3-dev
|
203 |
+
|
204 |
+
- name: Install feeed
|
205 |
+
run: |
|
206 |
+
python -m pip install --upgrade pip
|
207 |
+
pip install .
|
208 |
+
|
209 |
+
- name: Run test
|
210 |
+
run:
|
211 |
+
python gedi/utils/execute_grid_experiments.py config_files/test
|
212 |
+
|
213 |
+
- name: Convert output and validation to same encoding
|
214 |
+
run: iconv -f UTF-8 -t ASCII output/features/generated/2_bpic_features/2_ense_enseef_feat.csv > data/validation/2_ense_enseef_feat.csv
|
215 |
+
|
216 |
+
- name: Compare output
|
217 |
+
run: diff data/validation/2_ense_enseef_feat.csv output/features/generated/2_bpic_features/2_ense_enseef_feat.csv
|
218 |
+
|
219 |
+
test_abbrv:
|
220 |
+
runs-on: ubuntu-latest
|
221 |
+
|
222 |
+
# Setting up a python envronment for the test script to run
|
223 |
+
steps:
|
224 |
+
- name: Checkout code
|
225 |
+
uses: actions/checkout@v4
|
226 |
+
|
227 |
+
- name: Set up Python
|
228 |
+
uses: actions/setup-python@v5
|
229 |
+
with:
|
230 |
+
python-version: 3.9
|
231 |
+
|
232 |
+
- name: Install dependencies
|
233 |
+
run: |
|
234 |
+
sudo apt-get install build-essential python3 python3-dev
|
235 |
+
|
236 |
+
- name: Install feeed
|
237 |
+
run: |
|
238 |
+
python -m pip install --upgrade pip
|
239 |
+
pip install .
|
240 |
+
|
241 |
+
- name: Run test
|
242 |
+
run:
|
243 |
+
python main.py -a config_files/test/test_abbrv_generation.json
|
244 |
+
|
245 |
+
- name: Compare output
|
246 |
+
run:
|
247 |
+
diff data/validation/2_ense_rmcv_feat.csv output/test/igedi_table_1/2_ense_rmcv_feat.csv
|
gedi/__init__.py
CHANGED
@@ -1,3 +1,3 @@
|
|
1 |
from .run import gedi
|
2 |
|
3 |
-
__all__=[
|
|
|
1 |
from .run import gedi
|
2 |
|
3 |
+
__all__=['gedi']
|
main.py
CHANGED
@@ -1,54 +1,12 @@
|
|
1 |
import config
|
2 |
-
import pandas as pd
|
3 |
from datetime import datetime as dt
|
4 |
-
from gedi.
|
5 |
-
from gedi.features import EventLogFeatures
|
6 |
-
from gedi.augmentation import InstanceAugmentator
|
7 |
-
from gedi.benchmark import BenchmarkTest
|
8 |
-
from gedi.plotter import BenchmarkPlotter, FeaturesPlotter, AugmentationPlotter, GenerationPlotter
|
9 |
from utils.default_argparse import ArgParser
|
10 |
from utils.param_keys import *
|
11 |
|
12 |
-
def run(kwargs:dict, model_paramas_list: list, filename_list:list):
|
13 |
-
"""
|
14 |
-
This function chooses the running option for the program.
|
15 |
-
@param kwargs: dict
|
16 |
-
contains the running parameters and the event-log file information
|
17 |
-
@param model_params_list: list
|
18 |
-
contains a list of model parameters, which are used to analyse this different models.
|
19 |
-
@param filename_list: list
|
20 |
-
contains the list of the filenames to load multiple event-logs
|
21 |
-
@return:
|
22 |
-
"""
|
23 |
-
params = kwargs[PARAMS]
|
24 |
-
ft = EventLogFeatures(None)
|
25 |
-
augmented_ft = InstanceAugmentator()
|
26 |
-
gen = pd.DataFrame(columns=['log'])
|
27 |
-
|
28 |
-
for model_params in model_params_list:
|
29 |
-
if model_params.get(PIPELINE_STEP) == 'instance_augmentation':
|
30 |
-
augmented_ft = InstanceAugmentator(aug_params=model_params, samples=ft.feat)
|
31 |
-
AugmentationPlotter(augmented_ft, model_params)
|
32 |
-
elif model_params.get(PIPELINE_STEP) == 'event_logs_generation':
|
33 |
-
gen = pd.DataFrame(GenerateEventLogs(model_params).log_config)
|
34 |
-
#gen = pd.read_csv("output/features/generated/grid_2objectives_enseef_enve/2_enseef_enve_feat.csv")
|
35 |
-
#GenerationPlotter(gen, model_params, output_path="output/plots")
|
36 |
-
elif model_params.get(PIPELINE_STEP) == 'benchmark_test':
|
37 |
-
benchmark = BenchmarkTest(model_params, event_logs=gen['log'])
|
38 |
-
# BenchmarkPlotter(benchmark.features, output_path="output/plots")
|
39 |
-
elif model_params.get(PIPELINE_STEP) == 'feature_extraction':
|
40 |
-
ft = EventLogFeatures(**kwargs, logs=gen['log'], ft_params=model_params)
|
41 |
-
FeaturesPlotter(ft.feat, model_params)
|
42 |
-
elif model_params.get(PIPELINE_STEP) == "evaluation_plotter":
|
43 |
-
GenerationPlotter(gen, model_params, output_path=model_params['output_path'], input_path=model_params['input_path'])
|
44 |
-
|
45 |
-
|
46 |
if __name__=='__main__':
|
47 |
start_gedi = dt.now()
|
48 |
print(f'INFO: GEDI starting {start_gedi}')
|
49 |
-
|
50 |
args = ArgParser().parse('GEDI main')
|
51 |
-
|
52 |
-
|
53 |
-
|
54 |
-
print(f'SUCCESS: GEDI took {dt.now()-start_gedi} sec.')
|
|
|
1 |
import config
|
|
|
2 |
from datetime import datetime as dt
|
3 |
+
from gedi.run import gedi, run
|
|
|
|
|
|
|
|
|
4 |
from utils.default_argparse import ArgParser
|
5 |
from utils.param_keys import *
|
6 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
7 |
if __name__=='__main__':
|
8 |
start_gedi = dt.now()
|
9 |
print(f'INFO: GEDI starting {start_gedi}')
|
|
|
10 |
args = ArgParser().parse('GEDI main')
|
11 |
+
gedi(args.alg_params_json)
|
12 |
+
print(f'SUCCESS: GEDI took {dt.now()-start_gedi} sec.')
|
|
|
|