diff --git a/pina/adaptive_functions/__init__.py b/pina/adaptive_functions/__init__.py new file mode 100644 index 0000000..6381b47 --- /dev/null +++ b/pina/adaptive_functions/__init__.py @@ -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) \ No newline at end of file diff --git a/pina/callbacks/__init__.py b/pina/callbacks/__init__.py new file mode 100644 index 0000000..e2dc42b --- /dev/null +++ b/pina/callbacks/__init__.py @@ -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) \ No newline at end of file diff --git a/pina/condition/condition.py b/pina/condition/condition.py index 3a62143..9ff27c1 100644 --- a/pina/condition/condition.py +++ b/pina/condition/condition.py @@ -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__): diff --git a/pina/geometry/__init__.py b/pina/geometry/__init__.py new file mode 100644 index 0000000..47cc4a4 --- /dev/null +++ b/pina/geometry/__init__.py @@ -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) \ No newline at end of file diff --git a/pina/model/layers/__init__.py b/pina/model/layers/__init__.py index e69de29..15e0851 100644 --- a/pina/model/layers/__init__.py +++ b/pina/model/layers/__init__.py @@ -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) \ No newline at end of file diff --git a/pina/operators.py b/pina/operators.py new file mode 100644 index 0000000..dadebb1 --- /dev/null +++ b/pina/operators.py @@ -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) \ No newline at end of file diff --git a/pina/problem/abstract_problem.py b/pina/problem/abstract_problem.py index e90b5b7..2c2c8de 100644 --- a/pina/problem/abstract_problem.py +++ b/pina/problem/abstract_problem.py @@ -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 @@ -68,6 +60,10 @@ class AbstractProblem(metaclass=ABCMeta): elif hasattr(cond, "domain"): 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): """ diff --git a/pina/solvers/__init__.py b/pina/solvers/__init__.py new file mode 100644 index 0000000..cc4ca13 --- /dev/null +++ b/pina/solvers/__init__.py @@ -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) \ No newline at end of file diff --git a/pina/solvers/pinns/__init__.py b/pina/solvers/pinns/__init__.py new file mode 100644 index 0000000..90fee4b --- /dev/null +++ b/pina/solvers/pinns/__init__.py @@ -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) \ No newline at end of file