Repository: CUQI-DTU/CUQIpy-FEniCS (language: python)

Issue:
Update CUQIpy-FEniCS plugin to reflect naming changes in CUQIpy



Discussion / hints:

Fix patch:
diff --git a/demos/demo05_reuse_assemble.py b/demos/demo05_reuse_assemble.py
index aaab676..7ad39c7 100644
--- a/demos/demo05_reuse_assemble.py
+++ b/demos/demo05_reuse_assemble.py
@@ -120,7 +120,7 @@ def rhs_form2(m,p):
 #%% 3.1. Sample the posterior (Case 1: no reuse of assembled operators)
 Ns = 100
 np.random.seed(0) # fix seed for reproducibility 
-sampler = cuqi.sampler.MetropolisHastings(cuqi_posterior)
+sampler = cuqi.sampler.MH(cuqi_posterior)
 t0 = time.time()
 samples1 = sampler.sample_adapt(Ns,Nb=10)
 t1 = time.time()
@@ -134,7 +134,7 @@ def rhs_form2(m,p):
 
 #%% 3.3. Sample the posterior again (Case 2: reuse of assembled operators)
 np.random.seed(0)
-sampler = cuqi.sampler.MetropolisHastings(cuqi_posterior)
+sampler = cuqi.sampler.MH(cuqi_posterior)
 t0 = time.time()
 samples2 = sampler.sample_adapt(Ns,Nb=10)
 t1 = time.time()


Test patch:
diff --git a/tests/test_PDEModel.py b/tests/test_PDEModel.py
index 912bc94..f534daf 100644
--- a/tests/test_PDEModel.py
+++ b/tests/test_PDEModel.py
@@ -269,7 +269,7 @@ def u_boundary(x, on_boundary):
     # Sample the posterior (Case 1: no reuse of assembled operators)
     Ns = 20
     np.random.seed(0)
-    sampler = cuqi.sampler.MetropolisHastings(cuqi_posterior)
+    sampler = cuqi.sampler.MH(cuqi_posterior)
     t0 = time.time()
     samples1 = sampler.sample_adapt(Ns, Nb=10)
     t1 = time.time()
@@ -284,7 +284,7 @@ def u_boundary(x, on_boundary):
 
         # Sample the posterior again (Case 2: reuse of assembled operators)
         np.random.seed(0)
-        sampler = cuqi.sampler.MetropolisHastings(cuqi_posterior)
+        sampler = cuqi.sampler.MH(cuqi_posterior)
         t0 = time.time()
         samples2 = sampler.sample_adapt(Ns, Nb=10)
         t1 = time.time()