Fix Codacy Warnings (#477)

---------

Co-authored-by: Dario Coscia <dariocos99@gmail.com>
This commit is contained in:
Filippo Olivo
2025-03-10 15:38:45 +01:00
committed by Nicola Demo
parent e3790e049a
commit 4177bfbb50
157 changed files with 3473 additions and 3839 deletions

View File

@@ -1,3 +1,5 @@
"""TODO"""
__all__ = [
"PINNInterface",
"PINN",

View File

@@ -2,9 +2,9 @@
import torch
from pina.problem import TimeDependentProblem
from ...problem import TimeDependentProblem
from .pinn import PINN
from pina.utils import check_consistency
from ...utils import check_consistency
class CausalPINN(PINN):

View File

@@ -1,7 +1,7 @@
"""Module for Competitive PINN."""
import torch
import copy
import torch
from ...problem import InverseProblem
from .pinn_interface import PINNInterface

View File

@@ -3,8 +3,8 @@
import torch
from .pinn import PINN
from pina.operator import grad
from pina.problem import SpatialProblem
from ...operator import grad
from ...problem import SpatialProblem
class GradientPINN(PINN):
@@ -32,7 +32,7 @@ class GradientPINN(PINN):
\mathcal{L}_{\rm{problem}} =& \frac{1}{N}\sum_{i=1}^N
\mathcal{L}(\mathcal{A}[\mathbf{u}](\mathbf{x}_i)) +
\frac{1}{N}\sum_{i=1}^N
\mathcal{L}(\mathcal{B}[\mathbf{u}](\mathbf{x}_i)) + \\
\mathcal{L}(\mathcal{B}[\mathbf{u}](\mathbf{x}_i)) +
&\frac{1}{N}\sum_{i=1}^N
\nabla_{\mathbf{x}}\mathcal{L}(\mathcal{A}[\mathbf{u}](\mathbf{x}_i)) +
\frac{1}{N}\sum_{i=1}^N

View File

@@ -106,7 +106,6 @@ class PINNInterface(SolverInterface, metaclass=ABCMeta):
samples and equation.
:rtype: LabelTensor
"""
pass
def compute_residual(self, samples, equation):
"""

View File

@@ -1,10 +1,10 @@
"""Module for Self-Adaptive PINN."""
import torch
from copy import deepcopy
import torch
from pina.utils import check_consistency
from pina.problem import InverseProblem
from ...utils import check_consistency
from ...problem import InverseProblem
from ..solver import MultiSolverInterface
from .pinn_interface import PINNInterface
@@ -155,7 +155,7 @@ class SelfAdaptivePINN(PINNInterface, MultiSolverInterface):
self._vectorial_loss.reduction = "none"
def forward(self, x):
"""
r"""
Forward pass implementation for the PINN
solver. It returns the function
evaluation :math:`\mathbf{u}(\mathbf{x})` at the control points