diff --git a/src/twoaxistracking/layout.py b/src/twoaxistracking/layout.py index 74d48d6..d4ef1f4 100644 --- a/src/twoaxistracking/layout.py +++ b/src/twoaxistracking/layout.py @@ -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): diff --git a/tests/test_layout.py b/tests/test_layout.py index 426e421..6c19cdd 100644 --- a/tests/test_layout.py +++ b/tests/test_layout.py @@ -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) @@ -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) @@ -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,