fix codacy issues (#40)

This commit is contained in:
Nicola Demo
2022-11-29 16:43:00 +01:00
committed by GitHub
parent e6f935842e
commit b6c88bb756
4 changed files with 10 additions and 13 deletions

View File

@@ -1,4 +1,3 @@
import numpy as np
import torch import torch
from pina.problem import Problem from pina.problem import Problem
from pina.segment import Segment from pina.segment import Segment
@@ -39,11 +38,8 @@ class EllipticOptimalControl(Problem2D):
'gamma3': {'location': Segment((xmax, ymax), (xmin, ymax)), 'func': nil_dirichlet}, 'gamma3': {'location': Segment((xmax, ymax), (xmin, ymax)), 'func': nil_dirichlet},
'gamma4': {'location': Segment((xmin, ymax), (xmin, ymin)), 'func': nil_dirichlet}, 'gamma4': {'location': Segment((xmin, ymax), (xmin, ymin)), 'func': nil_dirichlet},
'D1': {'location': Cube([[xmin, xmax], [ymin, ymax]]), 'func': [term1, term2, term3]}, 'D1': {'location': Cube([[xmin, xmax], [ymin, ymax]]), 'func': [term1, term2, term3]},
#'D2': {'location': Cube([[0, 1], [0, 1]]), 'func': term2},
#'D3': {'location': Cube([[0, 1], [0, 1]]), 'func': term3}
} }
self.input_variables = ['x1', 'x2'] self.input_variables = ['x1', 'x2']
self.output_variables = ['u', 'p', 'y'] self.output_variables = ['u', 'p', 'y']
self.spatial_domain = Cube([[xmin, xmax], [xmin, xmax]]) self.spatial_domain = Cube([[xmin, xmax], [xmin, xmax]])

View File

@@ -1,16 +1,16 @@
__all__ = [ __all__ = [
'PINN', 'PINN',
'ParametricPINN',
'LabelTensor', 'LabelTensor',
'Plotter', 'Plotter',
'Condition', 'Condition',
'Span' 'Span',
'Location',
] ]
from .meta import * from .meta import *
from .label_tensor import LabelTensor from .label_tensor import LabelTensor
from .pinn import PINN from .pinn import PINN
#from .ppinn import ParametricPINN
from .plotter import Plotter from .plotter import Plotter
from .span import Span from .span import Span
from .condition import Condition from .condition import Condition
from .location import Location

View File

@@ -1,8 +1,8 @@
__all__ = [ __all__ = [
'FeedForward', 'FeedForward',
'MultiFeedForward' 'MultiFeedForward',
'DeepONet', 'DeepONet',
'Network' 'Network',
] ]
from .feed_forward import FeedForward from .feed_forward import FeedForward

View File

@@ -1,8 +1,9 @@
from .problem import AbstractProblem """ Module for PINN """
import torch import torch
import matplotlib.pyplot as plt
import numpy as np from .problem import AbstractProblem
from pina.label_tensor import LabelTensor from .label_tensor import LabelTensor
torch.pi = torch.acos(torch.zeros(1)).item() * 2 # which is 3.1415927410125732 torch.pi = torch.acos(torch.zeros(1)).item() * 2 # which is 3.1415927410125732