params-proto 3.2.2__tar.gz → 3.2.3__tar.gz
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-3.2.2 → params_proto-3.2.3}/PKG-INFO +1 -1
- {params_proto-3.2.2 → params_proto-3.2.3}/docs/release_notes.md +15 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/pyproject.toml +1 -1
- {params_proto-3.2.2 → params_proto-3.2.3}/src/params_proto/proto.py +15 -2
- params_proto-3.2.3/tests/test_v3/test_proto_context_manager.py +179 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/.claude-plugin/marketplace.json +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/.claude-plugin/plugin.json +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/.editorconfig +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/.gitignore +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/.idea/.gitignore +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/.idea/codeStyles/codeStyleConfig.xml +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/.idea/inspectionProfiles/Project_Default.xml +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/.idea/inspectionProfiles/profiles_settings.xml +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/.idea/markdown.xml +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/.idea/misc.xml +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/.idea/modules.xml +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/.idea/params-proto.iml +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/.idea/ruff.xml +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/.idea/vcs.xml +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/.idea/workspace.xml +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/.readthedocs.yaml +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/.run/pytest for test_neo_proto_cli.run.xml +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/.run/pytest in test_params_proto.run.xml +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/ANSI_HELP_CONSIDERATIONS.md +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/CLAUDE.md +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/LICENSE.md +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/Makefile +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/README +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/README.md +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/docs/Makefile +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/docs/_archive_v2/api/hyper.md +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/docs/_archive_v2/api/proto.md +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/docs/_archive_v2/api/utils.md +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/docs/_archive_v2/examples/advanced_features.md +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/docs/_archive_v2/examples/basic_usage.md +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/docs/_archive_v2/examples/environment_variables.md +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/docs/_archive_v2/examples/hyperparameter_sweeps.md +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/docs/_archive_v2/examples/index.md +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/docs/_archive_v2/examples/nested_configs.md +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/docs/_archive_v2/quick_start.md +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/docs/_static/ansi.css +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/docs/_static/custom.css +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/docs/api/index.md +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/docs/api/proto.md +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/docs/conf.py +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/docs/examples/basic_usage.md +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/docs/examples/cli_applications.md +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/docs/examples/ml_training.md +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/docs/examples/rl_agent.md +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/docs/index.md +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/docs/key_concepts/advanced_patterns.md +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/docs/key_concepts/ansi_formatting.md +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/docs/key_concepts/cli-fundamentals.md +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/docs/key_concepts/cli-patterns.md +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/docs/key_concepts/configuration-patterns.md +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/docs/key_concepts/core-concepts.md +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/docs/key_concepts/environment_variables.md +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/docs/key_concepts/help-generation.md +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/docs/key_concepts/hyperparameter_sweeps.md +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/docs/key_concepts/naming-conventions.md +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/docs/key_concepts/parameter-iteration.md +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/docs/key_concepts/parameter-overrides.md +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/docs/key_concepts/type-system.md +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/docs/key_concepts/union_types.md +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/docs/key_concepts/welcome.md +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/docs/migration.md +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/docs/quick_start.md +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/docs/requirements.txt +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/examples/union_subcommands.py +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/figures/man-page.png +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/figures/params-proto-autocompletion.gif +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/figures/spec_files.png +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/scratch/demo_params_proto.py +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/scratch/demo_v3.py +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/scratch/proto_DAT_scratch.py +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/scratch/proto_dependency_tree_pattern.py +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/scratch/test_super.py +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/scratch/test_super_minimal.py +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/skills/params-proto/SKILL.md +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/skills/params-proto/references/cli-and-types.md +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/skills/params-proto/references/environment-vars.md +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/skills/params-proto/references/patterns.md +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/skills/params-proto/references/sweeps.md +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/skills/params-proto.skill +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/src/params_proto/__init__.py +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/src/params_proto/app.py +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/src/params_proto/cli/__init__.py +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/src/params_proto/cli/ansi_help.py +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/src/params_proto/cli/cli_parse.py +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/src/params_proto/cli/help_gen.py +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/src/params_proto/documentation.py +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/src/params_proto/envvar.py +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/src/params_proto/hyper/__init__.py +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/src/params_proto/hyper/proxies.py +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/src/params_proto/hyper/sweep.py +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/src/params_proto/parse_env_template.py +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/src/params_proto/type_utils.py +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/src/params_proto/v1/__init__.py +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/src/params_proto/v1/hyper.py +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/src/params_proto/v1/params_proto.py +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/src/params_proto/v2/__init__.py +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/src/params_proto/v2/hyper.py +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/src/params_proto/v2/partial.py +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/src/params_proto/v2/proto.py +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/src/params_proto/v2/utils.py +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/tests/test_v1/__init__.py +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/tests/test_v1/test_hyper.py +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/tests/test_v1/test_params_proto.py +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/tests/test_v2/test_Eval.py +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/tests/test_v2/test_neo_hyper.py +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/tests/test_v2/test_neo_proto.py +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/tests/test_v2/test_neo_proto_cli.py +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/tests/test_v2/test_neo_proto_partial.py +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/tests/test_v2/test_utils.py +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/tests/test_v3/conftest.py +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/tests/test_v3/samples/train.py +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/tests/test_v3/test_advanced_types.py +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/tests/test_v3/test_class_level_methods.py +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/tests/test_v3/test_cli_parsing.py +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/tests/test_v3/test_help_strings.py +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/tests/test_v3/test_method_self_param.py +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/tests/test_v3/test_nested_cli.py +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/tests/test_v3/test_parse_env_template.py +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/tests/test_v3/test_piter.py +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/tests/test_v3/test_positional_example.sh +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/tests/test_v3/test_proto_comments.py +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/tests/test_v3/test_proto_core.py +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/tests/test_v3/test_proto_envvar.py +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/tests/test_v3/test_proto_linebreaking.py +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/tests/test_v3/test_proto_partial.py +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/tests/test_v3/test_proto_required.py +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/tests/test_v3/test_strings.py +0 -0
- {params_proto-3.2.2 → params_proto-3.2.3}/tests/test_v3/test_sweep.py +0 -0
|
@@ -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
|
|
@@ -2,6 +2,21 @@
|
|
|
2
2
|
|
|
3
3
|
This page contains the release history and changelog for params-proto.
|
|
4
4
|
|
|
5
|
+
## Version 3.2.3 (2025-02-04)
|
|
6
|
+
|
|
7
|
+
### 🐛 Bug Fixes
|
|
8
|
+
|
|
9
|
+
- **Context Manager Protocol**: Fixed regression where `__enter__` and `__exit__` methods were stripped from `@proto` and `@proto.prefix` decorated classes
|
|
10
|
+
- Classes implementing context managers now work correctly with `with` statements
|
|
11
|
+
- Also preserves other user-defined protocol methods: `__call__`, `__iter__`, `__next__`, `__getitem__`, `__len__`, etc.
|
|
12
|
+
- Root cause: method copying skipped all dunder methods, but should preserve user-defined ones
|
|
13
|
+
|
|
14
|
+
### 🧪 Testing
|
|
15
|
+
|
|
16
|
+
- Added comprehensive tests for context manager and other Python protocol preservation
|
|
17
|
+
|
|
18
|
+
---
|
|
19
|
+
|
|
5
20
|
## Version 3.2.2 (2025-02-03)
|
|
6
21
|
|
|
7
22
|
### 🐛 Bug Fixes
|
|
@@ -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__:
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
"""Test that @proto and @proto.prefix preserve context manager protocol."""
|
|
2
|
+
|
|
3
|
+
import pytest
|
|
4
|
+
from params_proto import proto
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
class TestContextManager:
|
|
8
|
+
"""Test context manager protocol preservation."""
|
|
9
|
+
|
|
10
|
+
def test_proto_prefix_context_manager(self):
|
|
11
|
+
"""Test that @proto.prefix preserves __enter__ and __exit__."""
|
|
12
|
+
|
|
13
|
+
@proto.prefix
|
|
14
|
+
class RUN:
|
|
15
|
+
prefix: str = "test"
|
|
16
|
+
entered: bool = False
|
|
17
|
+
exited: bool = False
|
|
18
|
+
|
|
19
|
+
def __enter__(self):
|
|
20
|
+
self.entered = True
|
|
21
|
+
return self
|
|
22
|
+
|
|
23
|
+
def __exit__(self, exc_type, exc_val, exc_tb):
|
|
24
|
+
self.exited = True
|
|
25
|
+
return False
|
|
26
|
+
|
|
27
|
+
run = RUN()
|
|
28
|
+
|
|
29
|
+
# Check methods exist
|
|
30
|
+
assert hasattr(run, "__enter__"), "Should have __enter__ method"
|
|
31
|
+
assert hasattr(run, "__exit__"), "Should have __exit__ method"
|
|
32
|
+
|
|
33
|
+
# Test actual context manager usage
|
|
34
|
+
with run as r:
|
|
35
|
+
assert r.entered, "Should have called __enter__"
|
|
36
|
+
assert not r.exited, "Should not have called __exit__ yet"
|
|
37
|
+
|
|
38
|
+
assert run.exited, "Should have called __exit__"
|
|
39
|
+
|
|
40
|
+
def test_proto_context_manager(self):
|
|
41
|
+
"""Test that @proto preserves __enter__ and __exit__."""
|
|
42
|
+
|
|
43
|
+
@proto
|
|
44
|
+
class Session:
|
|
45
|
+
name: str = "session"
|
|
46
|
+
active: bool = False
|
|
47
|
+
|
|
48
|
+
def __enter__(self):
|
|
49
|
+
self.active = True
|
|
50
|
+
return self
|
|
51
|
+
|
|
52
|
+
def __exit__(self, exc_type, exc_val, exc_tb):
|
|
53
|
+
self.active = False
|
|
54
|
+
return False
|
|
55
|
+
|
|
56
|
+
session = Session()
|
|
57
|
+
|
|
58
|
+
with session as s:
|
|
59
|
+
assert s.active, "Should be active inside context"
|
|
60
|
+
|
|
61
|
+
assert not session.active, "Should be inactive after context"
|
|
62
|
+
|
|
63
|
+
def test_context_manager_with_exception(self):
|
|
64
|
+
"""Test context manager handles exceptions correctly."""
|
|
65
|
+
|
|
66
|
+
@proto.prefix
|
|
67
|
+
class RUN:
|
|
68
|
+
prefix: str = "test"
|
|
69
|
+
exc_info: tuple = None
|
|
70
|
+
|
|
71
|
+
def __enter__(self):
|
|
72
|
+
return self
|
|
73
|
+
|
|
74
|
+
def __exit__(self, exc_type, exc_val, exc_tb):
|
|
75
|
+
self.exc_info = (exc_type, exc_val, exc_tb)
|
|
76
|
+
return True # Suppress exception
|
|
77
|
+
|
|
78
|
+
run = RUN()
|
|
79
|
+
|
|
80
|
+
with run:
|
|
81
|
+
raise ValueError("test error")
|
|
82
|
+
|
|
83
|
+
# Exception should have been captured
|
|
84
|
+
assert run.exc_info[0] is ValueError
|
|
85
|
+
assert str(run.exc_info[1]) == "test error"
|
|
86
|
+
|
|
87
|
+
def test_context_manager_inheritance(self):
|
|
88
|
+
"""Test context manager works with inheritance."""
|
|
89
|
+
|
|
90
|
+
class BaseContext:
|
|
91
|
+
def __enter__(self):
|
|
92
|
+
self.entered = True
|
|
93
|
+
return self
|
|
94
|
+
|
|
95
|
+
def __exit__(self, exc_type, exc_val, exc_tb):
|
|
96
|
+
self.exited = True
|
|
97
|
+
return False
|
|
98
|
+
|
|
99
|
+
@proto.prefix
|
|
100
|
+
class ChildRUN(BaseContext):
|
|
101
|
+
prefix: str = "child"
|
|
102
|
+
entered: bool = False
|
|
103
|
+
exited: bool = False
|
|
104
|
+
|
|
105
|
+
run = ChildRUN()
|
|
106
|
+
|
|
107
|
+
with run as r:
|
|
108
|
+
assert r.entered
|
|
109
|
+
|
|
110
|
+
assert run.exited
|
|
111
|
+
|
|
112
|
+
|
|
113
|
+
class TestOtherProtocols:
|
|
114
|
+
"""Test other Python protocol methods are preserved."""
|
|
115
|
+
|
|
116
|
+
def test_callable_protocol(self):
|
|
117
|
+
"""Test __call__ is preserved."""
|
|
118
|
+
|
|
119
|
+
@proto.prefix
|
|
120
|
+
class Callable:
|
|
121
|
+
value: int = 0
|
|
122
|
+
call_count: int = 0
|
|
123
|
+
|
|
124
|
+
def __call__(self, x):
|
|
125
|
+
self.call_count += 1
|
|
126
|
+
return self.value + x
|
|
127
|
+
|
|
128
|
+
c = Callable()
|
|
129
|
+
c.value = 10
|
|
130
|
+
|
|
131
|
+
result = c(5)
|
|
132
|
+
assert result == 15
|
|
133
|
+
assert c.call_count == 1
|
|
134
|
+
|
|
135
|
+
def test_iterator_protocol(self):
|
|
136
|
+
"""Test __iter__ and __next__ are preserved."""
|
|
137
|
+
|
|
138
|
+
@proto.prefix
|
|
139
|
+
class Counter:
|
|
140
|
+
start: int = 0
|
|
141
|
+
end: int = 3
|
|
142
|
+
_current: int = 0
|
|
143
|
+
|
|
144
|
+
def __iter__(self):
|
|
145
|
+
self._current = self.start
|
|
146
|
+
return self
|
|
147
|
+
|
|
148
|
+
def __next__(self):
|
|
149
|
+
if self._current >= self.end:
|
|
150
|
+
raise StopIteration
|
|
151
|
+
value = self._current
|
|
152
|
+
self._current += 1
|
|
153
|
+
return value
|
|
154
|
+
|
|
155
|
+
counter = Counter()
|
|
156
|
+
result = list(counter)
|
|
157
|
+
assert result == [0, 1, 2]
|
|
158
|
+
|
|
159
|
+
def test_container_protocol(self):
|
|
160
|
+
"""Test __getitem__ and __len__ are preserved."""
|
|
161
|
+
|
|
162
|
+
@proto.prefix
|
|
163
|
+
class Container:
|
|
164
|
+
items: list = None
|
|
165
|
+
|
|
166
|
+
def __post_init__(self):
|
|
167
|
+
if self.items is None:
|
|
168
|
+
self.items = [1, 2, 3]
|
|
169
|
+
|
|
170
|
+
def __getitem__(self, index):
|
|
171
|
+
return self.items[index]
|
|
172
|
+
|
|
173
|
+
def __len__(self):
|
|
174
|
+
return len(self.items)
|
|
175
|
+
|
|
176
|
+
c = Container()
|
|
177
|
+
assert len(c) == 3
|
|
178
|
+
assert c[0] == 1
|
|
179
|
+
assert c[1] == 2
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{params_proto-3.2.2 → params_proto-3.2.3}/docs/_archive_v2/examples/environment_variables.md
RENAMED
|
File without changes
|
{params_proto-3.2.2 → params_proto-3.2.3}/docs/_archive_v2/examples/hyperparameter_sweeps.md
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{params_proto-3.2.2 → params_proto-3.2.3}/skills/params-proto/references/environment-vars.md
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|