File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 11"""Compatibility shim for the legacy evaluator module."""
22
3- from deepks .core .ml .eval .evaluator import * # noqa: F401,F403
3+ import importlib
4+
5+
6+ _impl = importlib .import_module ("deepks.core.ml.eval.evaluator" )
7+
8+
9+ def __getattr__ (name ):
10+ return getattr (_impl , name )
11+
12+
13+ def __dir__ ():
14+ return sorted (set (globals ()) | set (__all__ ))
15+
16+
17+ __all__ = [name for name in dir (_impl ) if not name .startswith ("_" )]
Original file line number Diff line number Diff line change 11"""Compatibility shim for the legacy model module."""
22
3- from deepks .core .ml .models .corrnet import * # noqa: F401,F403
3+ import importlib
4+
5+
6+ _impl = importlib .import_module ("deepks.core.ml.models.corrnet" )
7+
8+
9+ def __getattr__ (name ):
10+ return getattr (_impl , name )
11+
12+
13+ def __dir__ ():
14+ return sorted (set (globals ()) | set (__all__ ))
15+
16+
17+ __all__ = [name for name in dir (_impl ) if not name .startswith ("_" )]
Original file line number Diff line number Diff line change 11"""Compatibility shim for the legacy model test module."""
22
3- from deepks .core .ml .eval .test import * # noqa: F401,F403
3+ import importlib
4+
5+
6+ _impl = importlib .import_module ("deepks.core.ml.eval.test" )
7+
8+
9+ def __getattr__ (name ):
10+ return getattr (_impl , name )
11+
12+
13+ def __dir__ ():
14+ return sorted (set (globals ()) | set (__all__ ))
15+
16+
17+ __all__ = [name for name in dir (_impl ) if not name .startswith ("_" )]
Original file line number Diff line number Diff line change 11"""Compatibility shim for the legacy model train module."""
22
3- from deepks .core .ml .train .train import * # noqa: F401,F403
3+ import importlib
4+
5+
6+ _impl = importlib .import_module ("deepks.core.ml.train.train" )
7+
8+
9+ def __getattr__ (name ):
10+ return getattr (_impl , name )
11+
12+
13+ def __dir__ ():
14+ return sorted (set (globals ()) | set (__all__ ))
15+
16+
17+ __all__ = [name for name in dir (_impl ) if not name .startswith ("_" )]
Original file line number Diff line number Diff line change 11"""Compatibility shim for the legacy model utils module."""
22
3- from deepks .core .ml .utils import * # noqa: F401,F403
3+ import importlib
4+
5+
6+ _impl = importlib .import_module ("deepks.core.ml.utils" )
7+
8+
9+ def __getattr__ (name ):
10+ return getattr (_impl , name )
11+
12+
13+ def __dir__ ():
14+ return sorted (set (globals ()) | set (__all__ ))
15+
16+
17+ __all__ = [name for name in dir (_impl ) if not name .startswith ("_" )]
Original file line number Diff line number Diff line change 1+ """
2+ Legacy model shim export coverage.
3+
4+ Tests:
5+ - `test_model_train_test_shim_exports`
6+ - `test_model_eval_utils_shim_exports`
7+ """
8+
9+ import importlib
10+
11+ import deepks .model .evaluator as evaluator_shim
12+ import deepks .model .model as model_shim
13+ import deepks .model .test as test_shim
14+ import deepks .model .train as train_shim
15+ import deepks .model .utils as utils_shim
16+
17+ evaluator_impl = importlib .import_module ("deepks.core.ml.eval.evaluator" )
18+ eval_test_impl = importlib .import_module ("deepks.core.ml.eval.test" )
19+ model_impl = importlib .import_module ("deepks.core.ml.models.corrnet" )
20+ utils_impl = importlib .import_module ("deepks.core.ml.utils" )
21+ train_impl = importlib .import_module ("deepks.core.ml.train.train" )
22+
23+
24+ def test_model_train_test_shim_exports ():
25+ assert train_shim .main is train_impl .main
26+ assert train_shim .train is train_impl .train
27+ assert test_shim .main is eval_test_impl .main
28+ assert test_shim .test is eval_test_impl .test
29+
30+
31+ def test_model_eval_utils_shim_exports ():
32+ assert evaluator_shim .Evaluator is evaluator_impl .Evaluator
33+ assert model_shim .CorrNet is model_impl .CorrNet
34+ assert utils_shim .fit_elem_const is utils_impl .fit_elem_const
35+ assert utils_shim .preprocess is utils_impl .preprocess
You can’t perform that action at this time.
0 commit comments