Skip to content

reorder function arguments to put variables first and parameters second #197

@wholmgren

Description

@wholmgren

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!

  1. consistency is important (and underrated)
  2. 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 below
physicaliam(K, L, n, aoi) ---> physicaliam(aoi, n=1.526, K=4., L=0.002)

# see #200
singlediode(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 #198
sapm(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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions