Reference
framjules
JulES
JulES solver.
JulES
Bases: Solver
JulES solver.
Source code in framjules/JulES.py
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 |
|
__init__() -> None
Create new JulES solver with default config set.
Source code in framjules/JulES.py
22 23 24 25 |
|
get_config() -> JulESConfig
Get internal config object. Modify this to configure JulES.
Source code in framjules/JulES.py
27 28 29 |
|
JulESConfig
Config object for JulES solver.
JulESConfig
Bases: SolverConfig
Class containing all config for JulES.
Source code in framjules/JulESConfig.py
16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 |
|
__init__() -> None
Create new JulESConfig object.
Source code in framjules/JulESConfig.py
19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
|
activate_cache_db() -> None
Activates use of cache db.
Source code in framjules/JulESConfig.py
114 115 116 |
|
activate_skip_install_dependencies() -> None
Tell JulES to not install dependencies, assuming they are already installed.
Default is to install.
Source code in framjules/JulESConfig.py
99 100 101 102 103 104 |
|
deactivate_cache_db() -> None
Activates use of db without cache.
Source code in framjules/JulESConfig.py
118 119 120 |
|
deactivate_skip_install_dependencies() -> None
Tell JulES to install dependencies. (This is the default).
Source code in framjules/JulESConfig.py
106 107 108 |
|
get_debug_clearing_opt_solver() -> bool
Get whether to debug the clearing optimization solver.
Source code in framjules/JulESConfig.py
266 267 268 |
|
get_debug_end_value_opt_solver() -> bool
Get whether to debug the end value optimization solver.
Source code in framjules/JulESConfig.py
242 243 244 |
|
get_debug_long_opt_solver() -> bool
Get whether to debug the long-term optimization solver.
Source code in framjules/JulESConfig.py
234 235 236 |
|
get_debug_med_opt_solver() -> bool
Get whether to debug the medium-term optimization solver.
Source code in framjules/JulESConfig.py
226 227 228 |
|
get_debug_short_opt_solver() -> bool
Get whether to debug the short-term optimization solver.
Source code in framjules/JulESConfig.py
218 219 220 |
|
get_debug_subsystem_master_opt_solver() -> bool
Get whether to debug the subsystem master optimization solver.
Source code in framjules/JulESConfig.py
250 251 252 |
|
get_debug_subsystem_sub_opt_solver() -> bool
Get whether to debug the subsystem sub optimization solver.
Source code in framjules/JulESConfig.py
258 259 260 |
|
get_jules_version() -> str | None
Get JulES git branch.
Source code in framjules/JulESConfig.py
145 146 147 |
|
get_julia_depot_path() -> Path | None
Get folder where Julia installs new packages.
Source code in framjules/JulESConfig.py
158 159 160 |
|
get_julia_env_path() -> Path | None
Get Julia environment being used.
Source code in framjules/JulESConfig.py
167 168 169 |
|
get_julia_exe_path() -> Path | None
Get Julia installation being used.
Source code in framjules/JulESConfig.py
176 177 178 |
|
get_short_term_aggregations() -> list[Aggregator]
Get aggregations to create the short term model from clearing (the Model object being solved).
Source code in framjules/JulESConfig.py
191 192 193 |
|
get_short_term_storage_cutoff_hours() -> int
Return num hours.
JulES will classify all storage subsystems with max storage duration less than cutoff as short term storage.
Source code in framjules/JulESConfig.py
126 127 128 129 130 131 132 |
|
get_skipmax_days() -> int
Get number of days between calculation of medium and long term storage values.
Source code in framjules/JulESConfig.py
91 92 93 |
|
get_time_resolution() -> JulESTimeResolution
Get time resolution object. Modify this to modify time resolution of JulES.
Source code in framjules/JulESConfig.py
122 123 124 |
|
get_tulipa_version() -> str | None
Get TuLiPa git branch.
Source code in framjules/JulESConfig.py
149 150 151 |
|
is_cache_db() -> bool
Return True if JulES is allowed to use a cache to store precomputed values while building.
Source code in framjules/JulESConfig.py
110 111 112 |
|
is_skip_install_dependencies() -> bool
Return True if install dependencies will be skipped during by JulES.solve.
Source code in framjules/JulESConfig.py
95 96 97 |
|
set_debug_all_opt_solver(debug: bool) -> None
Set whether to debug all optimization solvers.
Source code in framjules/JulESConfig.py
204 205 206 207 208 209 210 211 212 |
|
set_debug_clearing_opt_solver(debug: bool) -> None
Set whether to debug the clearing optimization solver.
Source code in framjules/JulESConfig.py
262 263 264 |
|
set_debug_end_value_opt_solver(debug: bool) -> None
Set whether to debug the end value optimization solver.
Source code in framjules/JulESConfig.py
238 239 240 |
|
set_debug_long_opt_solver(debug: bool) -> None
Set whether to debug the long-term optimization solver.
Source code in framjules/JulESConfig.py
230 231 232 |
|
set_debug_med_opt_solver(debug: bool) -> None
Set whether to debug the medium-term optimization solver.
Source code in framjules/JulESConfig.py
222 223 224 |
|
set_debug_short_opt_solver(debug: bool) -> None
Set whether to debug the short-term optimization solver.
Source code in framjules/JulESConfig.py
214 215 216 |
|
set_debug_subsystem_master_opt_solver(debug: bool) -> None
Set whether to debug the subsystem master optimization solver.
Source code in framjules/JulESConfig.py
246 247 248 |
|
set_debug_subsystem_sub_opt_solver(debug: bool) -> None
Set whether to debug the subsystem sub optimization solver.
Source code in framjules/JulESConfig.py
254 255 256 |
|
set_jules_version(jules_branch: str | None = None, tulipa_branch: str | None = None) -> None
Set which git branch of JulES and/or TuLiPa to use.
Source code in framjules/JulESConfig.py
134 135 136 137 138 139 140 141 142 143 |
|
set_julia_depot_path(path: Path) -> None
Set folder where Julia installs new packages.
Source code in framjules/JulESConfig.py
153 154 155 156 |
|
set_julia_env_path(path: Path) -> None
Set which Julia environment to use.
Source code in framjules/JulESConfig.py
162 163 164 165 |
|
set_julia_exe_path(path: Path) -> None
Set which Julia installation to use.
Source code in framjules/JulESConfig.py
171 172 173 174 |
|
set_short_term_aggregations(aggregators: list[Aggregator]) -> None
Set aggregations to create the short term model from clearing (the Model object being solved).
Source code in framjules/JulESConfig.py
186 187 188 189 |
|
set_skipmax_days(days: int) -> None
Set number of days between calculation of medium and long term storage values.
This can speed up a simulation. The cost is less good storage values. The longer between re-calculation of storage values, the bigger negative impact on simulation result quality.
If skipmax_days = 6 and clearing_days = 2, JulES will calculate medium and long term storage values every 3rd simulation step.
Source code in framjules/JulESConfig.py
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 |
|
JulESTimeResolution
JulESTimeResolution
Bases: Base
Time resolution settings for JulES (only some are modifiable).
Source code in framjules/JulESTimeResolution.py
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 |
|
__init__() -> None
Create instance with default values.
Source code in framjules/JulESTimeResolution.py
8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
|
get_clearing_days() -> int
Get length of clearing problem in days.
Source code in framjules/JulESTimeResolution.py
179 180 181 |
|
get_clearing_market_minutes() -> int
Get market period length in clearing problem in minutes. Currently only support whole hours.
Source code in framjules/JulESTimeResolution.py
207 208 209 |
|
get_clearing_storage_minutes() -> int
Get storage period length in clearing problem in minutes. Currently only support whole hours.
Source code in framjules/JulESTimeResolution.py
211 212 213 |
|
get_content_dict() -> dict[str, int]
Return dict of all settings. Useful to get an overview.
Source code in framjules/JulESTimeResolution.py
257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 |
|
get_ev_days() -> int
Get number of days in horizon of end value problems.
Source code in framjules/JulESTimeResolution.py
251 252 253 254 255 |
|
get_long_adaptive_blocks() -> int
Get number of market periods long prognosis problem.
Source code in framjules/JulESTimeResolution.py
223 224 225 |
|
get_long_adaptive_hours() -> int
Get resolution in hours used in clustering of market period blocks in medium prognosis problem.
Source code in framjules/JulESTimeResolution.py
227 228 229 |
|
get_long_days() -> int
Get length of long prognosis problem in days.
Source code in framjules/JulESTimeResolution.py
195 196 197 |
|
get_long_storage_days() -> int
Get storage period length in long prognosis problem in days.
Source code in framjules/JulESTimeResolution.py
203 204 205 |
|
get_med_adaptive_blocks() -> int
Get number of market periods long prognosis problem.
Source code in framjules/JulESTimeResolution.py
231 232 233 |
|
get_med_adaptive_hours() -> int
Get resolution in hours used in clustering of market period blocks in medium prognosis problem.
Source code in framjules/JulESTimeResolution.py
235 236 237 |
|
get_med_days() -> int
Get length of medium prognosis problem in days.
Source code in framjules/JulESTimeResolution.py
191 192 193 |
|
get_med_storage_days() -> int
Get storage period length in medium prognosis problem in days.
Source code in framjules/JulESTimeResolution.py
199 200 201 |
|
get_short_days() -> int
Get length of short prognosis problem in days.
Source code in framjules/JulESTimeResolution.py
183 184 185 |
|
get_short_market_minutes() -> int
Get market period length in short prognosis problem in minutes. Currently only support whole hours.
Source code in framjules/JulESTimeResolution.py
215 216 217 |
|
get_short_storage_minutes() -> int
Get storage period length in short prognosis problem in minutes. Currently only support whole hours.
Source code in framjules/JulESTimeResolution.py
219 220 221 |
|
get_target_ev_days() -> int
Get prefered value for horizon length of end value problem.
Source code in framjules/JulESTimeResolution.py
247 248 249 |
|
get_target_long_storage_days() -> int
Get prefered value for long_storage_days.
Source code in framjules/JulESTimeResolution.py
239 240 241 |
|
get_target_lookahead_days() -> int
Get target (minimum) length of prognosis problems in days.
Source code in framjules/JulESTimeResolution.py
187 188 189 |
|
get_target_med_days() -> int
Get prefered value for horizon length of medium prognosis problem.
Source code in framjules/JulESTimeResolution.py
243 244 245 |
|
set_clearing_days(x: int) -> None
Set length of clearing problem in days.
Source code in framjules/JulESTimeResolution.py
72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 |
|
set_clearing_market_minutes(x: int) -> None
Set market period length in clearing problem in minutes. Currently only support whole hours.
Source code in framjules/JulESTimeResolution.py
154 155 156 157 158 159 |
|
set_clearing_storage_minutes(x: int) -> None
Set storage period length in clearing problem in minutes. Currently only support whole hours.
Source code in framjules/JulESTimeResolution.py
161 162 163 164 165 |
|
set_short_days(x: int) -> None
Set length of short term prognosis problem in days.
Source code in framjules/JulESTimeResolution.py
100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 |
|
set_short_market_minutes(x: int) -> None
Set market period length in short prognosis problem in minutes. Currently only support whole hours.
Source code in framjules/JulESTimeResolution.py
167 168 169 170 171 |
|
set_short_storage_minutes(x: int) -> None
Set storage period length in short prognosis problem in minutes. Currently only support whole hours.
Source code in framjules/JulESTimeResolution.py
173 174 175 176 177 |
|
set_target_ev_days(x: int) -> None
Set prefered value for length in days of end value problems.
Will choose a close valid value.
Source code in framjules/JulESTimeResolution.py
45 46 47 48 49 50 51 52 |
|
set_target_long_storage_days(x: int) -> None
Set prefered value for long_storage_days.
Will choose a close valid value.
Source code in framjules/JulESTimeResolution.py
54 55 56 57 58 59 60 61 |
|
set_target_lookahead_days(x: int) -> None
Set target length of prognosis problems in days.
Will set med_days and long_days and make sure their sum is minimum this length.
Will set short_days if target_lookahead_days < short_days.
Source code in framjules/JulESTimeResolution.py
128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 |
|
set_target_med_days(x: int) -> None
Set prefered value for horizon length in days in medium prognosis problem.
Will choose a close valid value.
Source code in framjules/JulESTimeResolution.py
63 64 65 66 67 68 69 70 |
|
loaders
time_vector_loaders
DemandJulESH5TimeVectorLoader
Bases: JulESH5TimeVectorLoader
Workaround to get demand results and at the same time avoid name conflicts.
Source code in framjules/loaders/time_vector_loaders.py
248 249 250 251 252 253 254 255 256 |
|
JulESH5TimeVectorLoader
Bases: FileLoader
, TimeVectorLoader
Loader for JulES H5 files containing time vectors.
Source code in framjules/loaders/time_vector_loaders.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 |
|
__eq__(other: object) -> bool
Check if self and other are equal.
Source code in framjules/loaders/time_vector_loaders.py
221 222 223 224 225 |
|
__hash__() -> int
Return hash of NVEH5TimeVectorLoader object.
Source code in framjules/loaders/time_vector_loaders.py
227 228 229 230 231 232 233 234 |
|
__init__(source: Path | str, units: dict[str, str], relative_loc: Path | str | None = None, is_whole_years: bool = False) -> None
Initialize the NVEH5TimeVectorLoader.
Source code in framjules/loaders/time_vector_loaders.py
33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 |
|
clear_cache() -> None
Clear cached data.
Source code in framjules/loaders/time_vector_loaders.py
49 50 51 52 53 |
|
get_fingerprint() -> Fingerprint
Get the fingerprint of the NVEH5TimeVectorLoader.
Source code in framjules/loaders/time_vector_loaders.py
217 218 219 |
|
get_index(vector_id: str) -> TimeIndex
Find the time index for a given vector id.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
vector_id
|
str
|
(str) |
required |
Returns:
Type | Description |
---|---|
TimeIndex
|
TimeIndex |
Source code in framjules/loaders/time_vector_loaders.py
93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 |
|
get_metadata() -> str
Get metadata from the file.
Source code in framjules/loaders/time_vector_loaders.py
181 182 183 |
|
get_reference_period(vector_id: str) -> None
Return None.
Source code in framjules/loaders/time_vector_loaders.py
55 56 57 |
|
get_unit(vector_id: str) -> str
Get the unit of the time vector.
Source code in framjules/loaders/time_vector_loaders.py
177 178 179 |
|
get_values(vector_id: str) -> NDArray
Find the values for a given vector id.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
vector_id
|
str
|
(str) |
required |
Returns:
Name | Type | Description |
---|---|---|
NDArray |
NDArray
|
Values for the vector id. |
Source code in framjules/loaders/time_vector_loaders.py
67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 |
|
is_max_level(vector_id: str) -> None
Return None.
Source code in framjules/loaders/time_vector_loaders.py
59 60 61 |
|
is_zero_one_profile(vector_id: str) -> None
Return None.
Source code in framjules/loaders/time_vector_loaders.py
63 64 65 |
|
SupplyJulESH5TimeVectorLoader
Bases: JulESH5TimeVectorLoader
Workaround to get supply results and at the same time avoid name conflicts.
Source code in framjules/loaders/time_vector_loaders.py
237 238 239 240 241 242 243 244 245 |
|
solve_handler
JulESAggregator
JulESAggregator
Bases: Base
Source code in framjules/solve_handler/JulESAggregator.py
12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 |
|
__init__(clearing: Model, short: list[Aggregator], medium: list[Aggregator], long: list[Aggregator]) -> None
Class for defining and calculation aggregated Model instances based on a clearing Model.
Creates three aggregated Model instances for short-, medium- and long-term simulation in JulES.
Note
- Short term Model is aggregated from a Clearing Model.
- Medium term Model is aggregated from the Short term Model.
- Long term Model is aggregated from the medium term Model
Parameters:
Name | Type | Description | Default |
---|---|---|---|
clearing
|
Model
|
The clearing Model to aggregate from. |
required |
short
|
list[Aggregator]
|
List of aggregations to create the short term Model from clearing. |
required |
medium
|
list[Aggregator]
|
List of aggregations to create the medium term Model from short |
required |
long
|
list[Aggregator]
|
List of aggregations to create the long term Model from medium. |
required |
Source code in framjules/solve_handler/JulESAggregator.py
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 |
|
assert_equal_storages(simpler_short: dict[str, Component], simpler_medium: dict[str, Component], simpler_long: dict[str, Component]) -> None
Check that all Nodes with Storages are preserved between short, medium and long term Models.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
simpler_short
|
dict[str, Component]
|
Short term Model Components. |
required |
simpler_medium
|
dict[str, Component]
|
Medium term Model Components. |
required |
simpler_long
|
dict[str, Component]
|
Long term Model Components. |
required |
Raises:
Type | Description |
---|---|
ValueError
|
If the Models have differing Storages. |
Source code in framjules/solve_handler/JulESAggregator.py
117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 |
|
get_long_term_aggregation_map() -> dict[str, set[str] | None]
Get the aggregation map of Components from clearing to long term Model.
Source code in framjules/solve_handler/JulESAggregator.py
71 72 73 |
|
get_long_term_graph_map(graph_clearing: dict[str, Component], graph_long: dict[str, Component]) -> dict[str, set[str] | None]
Get aggregation map for version of long term Model with graph of Flows and Nodes.
Source code in framjules/solve_handler/JulESAggregator.py
103 104 105 106 107 108 109 110 111 112 113 114 115 |
|
get_long_term_model() -> Model
Apply defined aggregations for long term Model.
Source code in framjules/solve_handler/JulESAggregator.py
57 58 59 60 61 |
|
get_medium_term_aggregation_map() -> dict[str, set[str] | None]
Get the aggregation map of Components from clearing to medium term Model.
Source code in framjules/solve_handler/JulESAggregator.py
67 68 69 |
|
get_medium_term_graph_map(graph_clearing: dict[str, Component], graph_medium: dict[str, Component]) -> dict[str, set[str] | None]
Get aggregation map for version of medium term Model with graph of Flows and Nodes.
Source code in framjules/solve_handler/JulESAggregator.py
89 90 91 92 93 94 95 96 97 98 99 100 101 |
|
get_medium_term_model() -> Model
Apply defined aggregations for medium term Model.
Source code in framjules/solve_handler/JulESAggregator.py
51 52 53 54 55 |
|
get_short_term_aggregation_map() -> dict[str, set[str] | None]
Get the aggregation map of Components from clearing to short term Model.
Source code in framjules/solve_handler/JulESAggregator.py
63 64 65 |
|
get_short_term_graph_map(graph_clearing: dict[str, Component], graph_short: dict[str, Component]) -> dict[str, set[str] | None]
Get aggregation map for version of short term Model with graph of Flows and Nodes.
Source code in framjules/solve_handler/JulESAggregator.py
75 76 77 78 79 80 81 82 83 84 85 86 87 |
|
get_short_term_model() -> Model
Apply defined aggregations for short term Model.
Source code in framjules/solve_handler/JulESAggregator.py
45 46 47 48 49 |
|
JulESNames
JulESNames
Constants (both static and dynamic ones defined in init) used in JulES.
Source code in framjules/solve_handler/JulESNames.py
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 |
|
__init__() -> None
Dynamically settable names for JulES.
Source code in framjules/solve_handler/JulESNames.py
261 262 263 264 265 266 267 |
|
SolveHandler
SolveHandler
Bases: Base
Common data methods for different simulation modes.
Source code in framjules/solve_handler/SolveHandler.py
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 |
|
__init__(folder: Path, clearing_model: Model, config: JulESConfig) -> None
Hold all data and methods needed to solve JulES.
Source code in framjules/solve_handler/SolveHandler.py
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 |
|
build() -> None
Build input files for JulES.
Source code in framjules/solve_handler/SolveHandler.py
136 137 138 139 |
|
configure() -> None
Build configuration file for JulES.
Source code in framjules/solve_handler/SolveHandler.py
141 142 143 144 145 146 147 |
|
create_build_handler() -> BuildHandler
Create specialized BuildHandler for the chosen simulation mode.
Source code in framjules/solve_handler/SolveHandler.py
159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 |
|
create_config_handler() -> ConfigHandler
Create specialized ConfigHandler for the chosen simulation mode.
Source code in framjules/solve_handler/SolveHandler.py
176 177 178 179 180 181 182 183 184 185 186 187 188 |
|
create_results_handler() -> SerialResultsHandler
Create a SerialResultsHandler.
Source code in framjules/solve_handler/SolveHandler.py
218 219 220 221 222 223 224 225 226 227 228 229 230 231 |
|
create_run_handler() -> SerialRunHandler
Create specialized RunHandler for the chosen simulation mode.
Source code in framjules/solve_handler/SolveHandler.py
190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 |
|
fill_graph_infos(graph_infos: GraphInfos, graphs: NodeFlowGraphs, names: JulESNames, aggregator: JulESAggregator, config: JulESConfig, db: QueryDB) -> None
Fill graph_info with derived info.
Source code in framjules/solve_handler/SolveHandler.py
236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 |
|
is_short_term_storage_subsystem(subsystem: set[str], graph: NodeFlowGraphs, config: JulESConfig) -> bool
Return True if is_short_term_storage_system.
Source code in framjules/solve_handler/SolveHandler.py
691 692 693 |
|
run() -> None
Run Julia-JulES.
Source code in framjules/solve_handler/SolveHandler.py
149 150 151 152 |
|
set_agg_initial_storage(agg_graph_info: dict[str, ComponentInfo], det_graph_info: dict[str, ComponentInfo]) -> None
Set global_eneq and initial_storage in aggregated graph_info from detailed graph_info.
Source code in framjules/solve_handler/SolveHandler.py
672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 |
|
set_agg_market_node_info(out: dict[str, ComponentInfo], aggregator: JulESAggregator, detailed_graph: dict[str, Flow | Node], aggregated_graph: dict[str, Flow | Node]) -> None
Aggregate market nodes and update info.agg_market_node_id.
Source code in framjules/solve_handler/SolveHandler.py
435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 |
|
set_agg_storage_node_info(out: dict[str, ComponentInfo], aggregator: JulESAggregator, detailed_graph: dict[str, Flow | Node], aggregated_graph: dict[str, Flow | Node]) -> None
Aggregate storages and update info.agg_storage_node_id.
Source code in framjules/solve_handler/SolveHandler.py
413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 |
|
set_basic_node_flow_info(out_graph_info: dict[str, ComponentInfo], graph: dict[str, Flow | Node]) -> None
Info directly accessible from Node and Flow API.
We also set domain_commodity for Flow as main_node.get_commodity().
Source code in framjules/solve_handler/SolveHandler.py
304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 |
|
set_jules_id_info(out: dict[str, ComponentInfo], is_aggregated: bool, names: JulESNames) -> None
Add jules ids in compliance with required format. Warning! Julia-JulES currently requires this format
Source code in framjules/solve_handler/SolveHandler.py
456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 |
|
set_market_info(out_graph_info: dict[str, ComponentInfo], graph: dict[str, Flow | Node], names: JulESNames) -> None
Set is_market_node and if so, also set jules_commodity to market.
Source code in framjules/solve_handler/SolveHandler.py
391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 |
|
set_results() -> None
Set results from Julia-JulES run into domain models.
Source code in framjules/solve_handler/SolveHandler.py
154 155 156 157 |
|
set_sss_global_eneq_info(out: dict[str, ComponentInfo], graph: dict[str, Flow | Node], db: QueryDB, config: JulESConfig) -> dict[str, float]
Set global_energy_coefficient using metadata. Convert to usable unit.
Source code in framjules/solve_handler/SolveHandler.py
569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 |
|
set_sss_info(out_graph_info: dict[str, ComponentInfo], graph: dict[str, Flow | Node], names: JulESNames, config: JulESConfig) -> None
Storage SubSystem (sss) info.
Source code in framjules/solve_handler/SolveHandler.py
332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 |
|
set_sss_initial_storage(out: dict[str, ComponentInfo], graph: dict[str, Flow | Node], db: QueryDB, config: JulESConfig) -> dict[str, float]
Set sss_initial_storage. Convert to usable unit.
Source code in framjules/solve_handler/SolveHandler.py
610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 |
|
set_unit_info(out: dict[str, ComponentInfo], graph: dict[str, Flow | Node], config: JulESConfig, names: JulESNames) -> None
Calculate all types of target units.
Need from config: - unit_money - unit_stock per commodity for each storage_node - unit_flow per commodity for each flow
Will derive: - unit_price per commodity for each market_node - unit_cost for each flow - unit_coeffs for each flow - unit_eneq for each sss_member in each sss
And also for each flow, we derive: - unit_param_type - unit_param_flow_unit - unit_param_flow_unit
Source code in framjules/solve_handler/SolveHandler.py
479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 |
|
build_handler
BuildHandler
BuildHandler
Bases: Base
, ABC
Responsible for implementing shared functionality in build method.
Source code in framjules/solve_handler/build_handler/BuildHandler.py
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 |
|
__init__(folder: Path, config: JulESConfig, names: JulESNames, domain_models: DomainModels, graphs: NodeFlowGraphs, graph_infos: GraphInfos, db: QueryDB) -> None
Initialize handler.
Use inputs passed down from SolveHandler
and create extra fields only relevant for the build phase.
Source code in framjules/solve_handler/build_handler/BuildHandler.py
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
|
add_dummy_exogenous_balance() -> None
Add a dummy exogenous Node for JulES.
Source code in framjules/solve_handler/build_handler/BuildHandler.py
227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 |
|
add_endogenous_flows(endogenous_flows: dict[str, Flow], graph_info: dict[str, ComponentInfo]) -> None
Append data elements for endogenous flows and related attributes.
Source code in framjules/solve_handler/build_handler/BuildHandler.py
329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 |
|
add_endogenous_nodes(endogenous_nodes: dict[str, Node], graph_info: dict[str, ComponentInfo], model_id: str) -> None
Append endogenous balance related data elements for endogenous node.
Source code in framjules/solve_handler/build_handler/BuildHandler.py
301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 |
|
add_exogenous_flows(exogenous_flows: dict[str, Flow], graph_info: dict[str, ComponentInfo]) -> None
Append data elements related to an exogenous flow.
Source code in framjules/solve_handler/build_handler/BuildHandler.py
317 318 319 320 321 322 323 324 325 326 327 |
|
add_exogenous_nodes(exogenous_nodes: dict[str, Node], graph_info: dict[str, ComponentInfo]) -> None
Append exogenous balance related data elements for exogenous node.
Source code in framjules/solve_handler/build_handler/BuildHandler.py
268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 |
|
add_flow_arrows(flow_id: str, flow: Flow, graph_info: dict[str, ComponentInfo]) -> None
Append arrow related data elements for each arrow in flow.
Source code in framjules/solve_handler/build_handler/BuildHandler.py
425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 |
|
add_flow_costs(flow_id: str, flow: Flow, flow_info: ComponentInfo) -> None
Append cost data element for each cost in flow.
Source code in framjules/solve_handler/build_handler/BuildHandler.py
445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 |
|
add_flow_lower_bound(flow_id: str, flow: Flow, flow_info: ComponentInfo) -> None
Append lower bound related data elements for a flow.
Source code in framjules/solve_handler/build_handler/BuildHandler.py
397 398 399 400 401 402 403 404 405 406 407 408 409 410 |
|
add_flow_upper_bound(flow_id: str, flow: Flow, flow_info: ComponentInfo) -> None
Append upper bound related data elements for a flow.
Source code in framjules/solve_handler/build_handler/BuildHandler.py
412 413 414 415 416 417 418 419 420 421 422 423 |
|
add_positive_capacity(flow_or_storage_id: str, info: ComponentInfo, capacity: FlowVolume | StockVolume, bound_id: str, is_lower_bound: bool) -> None
Append data elements related to positive capacity.
Source code in framjules/solve_handler/build_handler/BuildHandler.py
466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 |
|
add_rhs_term(flow_id: str, flow: Flow, arrow: Arrow, node_info: ComponentInfo, flow_info: ComponentInfo) -> None
Append data elements related to rhs term.
Source code in framjules/solve_handler/build_handler/BuildHandler.py
367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 |
|
add_storage(model_id: str, storage: Storage, info: ComponentInfo) -> None
Append data elements related to a storage.
Source code in framjules/solve_handler/build_handler/BuildHandler.py
345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 |
|
build() -> None
Build input and configuration files for JulES.
Source code in framjules/solve_handler/build_handler/BuildHandler.py
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 |
|
build_data_elements(model_id: str, graph: dict[str, Flow | Node], graph_info: dict[str, ComponentInfo]) -> None
Write json file with data elements for a graph belonging to a given model_id.
Source code in framjules/solve_handler/build_handler/BuildHandler.py
98 99 100 101 102 103 104 105 106 107 108 |
|
build_start_storage(filename: str, graph_info: dict[str, ComponentInfo]) -> None
Write start storag json file to folder.
Source code in framjules/solve_handler/build_handler/BuildHandler.py
87 88 89 90 91 92 93 94 95 96 |
|
build_storage_mapping(graph_info: dict[str, ComponentInfo]) -> None
Write the mapping of storages from Clearing to Aggregated Model to json.
Source code in framjules/solve_handler/build_handler/BuildHandler.py
181 182 183 184 185 186 187 188 189 190 191 |
|
build_time_vectors() -> None
Write json file with time vector data elements and csv file for each unique time index.
Source code in framjules/solve_handler/build_handler/BuildHandler.py
117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 |
|
fill_data_elements(model_id: str, graph: dict[str, Flow | Node], graph_info: dict[str, ComponentInfo]) -> None
Reset and fill self.append.data_elements with data element json data.
Source code in framjules/solve_handler/build_handler/BuildHandler.py
193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 |
|
get_capacity_level(root_id: str, capacity: FlowVolume | StockVolume, info: ComponentInfo) -> str | float
abstractmethod
Query capacity level.
Source code in framjules/solve_handler/build_handler/BuildHandler.py
515 516 517 518 |
|
get_capacity_profile(root_id: str, capacity: FlowVolume | StockVolume, info: ComponentInfo) -> str | float
abstractmethod
Query capacity profile.
Source code in framjules/solve_handler/build_handler/BuildHandler.py
520 521 522 523 524 525 526 527 528 |
|
get_coefficient_level(root_id: str, arrow: Arrow, info: ComponentInfo) -> str | float
abstractmethod
Query arrow coefficient level.
Source code in framjules/solve_handler/build_handler/BuildHandler.py
530 531 532 533 |
|
get_cost_term_level(root_id: str, cost_term: Cost, info: ComponentInfo) -> str | float
abstractmethod
Query cost term level.
Source code in framjules/solve_handler/build_handler/BuildHandler.py
535 536 537 538 |
|
get_cost_term_profile(root_id: str, cost_term: Cost, info: ComponentInfo) -> str | float
abstractmethod
Query cost term profile.
Source code in framjules/solve_handler/build_handler/BuildHandler.py
540 541 542 543 |
|
get_price_level(root_id: str, price: Price, info: ComponentInfo) -> str | float
abstractmethod
Query price level.
Source code in framjules/solve_handler/build_handler/BuildHandler.py
505 506 507 508 |
|
get_price_profile(root_id: str, price: Price, info: ComponentInfo) -> str | float
abstractmethod
Query price profile.
Source code in framjules/solve_handler/build_handler/BuildHandler.py
510 511 512 513 |
|
get_rhs_term_level(rhs_term_id: str, flow: Flow, arrow: Arrow, flow_info: ComponentInfo) -> str | float
abstractmethod
Query rhs term level.
Source code in framjules/solve_handler/build_handler/BuildHandler.py
545 546 547 548 549 550 551 552 553 554 |
|
get_rhs_term_profile(rhs_term_id: str, flow: Flow, arrow: Arrow, flow_info: ComponentInfo) -> str | float
abstractmethod
Query rhs term profile.
Source code in framjules/solve_handler/build_handler/BuildHandler.py
556 557 558 559 560 561 562 563 564 565 |
|
get_time_index_id(timeindex: FixedFrequencyTimeIndex) -> str
Return id that works in file name.
Source code in framjules/solve_handler/build_handler/BuildHandler.py
153 154 155 156 157 158 159 160 161 |
|
stop_if_errors() -> None
Throw RunTimeError if any errors.
Source code in framjules/solve_handler/build_handler/BuildHandler.py
110 111 112 113 114 115 |
|
write_json_file(data: object, filename: str) -> None
Write data to json.
Source code in framjules/solve_handler/build_handler/BuildHandler.py
490 491 492 493 |
|
write_table(time_index_id: str, timeindex: FixedFrequencyTimeIndex) -> tuple[Path, list[str]]
Write all vectors corresponding to time_index_id to a csv file.
Source code in framjules/solve_handler/build_handler/BuildHandler.py
163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 |
|
DataElementAppender
Functionality to reate data element to JulES.
DataElementAppender
Used to generate list of data elements for JulES.
Source code in framjules/solve_handler/build_handler/DataElementAppender.py
10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 |
|
__init__(names: JulESNames) -> None
Initialize new DataElementAppender.
Source code in framjules/solve_handler/build_handler/DataElementAppender.py
13 14 15 16 |
|
base_arrow(arrow_id: str, flow_id: str, balance_id: str, is_ingoing: bool, conversion: str | float) -> None
Append base arrow data element.
Source code in framjules/solve_handler/build_handler/DataElementAppender.py
125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 |
|
base_flow(flow_id: str) -> None
Append base flow data element.
Source code in framjules/solve_handler/build_handler/DataElementAppender.py
67 68 69 |
|
base_rhs_term(rhs_term_id: str, balance_id: str, is_ingoing: bool, unit_param_id: str) -> None
Append base rhs term data element.
Source code in framjules/solve_handler/build_handler/DataElementAppender.py
167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 |
|
base_storage(storage_id: str, balance_id: str) -> None
Append base storage data element.
Source code in framjules/solve_handler/build_handler/DataElementAppender.py
187 188 189 190 191 192 193 194 195 196 197 198 199 200 |
|
base_table(table_id: str, path_table: str | Path, column_names: list[str]) -> None
Append base table data element.
Source code in framjules/solve_handler/build_handler/DataElementAppender.py
253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 |
|
column_time_values(time_values_id: str, table_id: str, column_id: str) -> None
Append column time values data element.
Source code in framjules/solve_handler/build_handler/DataElementAppender.py
270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 |
|
cost_term(cost_term_id: str, flow_or_storage_id: str, is_flow: str, is_cost: bool, cost: str | float) -> None
Append cost term data element.
Source code in framjules/solve_handler/build_handler/DataElementAppender.py
146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 |
|
endogenous_balance(balance_id: str, commodiy: str) -> None
Append endogenous balance data element.
Source code in framjules/solve_handler/build_handler/DataElementAppender.py
35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
|
exogenous_balance(balance_id: str, commodiy: str, price_param_id: str | float) -> None
Append exogenous balance data element.
Source code in framjules/solve_handler/build_handler/DataElementAppender.py
18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 |
|
global_eneq(global_eneq_id: str, balance_id: str, value: float) -> None
Append global energy equivalent data element.
Source code in framjules/solve_handler/build_handler/DataElementAppender.py
202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 |
|
lower_zero_capacity(lower_bound_id: str, is_flow: bool, flow_or_storage_id: str) -> None
Append zero lower capacity data element.
Source code in framjules/solve_handler/build_handler/DataElementAppender.py
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 |
|
mean_series_param(param_id: str, level: str | float, profile: str | float) -> None
Append mean series param data element.
Source code in framjules/solve_handler/build_handler/DataElementAppender.py
50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 |
|
ms_time_delta(time_delta_id: str, milliseconds: float) -> None
Append ms time delta data element.
Source code in framjules/solve_handler/build_handler/DataElementAppender.py
219 220 221 222 223 224 225 226 227 228 229 230 231 232 |
|
one_year_time_vector(time_vector_id: str, time_index_id: str, time_values_id: str) -> None
Append one year time vector data element.
Source code in framjules/solve_handler/build_handler/DataElementAppender.py
304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 |
|
positive_capacity(bound_id: str, is_flow: bool, flow_or_storage_id: str, is_lower_bound: bool, param_id: str) -> None
Append positive capacity data element.
Source code in framjules/solve_handler/build_handler/DataElementAppender.py
88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 |
|
range_time_index(time_index_id: str, start_time: datetime, num_steps: int, time_delta_id: str) -> None
Append range time index data element.
Source code in framjules/solve_handler/build_handler/DataElementAppender.py
234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 |
|
rotating_time_vector(time_vector_id: str, time_index_id: str, time_values_id: str) -> None
Append rotating time vector data element.
Source code in framjules/solve_handler/build_handler/DataElementAppender.py
287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 |
|
unit_param(unit_param_id: str, series_param_id: str, info: ComponentInfo) -> None
Append unit param data element.
Source code in framjules/solve_handler/build_handler/DataElementAppender.py
109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 |
|
SerialBuildHandler
SerialBuildHandler
Bases: BuildHandler
Specialized methods for serial simulation.
Source code in framjules/solve_handler/build_handler/SerialBuildHandler.py
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 |
|
__init__(folder: Path, config: JulESConfig, names: JulESNames, domain_models: DomainModels, graphs: NodeFlowGraphs, graph_infos: GraphInfos, db: QueryDB) -> None
See BuildHandler.
Source code in framjules/solve_handler/build_handler/SerialBuildHandler.py
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
|
get_attribute_level(root_id: str, attribute: LevelProfile, target_unit: str | None) -> float
Get level value.
Source code in framjules/solve_handler/build_handler/SerialBuildHandler.py
52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 |
|
get_attribute_profile(root_id: str, attribute: LevelProfile | Arrow, default: float, unit: str | None, info: ComponentInfo) -> str | float
Add profile vector to timevectors and return profile_id.
Source code in framjules/solve_handler/build_handler/SerialBuildHandler.py
71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 |
|
get_capacity_level(root_id: str, capacity: StockVolume | FlowVolume, info: ComponentInfo) -> str | float
get_capacity_level for serial simulation. Handles stock or flow based on info.
Source code in framjules/solve_handler/build_handler/SerialBuildHandler.py
176 177 178 |
|
get_capacity_profile(root_id: str, capacity: FlowVolume | StockVolume, info: ComponentInfo) -> str | float
get_capacity_profile for serial simulation.
Source code in framjules/solve_handler/build_handler/SerialBuildHandler.py
192 193 194 195 196 197 198 199 200 |
|
get_coefficient_level(root_id: str, arrow: Arrow, info: ComponentInfo) -> str | float
get_coefficient_level for serial simulation.
Source code in framjules/solve_handler/build_handler/SerialBuildHandler.py
180 181 182 |
|
get_cost_term_level(root_id: str, cost_term: Cost, info: ComponentInfo) -> float
get_cost_term_level for serial simulation.
Source code in framjules/solve_handler/build_handler/SerialBuildHandler.py
172 173 174 |
|
get_cost_term_profile(root_id: str, cost_term: Cost, info: ComponentInfo) -> str | float
get_cost_term_profile for serial simulation.
Source code in framjules/solve_handler/build_handler/SerialBuildHandler.py
188 189 190 |
|
get_price_level(root_id: str, price: Price, info: ComponentInfo) -> float
get_price_level for serial simulation.
Source code in framjules/solve_handler/build_handler/SerialBuildHandler.py
168 169 170 |
|
get_price_profile(root_id: str, price: Price, info: ComponentInfo) -> str | float
get_price_profile for serial simulation.
Source code in framjules/solve_handler/build_handler/SerialBuildHandler.py
184 185 186 |
|
get_rhs_term_level(rhs_term_id: str, flow: Flow, arrow: Arrow, flow_info: ComponentInfo) -> float
Convert volume (main node) to target node volume.
This may scale the volume using arrow coefficient, e.g. due to transportation loss.
This may also change unit, if target node belongs to different commodity than main node, such as for hydropower.
Source code in framjules/solve_handler/build_handler/SerialBuildHandler.py
202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 |
|
get_rhs_term_profile(rhs_term_id: str, flow: Flow, arrow: Arrow, flow_info: ComponentInfo) -> str | float
Create profile (possibly) representing volume_profile * coefficient_profile.
Source code in framjules/solve_handler/build_handler/SerialBuildHandler.py
258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 |
|
dataclasses
ComponentInfo
dataclass
All derived info we need during solve.
Source code in framjules/solve_handler/dataclasses.py
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 |
|
DomainModels
dataclass
Model instance for each term.
Source code in framjules/solve_handler/dataclasses.py
7 8 9 10 11 12 13 14 |
|
GraphInfos
dataclass
Hold all component info for all graphs.
Source code in framjules/solve_handler/dataclasses.py
74 75 76 77 78 79 80 81 |
|
NodeFlowGraphs
dataclass
Node-Flow representation of domain model components via get_supported_components.
Source code in framjules/solve_handler/dataclasses.py
17 18 19 20 21 22 23 24 |
|
results_handler
SerialResultsHandler
Handling of results produced by running JulES in Serial mode.
SerialResultsHandler
Set serial simulation results.
Source code in framjules/solve_handler/results_handler/SerialResultsHandler.py
28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 |
|
__init__(folder: Path | str, config: JulESConfig, names: JulESNames, graphs: NodeFlowGraphs, graph_infos: GraphInfos) -> None
Handle retrieval of results from a JulES Serial simulation.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
folder
|
Path | str
|
Path to folder of the JulES simulation. |
required |
config
|
JulESConfig
|
Simulation config. |
required |
names
|
JulESNames
|
JulES namespace. |
required |
graphs
|
NodeFlowGraphs
|
Graphs used in the simulation. |
required |
graph_infos
|
GraphInfos
|
JulES specific info of each Component in the graphs. |
required |
Source code in framjules/solve_handler/results_handler/SerialResultsHandler.py
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
|
set_results() -> None
Set JulES results of all Components in the clearing graph.
Source code in framjules/solve_handler/results_handler/SerialResultsHandler.py
58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 |
|
run_handler
SerialRunHandler
SerialRunHandler
Bases: JuliaModel
Handle running the JulES solver in serial simulation mode.
Source code in framjules/solve_handler/run_handler/SerialRunHandler.py
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 |
|
__init__(folder: Path, config: JulESConfig, names: JulESNames, dependencies: list[str | tuple[str, str | None]] | None = None) -> None
Initialize JulES serial folder.
The three parameters env_path, depot_path and julia_path sets environment variables for locations of your Julia environment, packages and language. - If user has not specified locations, the default is to use the current python/conda environment. - If a system installation of Python is used, the default is set to the current user location.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
folder
|
Path
|
Location of JulES model dataset. |
required |
config
|
JulESConfig
|
Simulaiton config. |
required |
names
|
JulESNames
|
JulES namespace object. |
required |
dependencies
|
list[str]
|
Julia packages dependencies. List of str, either package names or urls. |
None
|
Source code in framjules/solve_handler/run_handler/SerialRunHandler.py
14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 |
|
run() -> None
Run JulES in Series mode.
Source code in framjules/solve_handler/run_handler/SerialRunHandler.py
47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 |
|