Casting mutliple `Match()` as `Matches()` strips the `rank` property from each `Match()``
match_stats = [[Match([{Player(6667): GaussianRating(25.0, 8.333)}, {Player(4991): GaussianRating(25.0, 8.333)}], rank=[1, 2])], [Match([{Player(6615): GaussianRating(25.0, 8.333)}, {Player(7557): GaussianRating(25.0, 8.333)}], rank=[1, 2])]]
Cast match_stat as Matches():
Matches(match_stats)
This results in:
[Match([{Player(6667): GaussianRating(25.0, 8.333)}, {Player(4991): GaussianRating(25.0, 8.333)}]), Match([{Player(6615): GaussianRating(25.0, 8.333)}, {Player(7557): GaussianRating(25.0, 8.333)}])]
As a result, using calculator will result in AttributeError: Match does not have a ranking.
This is your example. You have a list of lists instead of a list of single match objects.
match_stats = [
[Match([
{Player(6667): GaussianRating(25.0, 8.333)},
{Player(4991): GaussianRating(25.0, 8.333)}
], rank=[1, 2])],
[Match([
{Player(6615): GaussianRating(25.0, 8.333)},
{Player(7557): GaussianRating(25.0, 8.333)}
], rank=[1, 2])]
]
Take off the extra brackets around the match objects:
match_stats = [
Match([
{Player(6667): GaussianRating(25.0, 8.333)},
{Player(4991): GaussianRating(25.0, 8.333)}
], rank=[1, 2]),
Match([
{Player(6615): GaussianRating(25.0, 8.333)},
{Player(7557): GaussianRating(25.0, 8.333)}
], rank=[1, 2])
]
I think it is confusing that you got back almost what you expected but without the rank. I'll have to decide if an error should be thrown or not.
Thanks for your clarification–not sure how I missed that. I will have to rethink how I am generating the Match objects.
As an aside: does the rank=[1, 2] mean the first item in the match "won" while the second item in the match "lost"? For example, in
match_stats = [
Match([
{Player(6667): GaussianRating(25.0, 8.333)},
{Player(4991): GaussianRating(25.0, 8.333)}
], rank=[1, 2])]
the rank=[1, 2] denotes that Player(6667) beat Player(4991)?
Yes. It's 2 lists that get matched up by order. Lowest number wins. Remember you can have more than 2 teams.