-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Refactor tools.py: return 1 output df in timeseries Perez (#13)
* Hot fix for df_registries + clean up of plot functions * Created function to generate df_outputs from df_registries * Add pvrow_segment_index in surface registry to keep track of segmnts * will be much easier to track in the surface registry * need to make sure that the shaded surfaces are broken up after the discretization * Now calculating interrow shading after discretizing surfaces * this way can keep track of pvrow segments * also now the unshaded surfaces of the prow are not splitted due to direct shading as it used to be * Updated tests as now no unecessary surface split for non shaded side * so the array size changed in one test * another test got order swapped, but should not matter * Very small changes in expected values bc geometry cutting fn changed * minor changes in the intersect point in interrow shading calculation certainly caused the small changes in this case where direct shading happens * Now can also calculate segment outputs from df_registries * used v011 outputs to make sure it was correct * Simplify outputs of timeseries Perez calculations * fix one of the tests based on discretized segments * Fixed functional test serial perez calculations * Fixed all remaining tests from timeseries calc simplification
- Loading branch information
Showing
16 changed files
with
399 additions
and
266 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
import pytest | ||
import os | ||
import pandas as pd | ||
|
||
DIR_TEST = os.path.dirname(__file__) | ||
DIR_TEST_DATA = os.path.join(DIR_TEST, 'test_files') | ||
|
||
|
||
@pytest.fixture(scope='function') | ||
def df_outputs(): | ||
""" Example of df_outputs to be used for tests """ | ||
fp = os.path.join(DIR_TEST_DATA, 'file_test_df_outputs.csv') | ||
df_outputs = pd.read_csv(fp, header=[0, 1, 2], index_col=0) | ||
df_outputs.index = pd.to_datetime(df_outputs.index) | ||
|
||
yield df_outputs | ||
|
||
|
||
@pytest.fixture(scope='function') | ||
def df_registries(): | ||
""" Example of df_registries to be used for tests """ | ||
fp = os.path.join(DIR_TEST_DATA, 'file_test_df_registries.csv') | ||
df_registries = pd.read_csv(fp, header=[0], parse_dates=['timestamps']) | ||
yield df_registries | ||
|
||
|
||
@pytest.fixture(scope='function') | ||
def df_segments(): | ||
""" Example of df_segments to be used for tests """ | ||
fp = os.path.join(DIR_TEST_DATA, 'file_test_df_segments.csv') | ||
df_segments = pd.read_csv(fp, header=[0, 1], index_col=0) | ||
df_segments.index = pd.to_datetime(df_segments.index) | ||
yield df_segments |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
,0,1 | ||
2017-04-15 10:26:00,0.13931705195219535,0.1281562651393122 | ||
2017-04-15 10:27:00,0.13953385431646614,0.12830040096440057 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
,solar_zenith,solar_azimuth,array_tilt,dni,dhi,ghi,array_azimuth,poa_isotropic,poa_circumsolar,poa_horizon,vf_horizon,vf_circumsolar,vf_isotropic,luminance_horizon,luminance_circumsolar,luminance_isotropic,poa_total_diffuse | ||
2017-04-15 10:26:00,33.85139897,131.6267856,-25.6875,1028.370017,90.505481,920.948695,270.0,42.6681821006,51.0250378845,7.60195710557,0.433462489758,1.11849713283,0.950585804807,17.5377507517,45.6192835785,44.8861974215,101.295177091 | ||
2017-04-15 10:27:00,33.69866897,131.9740324,-25.6925,1028.490326,90.557651,923.195471,270.0,42.6318473958,51.0146850523,7.58666529173,0.433541130166,1.11608053999,0.950566889722,17.4992976764,45.7087846479,44.8488663521,101.23319774 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
pvrow,array_is_shaded,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1 | ||
side,,back,back,back,back,back,back,back,back,back,front,front,front,front,front,front,front,front,front,back,back,back,back,back,back,back,back,back,front,front,front,front,front,front,front,front,front | ||
term,,circumsolar_term,direct_term,horizon_band_shading_pct,horizon_term,irradiance_term,isotropic_term,q0,qinc,reflection_term,circumsolar_term,direct_term,horizon_band_shading_pct,horizon_term,irradiance_term,isotropic_term,q0,qinc,reflection_term,circumsolar_term,direct_term,horizon_band_shading_pct,horizon_term,irradiance_term,isotropic_term,q0,qinc,reflection_term,circumsolar_term,direct_term,horizon_band_shading_pct,horizon_term,irradiance_term,isotropic_term,q0,qinc,reflection_term | ||
4/15/2017 10:26,FALSE,0,0,0,7.601957106,7.601957106,2.366247585,7.410442474,148.2088495,138.2406448,51.02503788,955.2479674,0,7.601957106,1013.874962,41.81449994,31.9147256,1063.824187,8.134724361,0,0,50.43298874,3.768062934,3.768062934,1.727308046,6.83247544,136.6495088,131.1541378,51.02503788,955.2479674,0,7.601957106,1013.874962,42.81663696,31.98817677,1066.272559,9.580959761 | ||
4/15/2017 10:27,FALSE,0,0,0,7.586665292,7.586665292,2.365154307,7.41991129,148.3982258,138.4464062,51.01468505,954.9966611,0,7.586665292,1013.598011,41.77857856,31.90585393,1063.528464,8.151874312,0,0,50.44237013,3.759771505,3.759771505,1.72653543,6.83828301,136.7656602,131.2793533,51.01468505,954.9966611,0,7.586665292,1013.598011,42.78020623,31.97939972,1065.979991,9.601772851 |
Oops, something went wrong.