Skip to content

Commit

Permalink
Run black
Browse files Browse the repository at this point in the history
  • Loading branch information
Juliette-Gerbaux committed Jun 28, 2024
1 parent e4fc78a commit 282c0f3
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 10 deletions.
6 changes: 2 additions & 4 deletions src/andromede/thermal_heuristic/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,8 @@
NON_ANTICIPATIVE_TIME_VARYING = IndexingStructure(True, False)
CONSTANT_PER_SCENARIO = IndexingStructure(False, True)

def get_thermal_cluster_accurate_model(initial_model: Model) -> Model:

def get_thermal_cluster_accurate_model(initial_model: Model) -> Model:
THERMAL_CLUSTER_MODEL_LP = model(
id=initial_model.id,
parameters=[p for p in initial_model.parameters.values()],
Expand All @@ -90,7 +90,6 @@ def get_thermal_cluster_accurate_model(initial_model: Model) -> Model:


def get_thermal_cluster_fast_model(initial_model: Model) -> Model:

integer_variables = [
v.name
for v in initial_model.variables.values()
Expand Down Expand Up @@ -149,7 +148,6 @@ def variable_in_expression(expr: ExpressionNode, variables: List[str]) -> bool:


def get_accurate_heuristic_model(initial_model: Model) -> Model:

generation_variable = ["generation"]

THERMAL_CLUSTER_MODEL_ACCURATE_HEURISTIC = model(
Expand Down Expand Up @@ -271,4 +269,4 @@ def get_model_fast_heuristic(Q: int, delta: int) -> Model:
[var(f"t_ajust_{h}") * (h + 1) / 10 / delta for h in range(delta)]
).expec(), # type:ignore
)
return BLOCK_MODEL_FAST_HEURISTIC
return BLOCK_MODEL_FAST_HEURISTIC
4 changes: 0 additions & 4 deletions src/andromede/thermal_heuristic/problem.py
Original file line number Diff line number Diff line change
Expand Up @@ -75,7 +75,6 @@ def create_main_problem(
week: int,
scenario: int,
) -> OptimizationProblem:

thermal_model = choose_thermal_model(lp_relaxation, fast)

lib = library(
Expand Down Expand Up @@ -134,7 +133,6 @@ def modify_parameters_of_cluster(
scenario: int,
) -> None:
for cluster_id in get_cluster_id(network, cluster_model_id):

data = get_data(
dir_path,
"components.yml",
Expand Down Expand Up @@ -222,7 +220,6 @@ def create_problem_accurate_heuristic(
week: int,
scenario: int,
) -> OptimizationProblem:

thermal_model = get_accurate_heuristic_model(THERMAL_CLUSTER_MODEL_MILP)

lib = library(
Expand Down Expand Up @@ -302,7 +299,6 @@ def create_problem_fast_heuristic(
week: int,
scenario: int,
) -> pd.DataFrame:

data = get_data(
data_dir=data_dir,
yml_file="components.yml",
Expand Down
1 change: 0 additions & 1 deletion tests/functional/test_heuristic_complex_case.py
Original file line number Diff line number Diff line change
Expand Up @@ -208,7 +208,6 @@ def test_fast_heuristic() -> None:
# Solve heuristic problem
mingen: Dict[str, AbstractDataStructure] = {}
for g in ["G1", "G2", "G3"]: #

mingen_heuristic = create_problem_fast_heuristic(
output_1.component(g).var("generation").value[0], # type:ignore
number_hours,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -287,7 +287,6 @@ def create_complex_problem(
week: int,
scenarios: List[int],
) -> OptimizationProblem:

database = generate_database(
lower_bound, number_hours, week=week, scenarios=scenarios
)
Expand Down

0 comments on commit 282c0f3

Please sign in to comment.