You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I came across a case where if I check if two GenerationStetegys are the same without some call to their repr (print since no str method, logging, debug break implicitly calling it for you, etc.) then it errors during the eq check with a RuntimeError: dictionary changed size during iteration
Ax 0.3.6
os - linux, mac, and windows (found in my CI job)
python - 3.10
Traceback
../../../../mambaforge/envs/boa-dev/lib/python3.11/site-packages/ax/utils/common/equality.py:29: in _type_safe_equals
return eq_func(self, other)
../../../../mambaforge/envs/boa-dev/lib/python3.11/site-packages/ax/utils/common/base.py:32: in __eq__
return object_attribute_dicts_equal(
../../../../mambaforge/envs/boa-dev/lib/python3.11/site-packages/ax/utils/common/equality.py:113: in object_attribute_dicts_equal
unequal_type, unequal_value = object_attribute_dicts_find_unequal_fields(
../../../../mambaforge/envs/boa-dev/lib/python3.11/site-packages/ax/utils/common/equality.py:200: in object_attribute_dicts_find_unequal_fields
equal = isinstance(other_val, list) and same_elements(one_val, other_val)
../../../../mambaforge/envs/boa-dev/lib/python3.11/site-packages/ax/utils/common/equality.py:60: in same_elements
elif item1 == item2:
../../../../mambaforge/envs/boa-dev/lib/python3.11/site-packages/ax/modelbridge/generation_node.py:778: in __eq__
return SortableBase.__eq__(self, other=other)
../../../../mambaforge/envs/boa-dev/lib/python3.11/site-packages/ax/utils/common/equality.py:29: in _type_safe_equals
return eq_func(self, other)
../../../../mambaforge/envs/boa-dev/lib/python3.11/site-packages/ax/utils/common/base.py:32: in __eq__
return object_attribute_dicts_equal(
../../../../mambaforge/envs/boa-dev/lib/python3.11/site-packages/ax/utils/common/equality.py:113: in object_attribute_dicts_equal
unequal_type, unequal_value = object_attribute_dicts_find_unequal_fields(
Here are some example functions that produce the error and avoid the error.
I believe it has to do with the repr in GenerationStrategy, specifically the part that calls the name property. If I make a subclass and remove that, then the printing no longer stops the error.
The text was updated successfully, but these errors were encountered:
madeline-scyphers
changed the title
Generation Strategy equality check error without call to repr
[Bug] Generation Strategy equality check error without call to repr
Feb 28, 2024
I came across a case where if I check if two GenerationStetegys are the same without some call to their repr (print since no str method, logging, debug break implicitly calling it for you, etc.) then it errors during the eq check with a
RuntimeError: dictionary changed size during iteration
Ax 0.3.6
os - linux, mac, and windows (found in my CI job)
python - 3.10
Traceback
Here are some example functions that produce the error and avoid the error.
I believe it has to do with the repr in GenerationStrategy, specifically the part that calls the name property. If I make a subclass and remove that, then the printing no longer stops the error.
The text was updated successfully, but these errors were encountered: