Commit 9f704a2f authored by Stephan Rave's avatar Stephan Rave Committed by René Fritze

[demos] convert new demos to typer app

parent 3a4b4043
......@@ -10,11 +10,12 @@ import numpy as np
import scipy.linalg as spla
import matplotlib as mpl
import matplotlib.pyplot as plt
from typer import run
from pymor.basic import *
def run_demo():
def main():
# # Model
# In[ ]:
......@@ -131,4 +132,4 @@ def run_demo():
if __name__ == "__main__":
run_demo()
run(main)
......@@ -15,6 +15,7 @@ import numpy as np
import scipy.linalg as spla
import matplotlib.pyplot as plt
import matplotlib as mpl
from typer import run
from pymor.basic import *
from pymor.core.config import config
......@@ -22,7 +23,7 @@ from pymor.core.config import config
from pymor.core.logger import set_log_levels
def run_demo():
def main():
set_log_levels({'pymor.algorithms.gram_schmidt.gram_schmidt': 'WARNING'})
set_defaults({'pymor.discretizers.builtin.gui.jupyter.get_visualizer.backend': 'not pythreejs'})
......@@ -286,4 +287,4 @@ def run_demo():
plt.show()
if __name__ == "__main__":
run_demo()
run(main)
......@@ -13,6 +13,7 @@
import numpy as np
import scipy.sparse as sps
import matplotlib.pyplot as plt
from typer import run
from pymor.basic import *
from pymor.core.config import config
......@@ -20,7 +21,7 @@ from pymor.core.config import config
from pymor.core.logger import set_log_levels
def run_demo():
def main():
set_log_levels({'pymor.algorithms.gram_schmidt.gram_schmidt': 'WARNING'})
......@@ -664,4 +665,4 @@ def run_demo():
if __name__ == "__main__":
run_demo()
run(main)
......@@ -11,6 +11,7 @@ import scipy.linalg as spla
import scipy.sparse as sps
import matplotlib.pyplot as plt
import matplotlib as mpl
from typer import run
from pymor.core.config import config
from pymor.models.iosys import LTIModel
......@@ -20,7 +21,7 @@ from pymor.reductors.bt import BTReductor
from pymor.reductors.h2 import IRKAReductor
def run_demo():
def main():
# # Model
#
# https://morwiki.mpi-magdeburg.mpg.de/morwiki/index.php/Synthetic_parametric_model
......@@ -231,4 +232,4 @@ def run_demo():
plt.show()
if __name__ == "__main__":
run_demo()
run(main)
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment