Commit 3f575cc5 authored by Petar Mlinarić's avatar Petar Mlinarić
Browse files

[demos] replace Options with Arguments

parent 2c28a084
Pipeline #69573 passed with stages
in 36 minutes and 26 seconds
......@@ -6,15 +6,15 @@
import matplotlib.pyplot as plt
import numpy as np
from typer import Option, run
from typer import Argument, run
from pymor.models.iosys import TransferFunction
from pymor.reductors.h2 import TFIRKAReductor
def main(
tau: float = Option(0.1, help='The time delay.'),
r: int = Option(10, help='Order of the TF-IRKA ROM.'),
tau: float = Argument(0.1, help='The time delay.'),
r: int = Argument(10, help='Order of the TF-IRKA ROM.'),
):
"""Delay demo.
......
......@@ -5,7 +5,7 @@
import numpy as np
import matplotlib.pyplot as plt
from typer import Option, run
from typer import Argument, run
from pymor.analyticalproblems.domaindescriptions import RectDomain
from pymor.analyticalproblems.elliptic import StationaryProblem
......@@ -70,8 +70,8 @@ def run_mor_method(lti, w, reductor, reductor_short_name, r, **reduce_kwargs):
def main(
diameter: float = Option(0.1, help='Diameter option for the domain discretizer.'),
r: int = Option(5, help='Order of the ROMs.'),
diameter: float = Argument(0.1, help='Diameter option for the domain discretizer.'),
r: int = Argument(5, help='Order of the ROMs.'),
):
r"""2D heat equation demo.
......
......@@ -6,13 +6,13 @@
import matplotlib.pyplot as plt
import numpy as np
from typer import Option, run
from typer import Argument, run
from pymor.models.iosys import TransferFunction
from pymor.reductors.h2 import TFIRKAReductor
def main(r: int = Option(10, help='Order of the TF-IRKA ROM.')):
def main(r: int = Argument(10, help='Order of the TF-IRKA ROM.')):
"""Parametric delay demo."""
# Model
def H(s, mu):
......
......@@ -5,7 +5,7 @@
import numpy as np
import matplotlib.pyplot as plt
from typer import Option, run
from typer import Argument, run
from pymor.analyticalproblems.domaindescriptions import LineDomain
from pymor.analyticalproblems.elliptic import StationaryProblem
......@@ -82,8 +82,8 @@ def run_mor_method_param(fom, r, w, mus, reductor_cls, reductor_short_name, **re
def main(
diameter: float = Option(0.01, help='Diameter option for the domain discretizer.'),
r: int = Option(5, help='Order of the ROMs.'),
diameter: float = Argument(0.01, help='Diameter option for the domain discretizer.'),
r: int = Argument(5, help='Order of the ROMs.'),
):
"""Parametric 1D heat equation example."""
set_log_levels({'pymor.algorithms.gram_schmidt.gram_schmidt': 'WARNING'})
......
......@@ -6,7 +6,7 @@
import numpy as np
import scipy.sparse as sps
import matplotlib.pyplot as plt
from typer import Option, run
from typer import Argument, run
from pymor.core.config import config
from pymor.core.logger import set_log_levels
......@@ -22,8 +22,8 @@ from pymordemos.parametric_heat import run_mor_method_param
def main(
n: int = Option(101, help='Order of the full second-order model (odd number).'),
r: int = Option(5, help='Order of the ROMs.'),
n: int = Argument(101, help='Order of the full second-order model (odd number).'),
r: int = Argument(5, help='Order of the ROMs.'),
):
"""Parametric string example."""
set_log_levels({'pymor.algorithms.gram_schmidt.gram_schmidt': 'WARNING'})
......
......@@ -6,7 +6,7 @@
import numpy as np
import scipy.sparse as sps
import matplotlib.pyplot as plt
from typer import Option, run
from typer import Argument, run
from pymor.core.config import config
from pymor.models.iosys import LTIModel
......@@ -18,8 +18,8 @@ from pymordemos.parametric_heat import run_mor_method_param
def main(
n: int = Option(100, help='Order of the FOM.'),
r: int = Option(10, help='Order of the ROMs.'),
n: int = Argument(100, help='Order of the FOM.'),
r: int = Argument(10, help='Order of the ROMs.'),
):
"""Synthetic parametric demo.
......
......@@ -6,7 +6,7 @@
import matplotlib.pyplot as plt
import numpy as np
import scipy.sparse as sps
from typer import Option, run
from typer import Argument, run
from pymor.core.config import config
from pymor.core.logger import set_log_levels
......@@ -20,8 +20,8 @@ from pymordemos.heat import run_mor_method
def main(
n: int = Option(101, help='Order of the full second-order model (odd number).'),
r: int = Option(5, help='Order of the ROMs.'),
n: int = Argument(101, help='Order of the full second-order model (odd number).'),
r: int = Argument(5, help='Order of the ROMs.'),
):
"""String equation example."""
set_log_levels({'pymor.algorithms.gram_schmidt.gram_schmidt': 'ERROR'})
......
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