Closed hellemo closed 2 months ago
I moved the EMB specific types to the EMB extensions. This includes as well all legacy constructors, except for TransInvData
.
This has two major implications. Some functions we used previously in the GeoExt
are now required to be defined in the new extension in EnergyModelsGeography
, namely EMI.investment_data(tm::EMG.TransmissionMode)
, has_investment(tm::EMG.TransmissionMode)
, and EMI.start_cap(tm::EMG.TransmissionMode, t_inv, inv_data::NoStartInvData, cap)
.
The main reason to redefine them is to allow reference methods in EnergyModelsInvestments
that provide an error if the function is not specified directly by the user.
Thinks to be fixed in this PR:
EnergyModel
dependency for all functions. There is no reason to not have it. Any potential problem should be solved the same way as it is solved within the investment extension.data::Vector{Data}
for the nodes. Again, we do not want the user to provide anything that is not a proper EMB.Data
as that may result in unforeseen problems.EMI
. I used a lot of "@ref" for a simplified cross referencing in the data types. I would say this is something we do entirely at the end.I also want to reverse in the end some formatting from JuliaFormatter. In my opinion, constraint macro formatting is awful with JuliaFormatter as it does not capture the intrinsics of the mathematical equations.
@JulStraus I added some options to JuliaFormatter to keep more of the manual formatting. Check model.jl
and constraint_functions.jl
for some examples where constraints are formatted manually before formatting with JuliaFormatter. I think this will satisfy most if not all concerns when it comes to formatting of constraints.
@JulStraus I added some options to JuliaFormatter to keep more of the manual formatting. Check
model.jl
andconstraint_functions.jl
for some examples where constraints are formatted manually before formatting with JuliaFormatter. I think this will satisfy most if not all concerns when it comes to formatting of constraints.
Generally speaking, it looks better now. An alternative could also to use ignore
for constraint_functions.jl
and data_functions.jl
, although I am not fully certain that it would improve it.
Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests.
:information_source: You can also turn on project coverage checks and project coverage reporting on Pull Request comment
Thanks for integrating Codecov - We've got you covered :open_umbrella:
This is related to ongoing work to make
EnergyModelsInvestments
(EMI) independent ofEnergyModelsBase
(EMB). This is a first working draft to discuss. This PR makes the following changes to EMB:EMIExt
)JuliaFormatter
Things to do: