Skip to content

Commit

Permalink
Merge branch 'develop' into integration
Browse files Browse the repository at this point in the history
  • Loading branch information
perrotcap committed Oct 17, 2024
2 parents 449f743 + cf56c4e commit 51c75d2
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions energy_models/database_witness_energy.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,23 @@ class DatabaseWitnessEnergy:

invest_before_year_start_folder = join(Path(__file__).parents[1], "data_energy", "techno_invests")

@classmethod
def get_techno_invest(cls, techno_name: str, year: int):
name_formatted = techno_name.replace(".", "_")
name_formatted = name_formatted.lower()
path_to_csv = os.path.join(cls.invest_before_year_start_folder, name_formatted) + ".csv"
heavy_collected_data = HeavyCollectedData(
value=path_to_csv,
description="",
unit="G$",
link="",
source="",
last_update_date=datetime.datetime.today(),
critical_at_year_start=True,
column_to_pick="invest"
)
return heavy_collected_data.get_value_at_year(year=year)

@classmethod
def get_techno_invest_before_year_start(cls, techno_name: str, year_start: int, construction_delay: int, is_available_at_year: bool = False):
name_formatted = techno_name.replace(".", "_")
Expand Down

0 comments on commit 51c75d2

Please sign in to comment.