Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adjustable attributes for get_psm3 #1079

Closed
toddkarin opened this issue Oct 7, 2020 · 4 comments · Fixed by #1086
Closed

Adjustable attributes for get_psm3 #1079

toddkarin opened this issue Oct 7, 2020 · 4 comments · Fixed by #1086

Comments

@toddkarin
Copy link

iotools has a fixed ATTRIBUTES variable. I would like to be able to change this in get_psm3. Is there a reason we can't make attributes an input to the function get_psm3?

@kandersolar
Copy link
Member

I've wanted the same thing. Note that you can change the ATTRIBUTES list before making the API call, so the functionality does exist, it's just a little awkward to use:

pvlib.iotools.psm3.ATTRIBUTES = [
    'ghi', 'dni', 'dhi', 'air_temperature', 'wind_speed', 'surface_albedo',
    'clearsky_dhi', 'clearsky_dni', 'clearsky_ghi', 'cloud_type'
]
meta, df = pvlib.iotools.get_psm3(40, -80, api_key, email, '2019', 30, True)

If anyone does open a PR for this, they could also edit the docstring to include 2019 and t*y-2019 in the list of acceptable years because those are available now.

@cwhanse
Copy link
Member

cwhanse commented Oct 7, 2020

Probably a good idea to add attributes as a kwarg, based on what I saw on the NSRDB webinar yesterday there are a number of new columns of data either available or soon to be added.

@kandersolar
Copy link
Member

Taking a look at this as part of a general update to the PSM3 wrapper. I'm waffling on where a new attributes kwarg should be added in the signature. An optional parameter at the end, to maintain backwards compatibility? A new required parameter near the beginning? Input is welcome. Current signature for reference:

def get_psm3(latitude, longitude, api_key, email, names='tmy', interval=60,
             leap_day=False, full_name=PVLIB_PYTHON, affiliation=PVLIB_PYTHON,
             timeout=30):

@wholmgren
Copy link
Member

wholmgren commented Nov 2, 2020

I suggest attributes=ATTRIBUTES anywhere before timeout. I don't have any concerns about maintaining kwarg order for backward compatibility. I'm willing to consider a required argument if others think it's a good idea.

@kandersolar kandersolar mentioned this issue Nov 5, 2020
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants