diff --git a/docs/src/20-tutorials.md b/docs/src/20-tutorials.md index 33185275..a889de90 100644 --- a/docs/src/20-tutorials.md +++ b/docs/src/20-tutorials.md @@ -127,7 +127,7 @@ variables = compute_variables_indices(dataframes) Now we can compute the model. ```@example manual -model = create_model(graph, sets, variables, representative_periods, dataframes, years, timeframe, groups, model_parameters) +model = create_model(connection, graph, sets, variables, representative_periods, dataframes, years, timeframe, groups, model_parameters) ``` Finally, we can compute the solution. diff --git a/src/tmp.jl b/src/tmp.jl index e83030c5..0763817a 100644 --- a/src/tmp.jl +++ b/src/tmp.jl @@ -224,7 +224,7 @@ function tmp_create_constraints_indices(connection) main.asset, main.year, main.rep_period, - sub.time_block_start, + COALESCE(sub.time_block_start, 1) AS time_block_start, lead(sub.time_block_start - 1, 1, main.num_timesteps) OVER (PARTITION BY main.asset, main.year, main.rep_period ORDER BY time_block_start) AS time_block_end, @@ -261,7 +261,7 @@ function tmp_create_constraints_indices(connection) main.asset, main.year, main.rep_period, - sub.time_block_start, + COALESCE(sub.time_block_start, 1) AS time_block_start, lead(sub.time_block_start - 1, 1, main.num_timesteps) OVER (PARTITION BY main.asset, main.year, main.rep_period ORDER BY time_block_start) AS time_block_end,