From 4fbf4c644cc86290f45417b77b766a637b64e7c5 Mon Sep 17 00:00:00 2001 From: Sven Thiele Date: Mon, 3 Mar 2014 11:08:03 +0100 Subject: [PATCH 1/5] ported to new clasp --- setup.py | 4 ++-- src/query.py | 6 +++--- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/setup.py b/setup.py index 35a3255..c0fef41 100644 --- a/setup.py +++ b/setup.py @@ -33,7 +33,7 @@ def run(self): setup(cmdclass={'install': install}, name='ingranalyze', - version='1.4', + version='1.5dev', url='http://pypi.python.org/pypi/ingranalyze/', license='GPLv3+', description='Influence graph analysis, consistency check, diagnosis, repair and prediction ', @@ -45,6 +45,6 @@ def run(self): package_data = {'__ingranalyze__' : ['encodings/*.lp','encodings/*.gringo']}, scripts = ['ingranalyze.py'], install_requires=[ - "pyasp >= 1.2" + "pyasp >= 1.3" ] ) diff --git a/src/query.py b/src/query.py index 0c775d0..7696463 100644 --- a/src/query.py +++ b/src/query.py @@ -92,7 +92,7 @@ def get_minimal_inconsistent_cores(instance,nmodels=0,exclude=[]): inputs = get_reductions(instance) prg = [ dyn_mic_prg, inputs.to_file(), instance.to_file(), exclude_sol(exclude) ] options='--heuristic=Vmtf' - solver = GringoClaspD(clasp_options=options) + solver = GringoClasp(clasp_options=options) models = solver.run(prg,nmodels=0,collapseTerms=True, collapseAtoms=False) os.unlink(prg[1]) os.unlink(prg[2]) @@ -182,7 +182,7 @@ def get_minimal_repair_sets(instance, repair_options ,optimum,nmodels=0,exclude= instance2 = instance.union(inputs) prg = [ instance2.to_file(), repair_options.to_file(), exclude_sol(exclude), repair_core_prg, repair_cardinality_prg ] - options='--project --opt-all='+str(optimum) + options='--project --opt-mode=optN' solver = GringoClasp(clasp_options=options) models = solver.run(prg,nmodels=0, collapseTerms=True, collapseAtoms=False) os.unlink(prg[0]) @@ -202,7 +202,7 @@ def get_predictions_under_minimal_repair(instance, repair_options, optimum): prg = [ instance2.to_file(), repair_options.to_file(), prediction_core_prg, repair_cardinality_prg ] - options='--project --enum-mode cautious --opt-all='+str(optimum) + options='--project --enum-mode cautious --opt-mode=optN' solver = GringoClasp(clasp_options=options) models = solver.run(prg,nmodels=0,collapseTerms=True, collapseAtoms=False) os.unlink(prg[0]) From aa7f07d48719fbf40911b7d57448b283c8f88fc7 Mon Sep 17 00:00:00 2001 From: Sven Thiele Date: Tue, 4 Mar 2014 11:57:32 +0100 Subject: [PATCH 2/5] use pyasp-1.3, version bump to ingranalyze-1.5 --- CHANGES.txt | 4 ++++ setup.py | 4 ++-- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGES.txt b/CHANGES.txt index a21d197..3209688 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,3 +1,7 @@ +1.4 +---------------- +use pyasp-1.3 + 1.0 (unreleased) ---------------- Initial release \ No newline at end of file diff --git a/setup.py b/setup.py index c0fef41..a1e9851 100644 --- a/setup.py +++ b/setup.py @@ -33,7 +33,7 @@ def run(self): setup(cmdclass={'install': install}, name='ingranalyze', - version='1.5dev', + version='1.5', url='http://pypi.python.org/pypi/ingranalyze/', license='GPLv3+', description='Influence graph analysis, consistency check, diagnosis, repair and prediction ', @@ -45,6 +45,6 @@ def run(self): package_data = {'__ingranalyze__' : ['encodings/*.lp','encodings/*.gringo']}, scripts = ['ingranalyze.py'], install_requires=[ - "pyasp >= 1.3" + "pyasp == 1.3" ] ) From b415703fd7227a75626f3766d312fa3fa3265371 Mon Sep 17 00:00:00 2001 From: Sven Thiele Date: Tue, 4 Mar 2014 12:10:23 +0100 Subject: [PATCH 3/5] change GringoClaspOpt to GringoClasp --- src/query.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/query.py b/src/query.py index 7696463..bef3913 100644 --- a/src/query.py +++ b/src/query.py @@ -169,8 +169,9 @@ def get_minimum_of_repairs(instance,repair_options,exclude=[]): instance2 = instance.union(inputs) prg = [ instance2.to_file(),repair_options.to_file(), exclude_sol(exclude), repair_core_prg, repair_cardinality_prg ] - solver = GringoClaspOpt() - optimum = solver.run(prg) + solver = GringoClasp() + optimum = solver.run(prg,nmodels=0) + print optimum os.unlink(prg[0]) os.unlink(prg[1]) os.unlink(prg[2]) From 1b112d644daedb8b66937c80edc0394b00e56677 Mon Sep 17 00:00:00 2001 From: Sven Thiele Date: Tue, 4 Mar 2014 12:11:52 +0100 Subject: [PATCH 4/5] remove print --- src/query.py | 1 - 1 file changed, 1 deletion(-) diff --git a/src/query.py b/src/query.py index bef3913..d53920c 100644 --- a/src/query.py +++ b/src/query.py @@ -171,7 +171,6 @@ def get_minimum_of_repairs(instance,repair_options,exclude=[]): solver = GringoClasp() optimum = solver.run(prg,nmodels=0) - print optimum os.unlink(prg[0]) os.unlink(prg[1]) os.unlink(prg[2]) From 3fe56ba60bbbc98052c223b72798a467829c842f Mon Sep 17 00:00:00 2001 From: Sven Thiele Date: Tue, 4 Mar 2014 12:15:37 +0100 Subject: [PATCH 5/5] correct CHANGES.txt --- CHANGES.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES.txt b/CHANGES.txt index 3209688..63afb2f 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,4 +1,4 @@ -1.4 +1.5 ---------------- use pyasp-1.3