params-proto 3.2.1__py3-none-any.whl → 3.2.3__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.
- params_proto/proto.py +28 -7
- params_proto/v1/params_proto.py +7 -1
- params_proto/v2/proto.py +7 -1
- {params_proto-3.2.1.dist-info → params_proto-3.2.3.dist-info}/METADATA +1 -2
- {params_proto-3.2.1.dist-info → params_proto-3.2.3.dist-info}/RECORD +7 -7
- {params_proto-3.2.1.dist-info → params_proto-3.2.3.dist-info}/WHEEL +0 -0
- {params_proto-3.2.1.dist-info → params_proto-3.2.3.dist-info}/licenses/LICENSE.md +0 -0
params_proto/proto.py
CHANGED
|
@@ -698,10 +698,23 @@ class ptype(type):
|
|
|
698
698
|
|
|
699
699
|
# Copy methods from original class and wrap to return self
|
|
700
700
|
for name in dir(original_cls):
|
|
701
|
-
# Skip
|
|
702
|
-
if name
|
|
701
|
+
# Skip proto fields (fields are handled above)
|
|
702
|
+
if name in annotations:
|
|
703
703
|
continue
|
|
704
704
|
|
|
705
|
+
# For dunder methods, only copy user-defined ones (not inherited from object/type)
|
|
706
|
+
if name.startswith("__"):
|
|
707
|
+
# Check if this dunder method is user-defined (not from object or type)
|
|
708
|
+
is_user_defined = False
|
|
709
|
+
for klass in original_cls.__mro__:
|
|
710
|
+
if klass is object or klass is type:
|
|
711
|
+
break
|
|
712
|
+
if name in klass.__dict__:
|
|
713
|
+
is_user_defined = True
|
|
714
|
+
break
|
|
715
|
+
if not is_user_defined:
|
|
716
|
+
continue
|
|
717
|
+
|
|
705
718
|
# Check raw descriptor in MRO to detect staticmethod/classmethod (handles inheritance)
|
|
706
719
|
raw_attr = None
|
|
707
720
|
for klass in original_cls.__mro__:
|
|
@@ -844,10 +857,15 @@ def proto(
|
|
|
844
857
|
# Handle existing metaclass
|
|
845
858
|
existing_meta = type(obj)
|
|
846
859
|
if existing_meta is not type:
|
|
847
|
-
#
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
860
|
+
# Check if existing metaclass is already ptype or a subclass of ptype
|
|
861
|
+
if issubclass(existing_meta, ptype):
|
|
862
|
+
# Already using ptype, no need to merge
|
|
863
|
+
metaclass = existing_meta
|
|
864
|
+
else:
|
|
865
|
+
# Merge with existing metaclass
|
|
866
|
+
class MergedMeta(existing_meta, ptype):
|
|
867
|
+
pass
|
|
868
|
+
metaclass = MergedMeta
|
|
851
869
|
else:
|
|
852
870
|
metaclass = ptype
|
|
853
871
|
|
|
@@ -872,9 +890,12 @@ def proto(
|
|
|
872
890
|
namespace[key] = value
|
|
873
891
|
|
|
874
892
|
# Create new class with metaclass
|
|
893
|
+
# IMPORTANT: Use (obj,) as bases to make new class a SUBCLASS of original.
|
|
894
|
+
# This ensures super() works correctly - the original class is in the MRO,
|
|
895
|
+
# so Python's super() validation passes when checking isinstance(self, original_class).
|
|
875
896
|
new_cls = metaclass(
|
|
876
897
|
obj.__name__,
|
|
877
|
-
obj
|
|
898
|
+
(obj,),
|
|
878
899
|
namespace
|
|
879
900
|
)
|
|
880
901
|
|
params_proto/v1/params_proto.py
CHANGED
|
@@ -17,7 +17,13 @@ import inspect
|
|
|
17
17
|
import re
|
|
18
18
|
from typing import Callable, TypeVar, Union
|
|
19
19
|
|
|
20
|
-
|
|
20
|
+
try:
|
|
21
|
+
from waterbear import DefaultBear
|
|
22
|
+
except ImportError:
|
|
23
|
+
raise ImportError(
|
|
24
|
+
"params_proto.v1 requires waterbear. Install it with: pip install waterbear\n"
|
|
25
|
+
"Note: The v3 API (from params_proto import proto) does not require waterbear."
|
|
26
|
+
)
|
|
21
27
|
|
|
22
28
|
|
|
23
29
|
def _strtobool(val):
|
params_proto/v2/proto.py
CHANGED
|
@@ -8,7 +8,13 @@ from types import BuiltinFunctionType, SimpleNamespace
|
|
|
8
8
|
from warnings import warn
|
|
9
9
|
|
|
10
10
|
from expandvars import expandvars
|
|
11
|
-
|
|
11
|
+
try:
|
|
12
|
+
from waterbear import Bear
|
|
13
|
+
except ImportError:
|
|
14
|
+
raise ImportError(
|
|
15
|
+
"params_proto.v2 requires waterbear. Install it with: pip install waterbear\n"
|
|
16
|
+
"Note: The v3 API (from params_proto import proto) does not require waterbear."
|
|
17
|
+
)
|
|
12
18
|
|
|
13
19
|
from params_proto.parse_env_template import all_available
|
|
14
20
|
from params_proto.v2.utils import dot_to_deps
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: params-proto
|
|
3
|
-
Version: 3.2.
|
|
3
|
+
Version: 3.2.3
|
|
4
4
|
Summary: Modern Hyper Parameter Management for Machine Learning
|
|
5
5
|
Project-URL: Homepage, https://github.com/geyang/params-proto
|
|
6
6
|
Project-URL: Documentation, https://params-proto.readthedocs.io
|
|
@@ -23,7 +23,6 @@ Requires-Dist: argcomplete
|
|
|
23
23
|
Requires-Dist: argparse
|
|
24
24
|
Requires-Dist: expandvars
|
|
25
25
|
Requires-Dist: termcolor
|
|
26
|
-
Requires-Dist: waterbear>=2.6.8
|
|
27
26
|
Provides-Extra: dev
|
|
28
27
|
Requires-Dist: pandas; extra == 'dev'
|
|
29
28
|
Requires-Dist: pytest; extra == 'dev'
|
|
@@ -3,7 +3,7 @@ params_proto/app.py,sha256=UySpd1op3M44Szk6Ekyn0fJcnZsQvMTMPdaEybwWsLE,19
|
|
|
3
3
|
params_proto/documentation.py,sha256=mIqmcwGWo8tM1BuNzLIwVTzdbQ3qyPus7yWTaOce4dM,8091
|
|
4
4
|
params_proto/envvar.py,sha256=A87jxSAQ2tjbKLbrm96lblV90zNdtBGCSV6QRe2DrgA,8398
|
|
5
5
|
params_proto/parse_env_template.py,sha256=mXTvKpNhT2jGr3HpwKw42shd18O0QACmSJn6yWMDdKA,1298
|
|
6
|
-
params_proto/proto.py,sha256=
|
|
6
|
+
params_proto/proto.py,sha256=CYLLEKT8mDcxi25q75wIjHuoS3U_7cMvWuqFRmeTYAQ,39996
|
|
7
7
|
params_proto/type_utils.py,sha256=x68rL5m76ZFRKsCRgH_i_4vLpt6ldWEsEAalgacFIH8,7364
|
|
8
8
|
params_proto/cli/__init__.py,sha256=sLpN3GmaBqd_d0J0nvUNOeGlV74_-jQGW0nDUU34tjA,493
|
|
9
9
|
params_proto/cli/ansi_help.py,sha256=-1gzbvOpi9GjPlqgiINOYQAfIstzg0-ukv1se88TYCQ,10967
|
|
@@ -14,13 +14,13 @@ params_proto/hyper/proxies.py,sha256=OMiaKK-gQx-zT1xeCmZevBSDgWUwwkzz0n54A5_wC60
|
|
|
14
14
|
params_proto/hyper/sweep.py,sha256=QUjsNdpJUoZU2WMF022LRqTh9rx5dgabpRCfs895q2Q,31444
|
|
15
15
|
params_proto/v1/__init__.py,sha256=NGYZ6Iqicc5M6iyWT6N8FsD0iGLl2by5yZUIsHKhjXw,48
|
|
16
16
|
params_proto/v1/hyper.py,sha256=zFzViWtSkQdqDJXuan33X2OZwKSHHY39Q5HSNPXl0iQ,2883
|
|
17
|
-
params_proto/v1/params_proto.py,sha256=
|
|
17
|
+
params_proto/v1/params_proto.py,sha256=KUQCKr7HRHFjOQGurqfWspxcBMJ6k1RTjXKSFOJZpa4,8961
|
|
18
18
|
params_proto/v2/__init__.py,sha256=C89S5VvAr4DSeRBwX4Z1p07lNDiVLu9PhosmcImYs1A,77
|
|
19
19
|
params_proto/v2/hyper.py,sha256=onBAkT8Ja8IkeHEOq1AwCdTuBzAnthIe766ZE0lAy-M,11462
|
|
20
20
|
params_proto/v2/partial.py,sha256=_ovi4NY8goYgHurfYt1OV0E9DSMXGYucjMVIyG1Q_xc,983
|
|
21
|
-
params_proto/v2/proto.py,sha256
|
|
21
|
+
params_proto/v2/proto.py,sha256=-BTTwFOhJsaPnujwFIDh14QMB8r_ZdridK9I2Jkqd_U,19228
|
|
22
22
|
params_proto/v2/utils.py,sha256=5EWvwboZDTsCYfzSED_J6RVFyNLIlf95nIu4p_ZSVxA,3540
|
|
23
|
-
params_proto-3.2.
|
|
24
|
-
params_proto-3.2.
|
|
25
|
-
params_proto-3.2.
|
|
26
|
-
params_proto-3.2.
|
|
23
|
+
params_proto-3.2.3.dist-info/METADATA,sha256=bKvvnv82Bs4UkhnDvsNyWXoGPjhX7fDf0U9_IiCoXJA,8959
|
|
24
|
+
params_proto-3.2.3.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
25
|
+
params_proto-3.2.3.dist-info/licenses/LICENSE.md,sha256=c2qSYi9tUMZtzj9SEsMeKhub5LJUmHwBtDLiIMM5b6U,1526
|
|
26
|
+
params_proto-3.2.3.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|