diff --git a/pvfactors/geometry/pvrow.py b/pvfactors/geometry/pvrow.py index 7ce025a6..66fe966c 100644 --- a/pvfactors/geometry/pvrow.py +++ b/pvfactors/geometry/pvrow.py @@ -338,7 +338,7 @@ def from_raw_inputs(cls, xy_center, width, rotation_vec, cut, is_shaded) # Create segment segment = TsSegment(segment_coords, illum, shaded, - n_vector=n_vector) + n_vector=n_vector, index=i) list_segments.append(segment) return cls(list_segments, n_vector=n_vector) diff --git a/pvfactors/tests/test_geometry/test_timeseries.py b/pvfactors/tests/test_geometry/test_timeseries.py index c6f44d14..c7149fff 100644 --- a/pvfactors/tests/test_geometry/test_timeseries.py +++ b/pvfactors/tests/test_geometry/test_timeseries.py @@ -27,6 +27,11 @@ def test_ts_pvrow(): cut, df_inputs.shaded_length_front, df_inputs.shaded_length_back) + + #check segment index + assert len(ts_pvrow.front.list_segments) == 3 + assert [s.index for s in ts_pvrow.front.list_segments] == [0,1,2] + # Check timeseries length of front and back segments for seg in ts_pvrow.front.list_segments: np.testing.assert_allclose(width / cut['front'], seg.length)