|
21 | 21 | from pvlib import (atmosphere, iam, inverter, irradiance,
|
22 | 22 | singlediode as _singlediode, spectrum, temperature)
|
23 | 23 | from pvlib.tools import _build_kwargs, _build_args
|
| 24 | +import pvlib.tools as tools |
24 | 25 |
|
25 | 26 |
|
26 | 27 | # a dict of required parameter names for each DC power model
|
@@ -1540,7 +1541,7 @@ def calcparams_desoto(effective_irradiance, temp_cell,
|
1540 | 1541 | saturation_current : numeric
|
1541 | 1542 | Diode saturation curent in amperes
|
1542 | 1543 |
|
1543 |
| - resistance_series : float |
| 1544 | + resistance_series : numeric |
1544 | 1545 | Series resistance in ohms
|
1545 | 1546 |
|
1546 | 1547 | resistance_shunt : numeric
|
@@ -1663,9 +1664,21 @@ def calcparams_desoto(effective_irradiance, temp_cell,
|
1663 | 1664 | # use errstate to silence divide by warning
|
1664 | 1665 | with np.errstate(divide='ignore'):
|
1665 | 1666 | Rsh = R_sh_ref * (irrad_ref / effective_irradiance)
|
| 1667 | + |
1666 | 1668 | Rs = R_s
|
1667 | 1669 |
|
1668 |
| - return IL, I0, Rs, Rsh, nNsVth |
| 1670 | + numeric_args = (effective_irradiance, temp_cell) |
| 1671 | + out = (IL, I0, Rs, Rsh, nNsVth) |
| 1672 | + |
| 1673 | + if all(map(np.isscalar, numeric_args)): |
| 1674 | + return out |
| 1675 | + |
| 1676 | + index = tools.get_pandas_index(*numeric_args) |
| 1677 | + |
| 1678 | + if index is None: |
| 1679 | + return np.broadcast_arrays(*out) |
| 1680 | + |
| 1681 | + return tuple(pd.Series(a, index=index).rename(None) for a in out) |
1669 | 1682 |
|
1670 | 1683 |
|
1671 | 1684 | def calcparams_cec(effective_irradiance, temp_cell,
|
@@ -1744,7 +1757,7 @@ def calcparams_cec(effective_irradiance, temp_cell,
|
1744 | 1757 | saturation_current : numeric
|
1745 | 1758 | Diode saturation curent in amperes
|
1746 | 1759 |
|
1747 |
| - resistance_series : float |
| 1760 | + resistance_series : numeric |
1748 | 1761 | Series resistance in ohms
|
1749 | 1762 |
|
1750 | 1763 | resistance_shunt : numeric
|
@@ -1861,7 +1874,7 @@ def calcparams_pvsyst(effective_irradiance, temp_cell,
|
1861 | 1874 | saturation_current : numeric
|
1862 | 1875 | Diode saturation current in amperes
|
1863 | 1876 |
|
1864 |
| - resistance_series : float |
| 1877 | + resistance_series : numeric |
1865 | 1878 | Series resistance in ohms
|
1866 | 1879 |
|
1867 | 1880 | resistance_shunt : numeric
|
@@ -1920,7 +1933,18 @@ def calcparams_pvsyst(effective_irradiance, temp_cell,
|
1920 | 1933 |
|
1921 | 1934 | Rs = R_s
|
1922 | 1935 |
|
1923 |
| - return IL, I0, Rs, Rsh, nNsVth |
| 1936 | + numeric_args = (effective_irradiance, temp_cell) |
| 1937 | + out = (IL, I0, Rs, Rsh, nNsVth) |
| 1938 | + |
| 1939 | + if all(map(np.isscalar, numeric_args)): |
| 1940 | + return out |
| 1941 | + |
| 1942 | + index = tools.get_pandas_index(*numeric_args) |
| 1943 | + |
| 1944 | + if index is None: |
| 1945 | + return np.broadcast_arrays(*out) |
| 1946 | + |
| 1947 | + return tuple(pd.Series(a, index=index).rename(None) for a in out) |
1924 | 1948 |
|
1925 | 1949 |
|
1926 | 1950 | def retrieve_sam(name=None, path=None):
|
|
0 commit comments