8000 `yield_namespace_device_dtype_combinations` parametrization ID confusing for 'device1' · Issue #31042 · scikit-learn/scikit-learn · GitHub
[go: up one dir, main page]

Skip to content
yield_namespace_device_dtype_combinations parametrization ID confusing for 'device1' #31042
Closed
@lucyleeow

Description

@lucyleeow

Noticed in #29431 (comment)

In yield_namespace_device_dtype_combinations, for array_api_strict we yield CPU_DEVICE first, then device1. This results in the confusing pytest parametrization IDs:

  • array_api_strict-device2-float32 - where 'device2' actually refers to Device("device1") and not Device("device2")
  • array_api_strict-device1-float64 - where 'device1' actually refers to Device("CPU_DEVICE") and not Device("device1")

Not sure if there is an good fix for this / or if a fix is needed.

We could yield Device("device1") first but then the id "device2" would refer to Device("CPU_DEVICE") and not Device("device2")

The only way to completely avoid confusion would be to write a function that takes a params and amends the names e.g.,

@pytest.mark.parametrize(
    "namespace,device,dtype",
    list(yield_namespace_device_dtype_combinations()),
    ids=_get_namespace_device_dtype_test_ids
)

The BUT I am not sure if this is an over complicated solution to a trivial problem...

(Edit: We could just make a note in the yield_namespace_device_dtype_combinations docstring - this seems like a reasonable solution...)

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

      0