Skip to content

No active exception to reraise #91

@Jman4190

Description

@Jman4190

When running this block I receive an error

games_played={}
weekly_matchups=[]

for week, game_type in enumerate(game_types_per_week):
    #print(week)
        
    print(week,game_type)
    matchups=None
    #Potentially invalid matchups can happen depending on the contstraints so each week will have a given number of attempts. 
    #It's also possible a prior week leads to an impossible state. We will only support rerunning on the week level
    ATTEMPTS=100
    for attempt in range(ATTEMPTS):
        try:
            matchups=gen_matchups(all_teams,universes[game_type])
            break
        except:
            continue
    if not matchups:
        raise 
    else:
        for name, universe in universes.items():
            for team_1,team_2 in matchups:
                for a,b in permutations([team_1,team_2], 2):
                    if b in universe.get(a,[]):                        
                        universes[name][a].remove(b)

        weekly_matchups.append(matchups)

[x[0] for x in weekly_matchups]

Error message

RuntimeError Traceback (most recent call last)
/var/folders/h0/ffqb5f990rqfgzshykzbr2gm0000gn/T/ipykernel_88125/299313015.py in
21 continue
22 if not matchups:
---> 23 raise
24 else:
25 for name, universe in universes.items():

RuntimeError: No active exception to reraise


The only change I have made is to use 4 divisions instead of 3:

```from collections import defaultdict

divisions = defaultdict(list)
for i,team in enumerate(all_teams):
    divisions[i//3].append(team)#every 4th team from the random list is assigned to the same division
divisions```

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions