Skip to content

Commit

Permalink
merge validation to main
Browse files Browse the repository at this point in the history
  • Loading branch information
b4pm-devops committed Jan 13, 2025
2 parents 052cc2b + f5a1824 commit aa1094c
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions energy_models/tests/l0_test_compute_el_wind_onshore.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,6 @@ def setUp(self):
self.biblio_data = pd.read_csv(biblio_data_path)
self.biblio_data = self.biblio_data.loc[self.biblio_data['sos_name']
== f'{GlossaryEnergy.electricity}.Wind_Onshore']
self.scaling_factor_techno_consumption = 1e3
self.scaling_factor_techno_production = 1e3
demand_ratio_dict = dict(
zip(EnergyMix.energy_list, np.ones((len(self.years), len(self.years)))))
demand_ratio_dict[GlossaryEnergy.Years] = self.years
Expand Down Expand Up @@ -126,6 +124,13 @@ def test_03_wind_on_shore_discipline(self):
power_production = disc.get_sosdisc_outputs(GlossaryEnergy.InstalledPower)
techno_infos_dict = disc.get_sosdisc_inputs('techno_infos_dict')

drop_pickle = True
if drop_pickle:
import pickle
with open('windtest.pkl','wb') as f:
pickle.dump(self.ee.dm.get_data_dict_values(), f)
pass

self.assertLessEqual(list(production_detailed[f'{GlossaryEnergy.electricity} ({GlossaryEnergy.energy_unit})'].values),
list(power_production['total_installed_power'] * techno_infos_dict[
'full_load_hours'] / 1000 * 1.001))
Expand All @@ -134,7 +139,7 @@ def test_03_wind_on_shore_discipline(self):
'full_load_hours'] / 1000 * 0.999))
filters = disc.get_chart_filter_list()
graph_list = disc.get_post_processing_list(filters)
# for graph in graph_list:
# graph.to_plotly().show()
for graph in graph_list:
graph.to_plotly().show()
# if __name__ == "__main__":
# unittest.main()
Binary file added energy_models/tests/windtest.pkl
Binary file not shown.

0 comments on commit aa1094c

Please sign in to comment.