Repository: pvlib/pvlib-python

Issue:
`pvlib.soiling.hsu` takes `tilt` instead of `surface_tilt`
`pvlib.soiling.hsu` takes a `tilt` parameter representing the same thing we normally call `surface_tilt`:

https://github.com/pvlib/pvlib-python/blob/7a2ec9b4765124463bf0ddd0a49dcfedc4cbcad7/pvlib/soiling.py#L13-L14

https://github.com/pvlib/pvlib-python/blob/7a2ec9b4765124463bf0ddd0a49dcfedc4cbcad7/pvlib/soiling.py#L33-L34

I don't see any good reason for this naming inconsistency (I suspect `tilt` just got copied from the matlab implementation) and suggest we rename the parameter to `surface_tilt` with a deprecation.

Also, the docstring parameter type description says it must be `float`, but the model's reference explicitly says time series tilt is allowed: 

> The angle is variable for tracking systems and is taken as the average angle over the time step.




Discussion:
On second thought, I'm not seeing how this can be deprecated without reordering the parameters, which doesn't seem worth it to me.  I'm inclined to rename it without deprecation in 0.10.0. 

Patch:
diff --git a/pvlib/soiling.py b/pvlib/soiling.py
--- a/pvlib/soiling.py
+++ b/pvlib/soiling.py
@@ -10,7 +10,7 @@
 from pvlib.tools import cosd
 
 
-def hsu(rainfall, cleaning_threshold, tilt, pm2_5, pm10,
+def hsu(rainfall, cleaning_threshold, surface_tilt, pm2_5, pm10,
         depo_veloc=None, rain_accum_period=pd.Timedelta('1h')):
     """
     Calculates soiling ratio given particulate and rain data using the
@@ -30,7 +30,7 @@ def hsu(rainfall, cleaning_threshold, tilt, pm2_5, pm10,
         Amount of rain in an accumulation period needed to clean the PV
         modules. [mm]
 
-    tilt : float
+    surface_tilt : numeric
         Tilt of the PV panels from horizontal. [degree]
 
     pm2_5 : numeric
@@ -83,7 +83,7 @@ def hsu(rainfall, cleaning_threshold, tilt, pm2_5, pm10,
     horiz_mass_rate = (
         pm2_5 * depo_veloc['2_5'] + np.maximum(pm10 - pm2_5, 0.)
         * depo_veloc['10']) * dt_sec
-    tilted_mass_rate = horiz_mass_rate * cosd(tilt)  # assuming no rain
+    tilted_mass_rate = horiz_mass_rate * cosd(surface_tilt)  # assuming no rain
 
     # tms -> tilt_mass_rate
     tms_cumsum = np.cumsum(tilted_mass_rate * np.ones(rainfall.shape))


Test patch:
diff --git a/pvlib/tests/test_soiling.py b/pvlib/tests/test_soiling.py
--- a/pvlib/tests/test_soiling.py
+++ b/pvlib/tests/test_soiling.py
@@ -92,7 +92,7 @@ def test_hsu_no_cleaning(rainfall_input, expected_output):
     tilt = 0.
     expected_no_cleaning = expected_output
 
-    result = hsu(rainfall=rainfall, cleaning_threshold=10., tilt=tilt,
+    result = hsu(rainfall=rainfall, cleaning_threshold=10., surface_tilt=tilt,
                  pm2_5=pm2_5, pm10=pm10, depo_veloc=depo_veloc,
                  rain_accum_period=pd.Timedelta('1h'))
     assert_series_equal(result, expected_no_cleaning)
@@ -108,7 +108,7 @@ def test_hsu(rainfall_input, expected_output_2):
     tilt = 0.
 
     # three cleaning events at 4:00-6:00, 8:00-11:00, and 17:00-20:00
-    result = hsu(rainfall=rainfall, cleaning_threshold=0.5, tilt=tilt,
+    result = hsu(rainfall=rainfall, cleaning_threshold=0.5, surface_tilt=tilt,
                  pm2_5=pm2_5, pm10=pm10, depo_veloc=depo_veloc,
                  rain_accum_period=pd.Timedelta('3h'))
 
@@ -120,8 +120,8 @@ def test_hsu_defaults(rainfall_input, expected_output_1):
     Test Soiling HSU function with default deposition velocity and default rain
     accumulation period.
     """
-    result = hsu(rainfall=rainfall_input, cleaning_threshold=0.5, tilt=0.0,
-                 pm2_5=1.0e-2, pm10=2.0e-2)
+    result = hsu(rainfall=rainfall_input, cleaning_threshold=0.5,
+                 surface_tilt=0.0, pm2_5=1.0e-2, pm10=2.0e-2)
     assert np.allclose(result.values, expected_output_1)
 
 
@@ -138,7 +138,7 @@ def test_hsu_variable_time_intervals(rainfall_input, expected_output_3):
     rain['new_time'] = rain.index + rain['mins_added']
     rain_var_times = rain.set_index('new_time').iloc[:, 0]
     result = hsu(
-        rainfall=rain_var_times, cleaning_threshold=0.5, tilt=50.0,
+        rainfall=rain_var_times, cleaning_threshold=0.5, surface_tilt=50.0,
         pm2_5=1, pm10=2, depo_veloc=depo_veloc,
         rain_accum_period=pd.Timedelta('2h'))
     assert np.allclose(result, expected_output_3)