Skip to content

test_minimum_service_factor is not actually testing anything #382

@tsmbland

Description

@tsmbland

In the final for-loop of this test it's filtering the MCAMetric_Supply dataframe by timeslice and then checking that the supply for each timeslice is greater than the minimum service factor.

The problem is, it's using integers to filter by timeslice, whereas the timeslice values are actually strings (e.g. ('all-year', 'all-week', 'night')). Thus, the filtering produces an empty dataframe, so there's nothing to compare against the minimum service factor and the test just passes regardless. To see this, try changing >= factor to >= np.inf and the test will still pass!

The other problem is that we shouldn't be directly comparing supply against the minimum service factor, as the MSF is relative to capacity (so supply vs capacity * MSF would be the appropriate comparison)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    ✅ Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions