IPESE / REHO

Master version of the model
Apache License 2.0
6 stars 10 forks source link

PV panels and Electricity Layer #7

Closed ArthurWaeber closed 6 months ago

ArthurWaeber commented 7 months ago

Is there an existing issue for this?

What happened?

Dear Dorsan, Dear Joseph, Dear Cédric,Dear REHO Explorers, After some basic trials on REHO, I wanted to simplify as much as possible the model to better understand the integration of my new technology (SOFC.mod). It seems that PV panels cannot be excluded of the analysis, and I am afraid that my SOFC model, as an electricity production unit is affected by this issue. FYI, my SOFC model is currently added but almost negligible compared to PV (even with investment cost being reduced down to 0).

Thanks for your help :) Arthur

Version

1.0.2 (Stable)

Relevant log output

Traceback (most recent call last):
  File "/Users/awaeber/Documents/PhD-IPESE/rSOC/reho2/scripts/arthur_w/test.py", line 45, in <module>
    reho.single_optimization()
  File "/Users/awaeber/Documents/PhD-IPESE/rSOC/reho2/reho/model/reho.py", line 525, in single_optimization
    self.add_df_Results(ampl, Scn_ID, Pareto_ID, self.scenario)
  File "/Users/awaeber/Documents/PhD-IPESE/rSOC/reho2/reho/model/reho.py", line 681, in add_df_Results
    df_Results = WR.get_df_Results_from_SP(ampl, scenario, self.method, self.buildings_data)
  File "/Users/awaeber/Documents/PhD-IPESE/rSOC/reho2/reho/model/postprocessing/write_results.py", line 338, in get_df_Results_from_SP
    df_Results["df_Unit"], df_Results["df_Unit_t"] = set_df_unit(df, ampl)
  File "/Users/awaeber/Documents/PhD-IPESE/rSOC/reho2/reho/model/postprocessing/write_results.py", line 134, in set_df_unit
    df3 = get_variable_in_pandas(df, 'Units_curtailment')
  File "/Users/awaeber/Documents/PhD-IPESE/rSOC/reho2/reho/model/postprocessing/write_results.py", line 581, in get_variable_in_pandas
    if len(id[0]) > 1:
IndexError: list index out of range

Process finished with exit code 1

Anything else?

I was not willing to look further into the repo code. However in initialise_units (infrastructure.py) the PV are added by default. The error I get here above is after me removing them explicitly from the list: units_to_keep (l. 386).

JosephLoustau commented 7 months ago

@cterrier24 and @DorsanL, we might have a discussion on why some units must be defined in the model. For instance, here if there is no PV, there is no Units_curtailment, hence the IndexError Arthur got.

So, Arthur, as you can guess from this, some of the units are explicitly not removable and this shoud not be changed in the code. For the issue that you have with the PV still used even when setting scenario['exclude_units'] = ['PV'], the issue comes from somewhere else and we can have a further discussion so that I can try to understand the problem

ArthurWaeber commented 7 months ago

Hi Joseph,

Sure let’s talk about it tomorrow or during the week. I chose to remove the PV, because they were overwhelmingly present in my simulations where I tries to integrate a new technology for electricity production (the SOFC). Let’s discuss that offline, no rush.

Thanks for your consideration :)

On 4 Mar 2024, at 12:16, JosephLoustau @.***> wrote:

@cterrier24https://github.com/cterrier24 and @DorsanLhttps://github.com/DorsanL, we might have a discussion on why some units must be defined in the model. For instance, here if there is no PV, there is no Units_curtailment, hence the IndexError Arthur got.

So, Arthur, as you can guess from this, some of the units are explicitly not removable and this shoud not be changed in the code. For the issue that you have with the PV still used even when setting scenario['exclude_units'] = ['PV'], the issue comes from somewhere else and we can have a further discussion so that I can try to understand the problem

— Reply to this email directly, view it on GitHubhttps://github.com/IPESE/REHO/issues/7#issuecomment-1976348719, or unsubscribehttps://github.com/notifications/unsubscribe-auth/AVXWCEWCJGVSL3IRI4O5SOLYWRJZPAVCNFSM6AAAAABD6L5AOCVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTSNZWGM2DQNZRHE. You are receiving this because you authored the thread.Message ID: @.***>