Unverified Commit 58dbc902 authored by René Fritze's avatar René Fritze Committed by GitHub
Browse files

Merge pull request #1690 from pymor/fix_instationary_nn_demo_skip

fix instationary nn demo skip
parents 8adc6748 cf339c02
Pipeline #150395 passed with stages
in 31 minutes and 50 seconds
......@@ -5,6 +5,8 @@
from typer import Argument, run
from pymor.core.config import config
def main(
dim: int = Argument(..., help='Spatial dimension of the problem.'),
......@@ -13,6 +15,7 @@ def main(
):
"""Reduces a FEniCS-based nonlinear diffusion problem using POD/DEIM."""
from pymor.tools import mpi
config.require("FENICS")
if mpi.parallel:
from pymor.models.mpi import mpi_wrap_model
......
......@@ -9,7 +9,6 @@ from typer import Argument, Option, run
from pymor.basic import *
from pymor.core.config import config
from pymor.core.exceptions import TorchMissing
from pymor.reductors.neural_network import (NeuralNetworkInstationaryReductor,
NeuralNetworkInstationaryStatefreeOutputReductor)
from pymor.tools import mpi
......@@ -33,8 +32,7 @@ def main(
one-dimensional domain. The discretization is based on pyMOR's built-in
functionality.
"""
if not config.HAVE_TORCH:
raise TorchMissing()
config.require("TORCH")
fom, plot_function = create_fom(problem_number, grid_intervals, time_steps)
......@@ -122,6 +120,7 @@ def main(
def create_fom(problem_number, grid_intervals, time_steps):
print('Discretize ...')
if problem_number == 0:
config.require("FENICS")
fom, plot_function = discretize_navier_stokes(grid_intervals, time_steps)
elif problem_number == 1:
problem = burgers_problem()
......
......@@ -15,6 +15,7 @@ from typer import Argument, run
from pymor.basic import *
from pymor.tools.typer import Choices
from pymor.core.config import config
# parameters for high-dimensional models
......@@ -50,6 +51,7 @@ def main(
elif model == 'fenics':
fom, parameter_space = discretize_fenics()
elif model == 'ngsolve':
config.require("NGSOLVE")
fom, parameter_space = discretize_ngsolve()
elif model == 'pymor_text':
fom, parameter_space = discretize_pymor_text()
......
......@@ -174,7 +174,8 @@ DEMO_ARGS = [(f'pymordemos.{a}', b) for (a, b) in DEMO_ARGS]
def _skip_if_no_solver(param):
demo, args = param
from pymor.core.config import config
for solver, package in [('fenics', None), ('ngsolve', None), ('neural_', 'TORCH')]:
for solver, package in [('fenics', None), ('ngsolve', None), ('neural_', 'TORCH'),
('neural_networks_instationary', 'FENICS')]:
package = package or solver.upper()
needs_solver = len([f for f in args if solver in str(f)]) > 0 or demo.find(solver) >= 0
has_solver = getattr(config, f'HAVE_{package}')
......
Supports Markdown
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