Back compatibility 0.1
This commit is contained in:
committed by
Nicola Demo
parent
df673cad4e
commit
886bd23fdb
13
pina/adaptive_functions/__init__.py
Normal file
13
pina/adaptive_functions/__init__.py
Normal file
@@ -0,0 +1,13 @@
|
||||
import warnings
|
||||
|
||||
from ..adaptive_function import *
|
||||
from ..utils import custom_warning_format
|
||||
|
||||
# back-compatibility 0.1
|
||||
# Set the custom format for warnings
|
||||
warnings.formatwarning = custom_warning_format
|
||||
warnings.filterwarnings("always", category=DeprecationWarning)
|
||||
warnings.warn(
|
||||
f"'pina.adaptive_functions' is deprecated and will be removed "
|
||||
f"in future versions. Please use 'pina.adaptive_function' instead.",
|
||||
DeprecationWarning)
|
||||
13
pina/callbacks/__init__.py
Normal file
13
pina/callbacks/__init__.py
Normal file
@@ -0,0 +1,13 @@
|
||||
import warnings
|
||||
|
||||
from ..callback import *
|
||||
from ..utils import custom_warning_format
|
||||
|
||||
# back-compatibility 0.1
|
||||
# Set the custom format for warnings
|
||||
warnings.formatwarning = custom_warning_format
|
||||
warnings.filterwarnings("always", category=DeprecationWarning)
|
||||
warnings.warn(
|
||||
f"'pina.callbacks' is deprecated and will be removed "
|
||||
f"in future versions. Please use 'pina.callback' instead.",
|
||||
DeprecationWarning)
|
||||
@@ -4,7 +4,12 @@ from .domain_equation_condition import DomainEquationCondition
|
||||
from .input_equation_condition import InputPointsEquationCondition
|
||||
from .input_output_condition import InputOutputPointsCondition
|
||||
from .data_condition import DataConditionInterface
|
||||
import warnings
|
||||
from ..utils import custom_warning_format
|
||||
|
||||
# Set the custom format for warnings
|
||||
warnings.formatwarning = custom_warning_format
|
||||
warnings.filterwarnings("always", category=DeprecationWarning)
|
||||
|
||||
class Condition:
|
||||
"""
|
||||
@@ -50,7 +55,16 @@ class Condition:
|
||||
raise ValueError("Condition takes only the following keyword "
|
||||
f"arguments: {Condition.__slots__}.")
|
||||
|
||||
# back-compatibility 0.1
|
||||
if 'location' in kwargs.keys():
|
||||
kwargs['domain'] = kwargs.pop('location')
|
||||
warnings.warn(
|
||||
f"'location' is deprecated and will be removed "
|
||||
f"in future versions. Please use 'domain' instead.",
|
||||
DeprecationWarning)
|
||||
|
||||
sorted_keys = sorted(kwargs.keys())
|
||||
|
||||
if sorted_keys == sorted(InputOutputPointsCondition.__slots__):
|
||||
return InputOutputPointsCondition(**kwargs)
|
||||
elif sorted_keys == sorted(InputPointsEquationCondition.__slots__):
|
||||
|
||||
17
pina/geometry/__init__.py
Normal file
17
pina/geometry/__init__.py
Normal file
@@ -0,0 +1,17 @@
|
||||
import warnings
|
||||
|
||||
from ..domain import *
|
||||
from ..utils import custom_warning_format
|
||||
|
||||
# back-compatibility 0.1
|
||||
# creating alias
|
||||
Location = DomainInterface
|
||||
|
||||
# Set the custom format for warnings
|
||||
warnings.formatwarning = custom_warning_format
|
||||
warnings.filterwarnings("always", category=DeprecationWarning)
|
||||
warnings.warn(
|
||||
"'pina.geometry' is deprecated and will be removed "
|
||||
"in future versions. Please use 'pina.domain' instead. "
|
||||
"Location moved to DomainInferface object.",
|
||||
DeprecationWarning)
|
||||
@@ -0,0 +1,13 @@
|
||||
import warnings
|
||||
|
||||
from ..block import *
|
||||
from ...utils import custom_warning_format
|
||||
|
||||
# back-compatibility 0.1
|
||||
# Set the custom format for warnings
|
||||
warnings.formatwarning = custom_warning_format
|
||||
warnings.filterwarnings("always", category=DeprecationWarning)
|
||||
warnings.warn(
|
||||
f"'pina.model.layers' is deprecated and will be removed "
|
||||
f"in future versions. Please use 'pina.model.block' instead.",
|
||||
DeprecationWarning)
|
||||
13
pina/operators.py
Normal file
13
pina/operators.py
Normal file
@@ -0,0 +1,13 @@
|
||||
import warnings
|
||||
|
||||
from .operator import *
|
||||
from .utils import custom_warning_format
|
||||
|
||||
# back-compatibility 0.1
|
||||
# Set the custom format for warnings
|
||||
warnings.formatwarning = custom_warning_format
|
||||
warnings.filterwarnings("always", category=DeprecationWarning)
|
||||
warnings.warn(
|
||||
f"'pina.operators' is deprecated and will be removed "
|
||||
f"in future versions. Please use 'pina.operator' instead.",
|
||||
DeprecationWarning)
|
||||
@@ -41,10 +41,6 @@ class AbstractProblem(metaclass=ABCMeta):
|
||||
self.domains[cond_name] = cond.domain
|
||||
cond.domain = cond_name
|
||||
|
||||
# @property
|
||||
# def collector(self):
|
||||
# return self._collector
|
||||
|
||||
@property
|
||||
def batching_dimension(self):
|
||||
return self._batching_dimension
|
||||
@@ -53,10 +49,6 @@ class AbstractProblem(metaclass=ABCMeta):
|
||||
def batching_dimension(self, value):
|
||||
self._batching_dimension = value
|
||||
|
||||
@property
|
||||
def discretised_domains(self):
|
||||
return self._discretised_domains
|
||||
|
||||
# TODO this should be erase when dataloading will interface collector,
|
||||
# kept only for back compatibility
|
||||
@property
|
||||
@@ -69,6 +61,10 @@ class AbstractProblem(metaclass=ABCMeta):
|
||||
to_return[cond_name] = self._discretised_domains[cond.domain]
|
||||
return to_return
|
||||
|
||||
@property
|
||||
def discretised_domains(self):
|
||||
return self._discretised_domains
|
||||
|
||||
def __deepcopy__(self, memo):
|
||||
"""
|
||||
Implements deepcopy for the
|
||||
|
||||
13
pina/solvers/__init__.py
Normal file
13
pina/solvers/__init__.py
Normal file
@@ -0,0 +1,13 @@
|
||||
import warnings
|
||||
|
||||
from ..solver import *
|
||||
from ..utils import custom_warning_format
|
||||
|
||||
# back-compatibility 0.1
|
||||
# Set the custom format for warnings
|
||||
warnings.formatwarning = custom_warning_format
|
||||
warnings.filterwarnings("always", category=DeprecationWarning)
|
||||
warnings.warn(
|
||||
f"'pina.solvers' is deprecated and will be removed "
|
||||
f"in future versions. Please use 'pina.solver' instead.",
|
||||
DeprecationWarning)
|
||||
14
pina/solvers/pinns/__init__.py
Normal file
14
pina/solvers/pinns/__init__.py
Normal file
@@ -0,0 +1,14 @@
|
||||
import warnings
|
||||
|
||||
from ...solver.physic_informed_solver import *
|
||||
from ...utils import custom_warning_format
|
||||
|
||||
# back-compatibility 0.1
|
||||
# Set the custom format for warnings
|
||||
warnings.formatwarning = custom_warning_format
|
||||
warnings.filterwarnings("always", category=DeprecationWarning)
|
||||
warnings.warn(
|
||||
"'pina.solvers.pinns' is deprecated and will be removed "
|
||||
"in future versions. Please use "
|
||||
"'pina.solver.physic_informed_solver' instead.",
|
||||
DeprecationWarning)
|
||||
Reference in New Issue
Block a user