gefen-x 0.2.0__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
gefen/__init__.py ADDED
@@ -0,0 +1,44 @@
1
+ from importlib.metadata import PackageNotFoundError, version
2
+
3
+ try:
4
+ # Single-sourced from the installed distribution metadata (name: gefen-x).
5
+ __version__ = version("gefen-x")
6
+ except PackageNotFoundError:
7
+ # Importing straight from a source checkout that was never `pip install`ed.
8
+ __version__ = "0.0.0+unknown"
9
+
10
+ __all__ = [
11
+ "Gefen",
12
+ "GefenMuon",
13
+ "GefenMuonHybrid",
14
+ "split_params_for_muon",
15
+ "validate_split",
16
+ "kernels",
17
+ "__version__",
18
+ ]
19
+
20
+
21
+ def __getattr__(name):
22
+ if name == "Gefen":
23
+ from .gefen import Gefen
24
+
25
+ return Gefen
26
+ if name == "GefenMuon":
27
+ from .gefen_muon import GefenMuon
28
+
29
+ return GefenMuon
30
+ if name == "GefenMuonHybrid":
31
+ from .hybrid import GefenMuonHybrid
32
+
33
+ return GefenMuonHybrid
34
+ if name in ("split_params_for_muon", "validate_split"):
35
+ from . import params
36
+
37
+ return getattr(params, name)
38
+ if name == "kernels":
39
+ # NOT `from . import kernels`: its fromlist handling re-enters this
40
+ # __getattr__ before the submodule import runs, recursing forever.
41
+ import importlib
42
+
43
+ return importlib.import_module(".kernels", __name__)
44
+ raise AttributeError("module {!r} has no attribute {!r}".format(__name__, name))