daffidwilde/matching

ValueError: max() arg is an empty sequence

AlexAndrei98 opened this issue · 3 comments

This is the code that I am running which is your example code.
suitor_prefs = {'A': ['C'], 'S': ['C', 'M'], 'J': ['C', 'G', 'M'], 'L': ['M', 'C', 'G'], 'D': ['C', 'M', 'G']} reviewer_prefs = {'M': ['D', 'J'], 'C': ['D', 'A', 'S', 'L', 'J'], 'G': ['D', 'A', 'J', 'L']} capacities = {r: 2 for r in reviewer_prefs.keys()} suitor_match, reviewer_match = resident_hospital(suitor_prefs,reviewer_prefs,capacities)

I am getting a ValueError: max() arg is an empty sequence
in the get_worst_idx function since it says that it cannot calculate the max of an empty array.
You are getting the index of each resident that is also in the matching?
Could you explain that more?

I'm having the same issue on version 0.1.1

Hi there @AlexAndrei98, I apologise for such a delayed response but I am currently in the process of updating the library and writing some supporting documentation. As far as I am aware, that particular example is no longer valid as the implementation used for the hospital-resident assignment problem is out of date as of version 0.1.1.

I should have a more stable release out and published in the next month or so but please feel free to make any contributions and open a PR if there is something you would like to implement in the meantime.

Cheers!

I believe the issues being raised here have been seen to in the latest releases (v1.0 and v1.0.1). Closing.