forked from DimaKudosh/pydfs-lineup-optimizer
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add constraint names for generate exception
- Loading branch information
1 parent
47a03ef
commit 47ed94c
Showing
9 changed files
with
76 additions
and
63 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,3 @@ | ||
from enum import Enum | ||
|
||
|
||
class Site: | ||
DRAFTKINGS = 'DRAFTKINGS' | ||
FANDUEL = 'FANDUEL' | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
from pydfs_lineup_optimizer.solvers.pulp_solver import Solver, PuLPSolver | ||
from pydfs_lineup_optimizer.solvers.constants import SolverSign | ||
from pydfs_lineup_optimizer.solvers.exceptions import SolverException | ||
from pydfs_lineup_optimizer.solvers.exceptions import SolverException, SolverInfeasibleSolutionException | ||
|
||
|
||
__all__ = ['Solver', 'PuLPSolver', 'SolverSign', 'SolverException'] | ||
__all__ = ['Solver', 'PuLPSolver', 'SolverSign', 'SolverException', 'SolverInfeasibleSolutionException'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,13 @@ | ||
from typing import List | ||
|
||
|
||
class SolverException(Exception): | ||
pass | ||
|
||
|
||
class SolverInfeasibleSolutionException(SolverException): | ||
def __init__(self, invalid_constraints: List[str]): | ||
self.invalid_constraints = invalid_constraints | ||
|
||
def get_user_defined_constraints(self) -> List[str]: | ||
return [name for name in self.invalid_constraints if not name.startswith('_')] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters