Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/twoaxistracking/layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,10 @@ def generate_field_layout(gcr, total_collector_area, min_tracker_spacing,
# Check if Lmin is physically possible given the collector area.
if (min_tracker_spacing < np.sqrt(4*total_collector_area/np.pi)):
raise ValueError('Lmin is not physically possible.')
# Check if mimimum and maximum ground cover ratios are exceded
# Check if mimimum and maximum ground cover ratios are exceeded
gcr_max = total_collector_area / (min_tracker_spacing**2 * np.sqrt(1-offset**2))
if (gcr < 0) or (gcr > gcr_max):
raise ValueError('Maximum ground cover ratio exceded or less than 0.')
raise ValueError('Maximum ground cover ratio exceeded or less than 0.')
if aspect_ratio < np.sqrt(1-offset**2):
raise ValueError('Aspect ratio is too low and not feasible')
if aspect_ratio > total_collector_area/(gcr*min_tracker_spacing**2):
Expand Down
6 changes: 3 additions & 3 deletions tests/test_layout.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ def test_square_layout_generation(rectangular_geometry, square_field_layout):
np.testing.assert_allclose(X, X_exp)
np.testing.assert_allclose(Y, Y_exp)
np.testing.assert_allclose(Z, Z_exp)
np.testing.assert_allclose(tracker_distance_exp, tracker_distance_exp)
np.testing.assert_allclose(tracker_distance, tracker_distance_exp)
np.testing.assert_allclose(relative_azimuth, relative_azimuth_exp)
np.testing.assert_allclose(relative_slope, relative_slope_exp)

Expand All @@ -74,7 +74,7 @@ def test_field_slope(rectangular_geometry, square_field_layout_sloped):
np.testing.assert_allclose(X, X_exp)
np.testing.assert_allclose(Y, Y_exp)
np.testing.assert_allclose(Z, Z_exp, atol=10**-9)
np.testing.assert_allclose(tracker_distance_exp, tracker_distance_exp)
np.testing.assert_allclose(tracker_distance, tracker_distance_exp)
np.testing.assert_allclose(relative_azimuth, relative_azimuth_exp)
np.testing.assert_allclose(relative_slope, relative_slope_exp, atol=10**-9)

Expand Down Expand Up @@ -126,7 +126,7 @@ def test_layout_generation_value_error(rectangular_geometry):
offset=0, rotation=90)

# Test if ValueError is raised if maximum ground cover ratio is exceeded
with pytest.raises(ValueError, match="Maximum ground cover ratio exceded"):
with pytest.raises(ValueError, match="Maximum ground cover ratio ex"):
_ = layout.generate_field_layout(
gcr=0.5, total_collector_area=collector_geometry.area,
min_tracker_spacing=min_tracker_spacing, neighbor_order=1,
Expand Down