Skip to content

pvlib.solarposition.spa_python has unused and undocumented **kwargs #1430

Closed
@kandersolar

Description

@kandersolar

pvlib.solarposition.spa_python has **kwargs in the signature, but it doesn't mention it in the docstring, and it doesn't do anything with it in the function body.

def spa_python(time, latitude, longitude,
altitude=0, pressure=101325, temperature=12, delta_t=67.0,
atmos_refract=None, how='numpy', numthreads=4, **kwargs):

This is bad because it silently ignores misspelled optional parameters, for example: pvlib.solarposition.spa_python(times, 40, -80, atlitude=100).


We could just deprecate and remove **kwargs like #1053:

if kwargs:
warnings.warn(
'Arbitrary Location kwargs are deprecated and will be '
'removed in v0.9', pvlibDeprecationWarning
)

Or we could keep **kwargs and pass them through to spa.solar_position(), thereby exposing the sst and esd parameters. Though if we want to expose those, I'd prefer just exposing them directly instead of hiding them in **kwargs.

This could be a good "easy first issue" once we decide what the fix should be.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions