Skip to content

Cannot hash built-in function max #280

Description

@albertz
...
  File "/rwthfs/rz/cluster/home/az668407/setups/combined/2021-05-31/tools/sisyphus/sisyphus/hash.py", line 162, in sis_hash_helper
    line: byte_list.append(sis_hash_helper(get_object_state(obj)))
    locals:
      byte_list = <local> [b'DelayedFunction'], _[0]: {len = 15}
      obj = <local> 74.985
  File "/rwthfs/rz/cluster/home/az668407/setups/combined/2021-05-31/tools/sisyphus/sisyphus/hash.py", line 147, in sis_hash_helper
    line: byte_list += sorted(map(sis_hash_helper, obj.items()))
    locals:
      byte_list = <local> [b'dict'], _[0]: {len = 4}
      obj = <local> {'func': <built-in function max>, 'string': 74.985, 'args': (3,), 'kwargs': {}}
  File "/rwthfs/rz/cluster/home/az668407/setups/combined/2021-05-31/tools/sisyphus/sisyphus/hash.py", line 142, in sis_hash_helper
    line: byte_list += map(sis_hash_helper, obj)
    locals:
      byte_list = <local> [b'tuple', b"(str, 'func')"], _[0]: {len = 5}
      obj = <local> ('func', <built-in function max>)
  File "/rwthfs/rz/cluster/home/az668407/setups/combined/2021-05-31/tools/sisyphus/sisyphus/hash.py", line 162, in sis_hash_helper
    line: byte_list.append(sis_hash_helper(get_object_state(obj)))
    locals:
      byte_list = <local> [b'builtin_function_or_method'], _[0]: {len = 26}
      obj = <local> <built-in function max>
  File "/rwthfs/rz/cluster/home/az668407/setups/combined/2021-05-31/tools/sisyphus/sisyphus/hash.py", line 105, in get_object_state
    line: assert args is not None, "Failed to get object state of: %s" % repr(obj)
    locals:
      args = <local> None
      obj = <local> <built-in function max>
AssertionError: Failed to get object state of: <built-in function max>

That was triggered via this code:

def _clamp_hours(hours: DelayedBase, min_hours: float = 3) -> DelayedBase:
    return DelayedFunction(hours, max, min_hours)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions