File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,6 +2,6 @@ DataModule
22======================
33.. currentmodule :: pina.data.data_module
44
5- .. autoclass :: pina._src.data.data_module.PinaDataModule
5+ .. autoclass :: pina._src.data.data_module.DataModule
66 :members:
77 :show-inheritance:
Original file line number Diff line number Diff line change 11"""
2- PINA: Physics-Informed Neural Analysis.
3-
42A specialized framework for Scientific Machine Learning (SciML), providing
53tools for Physics-Informed Neural Networks (PINNs), Neural Operators,
64and data-driven physical modeling.
108 "LabelTensor" ,
119 "Trainer" ,
1210 "Condition" ,
13- "PinaDataModule " ,
11+ "DataModule " ,
1412 "Graph" ,
1513]
1614
1715from pina ._src .core .label_tensor import LabelTensor
1816from pina ._src .core .graph import Graph
1917from pina ._src .core .trainer import Trainer
2018from pina ._src .condition .condition import Condition
21- from pina ._src .data .data_module import PinaDataModule
19+ from pina ._src .data .data_module import DataModule
20+
21+
22+ # Back-compatibility with version 0.2, to be removed soon
23+ import warnings
24+
25+ _DEPRECATED_IMPORTS = {"PinaDataModule" : "DataModule" }
26+
27+
28+ def __getattr__ (name ):
29+ if name in _DEPRECATED_IMPORTS :
30+
31+ warnings .warn (
32+ f"Importing '{ name } ' from 'pina' is deprecated; use "
33+ f"pina.{ _DEPRECATED_IMPORTS [name ]} instead." ,
34+ DeprecationWarning ,
35+ stacklevel = 2 ,
36+ )
37+
38+ return globals ()[_DEPRECATED_IMPORTS [name ]]
Original file line number Diff line number Diff line change 1818warnings .formatwarning = custom_warning_format
1919warnings .filterwarnings ("always" , category = UserWarning )
2020
21+ # TODO: add checks on training, val and test sizes
22+ # TODO: rimuovi tutti i check inutili a cascata in tutto il data module
23+
2124
2225class Trainer (lightning .pytorch .Trainer ):
2326 """
@@ -69,7 +72,7 @@ def __init__(
6972 :param bool automatic_batching: If ``True``, automatic PyTorch batching
7073 is performed, otherwise the items are retrieved from the dataset
7174 all at once. For further details, see the
72- :class:`~pina.data.data_module.PinaDataModule ` class. Default is
75+ :class:`~pina.data.data_module.DataModule ` class. Default is
7376 ``False``.
7477 :param int num_workers: The number of worker threads for data loading.
7578 Default is ``0`` (serial loading).
@@ -248,7 +251,7 @@ def _create_datamodule(
248251 "are sampled. The Trainer got the following:\n "
249252 f"{ error_message } "
250253 )
251- self .data_module = PinaDataModule (
254+ self .data_module = DataModule (
252255 self .solver .problem ,
253256 train_size = train_size ,
254257 test_size = test_size ,
You can’t perform that action at this time.
0 commit comments