You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I think we should reorder a handful of function arguments to put the most variable-like arguments first and most parameter-like arguments last. I'm guessing that a lot people will think that I'm just screwing with the API for no reason, but I do have a few reasons!
consistency is important (and underrated)
we can make better use of default arguments.
Here are the functions that I know about so far:
ashraeiam(b, aoi) --->ashraeiam(aoi, b=0.05)
# updated to reflect Cliff's comment belowphysicaliam(K, L, n, aoi) --->physicaliam(aoi, n=1.526, K=4., L=0.002)
# see #200singlediode(module, photocurrent, saturation_current, resistance_series, resistance_shunt, nNsVth) --->singlediode(photocurrent, saturation_current, resistance_series, resistance_shunt, nNsVth)
# I just noticed that the matlab sapm api is very different. # see #198sapm(module, poa_direct, poa_diffuse, temp_cell, airmass_absolute, aoi) --->sapm(poa_direct, poa_diffuse, temp_cell, airmass_absolute, aoi, module)
snlinverter(inverter, v_dc, p_dc) --->snlinverter(v_dc, p_dc, inverter)
The text was updated successfully, but these errors were encountered:
While this is a pain, messing with the api, I do think it makes sense, and
is worthwhile going forward.
On Thu, Jun 23, 2016 at 10:04 AM, Will Holmgren [email protected]
wrote:
I think we should reorder a handful of function arguments to put the most
variable-like arguments first and most parameter-like arguments last. I'm
guessing that a lot people will think that I'm just screwing with the API
for no reason, but I do have a few reasons!
consistency is important (and underrated)
we can make better use of default arguments.
Here are the functions that I know about so far:
ashraeiam(b, aoi) --> ashraeiam(aoi, b=0.05)
physicaliam(K, L, n, aoi) --> physicaliam(aoi, K=4., L=0.002, n=1.526)
I agree, this effort makes sense in general. A few specific tweaks:
For physicaliam, I'd order as aoi, n, K, L. K and L can be safely set to the defaults as the function's values are almost entirely determined by n.
See my comment on #198 for the sapm.
Uh oh!
There was an error while loading. Please reload this page.
I think we should reorder a handful of function arguments to put the most variable-like arguments first and most parameter-like arguments last. I'm guessing that a lot people will think that I'm just screwing with the API for no reason, but I do have a few reasons!
Here are the functions that I know about so far:
The text was updated successfully, but these errors were encountered: