question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Inconsistencies in iotools

See original GitHub issue

There exists a number of inconsistencies between the functions in pvlib.iotools that I would like to address.

First, the naming of start/stop date differs between functions for unknown reasons. E.g., get_ecmw_macc uses startdate/stopdate, read_midc_raw_data_from_nrel uses start/end and #1175 currently uses start_date/end_date. It would be great with a common consensus of which of the three to use. I’d be willing to change the functions to comply with the decision (of course with deprecation warnings to start with)

Another inconsistency is that meta data is called different things by different functions. Here’s a list:

  • Meta: pvigs, epw (code), tmy (in code)
  • Metadata: epw (in documentation), surfrad, tmy (in documentation) and then there’s psm3 which calls it “headers”.

Again if we can agree on a consensus I’d like to offer to implement the changes.

Lastly, the naming of the two data retrieval functions: read_midc_raw_data_from_nrel and read_srml_month_from_solardat, which ideally should be called get_midc and get_srml to match their read_ counterparts.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

1reaction
kanderso-nrelcommented, Jul 30, 2021

For PVGIS map_variables can we do a typical deprecation cycle using a strategy like this?

def get_pvgis_tmy(..., map_variables=None):
    if map_variables is None:
        warnings.warn(
            'PVGIS variable names will be renamed to pvlib conventions by '
            'default starting in pvlib 0.10.0. Specify map_variables=True to '
            'enable that behavior now, or specify map_variables=False to '
            'hide this warning.', pvlib._deprecation.pvlibDeprecationWarning
        )
        map_variables = False
    ...

And then in pvlib 0.10.0 we change map_variables to default to True instead of None and remove the warning. Thoughts?

1reaction
wholmgrencommented, Jun 9, 2021

I like start, end, and metadata.

While our long and detailed review of #1175 suggests otherwise (sorry), I really have wanted to keep iotools relatively easy to contribute to. Part of that means accepting some inconsistencies, but there’s also no reason we can’t come through and clean up the API from time to time.

We don’t maintain standards for names within actual code other than readability - it’s only the API names that matter. And no need to deprecate positional argument names - just function names and keyword arguments.

Read more comments on GitHub >

github_iconTop Results From Across the Web

iotools: I/O Tools for Streaming
A wrapper around the core iotools functions to easily apply a function over chunks of a large file. Results can be either written...
Read more >
[SOLVED] How To Fix IOTOOLS.EXE Errors - Solvusoft
Typically, IOTOOLS.EXE errors are caused by a corrupt, infected, or missing executable file, and commonly happen at Iomege Toolbox for Zip and Jaz...
Read more >
pvlib.iotools.read_tmy3
In the case of any discrepancies between this documentation and the TMY3 User's Manual 1, the TMY3 User's Manual takes precedence.
Read more >
common/iotools/panicwriter.go - infra/luci/luci-go - Git at Google
package iotools. import (. "errors". "io". ) // ErrPanicWriter is panic'd from the Writer provided to the callback in. // WriteTracker in the...
Read more >
iotools package - chromium.googlesource.com/external/github.com ...
Package iotools contains a collection of I/O-related utility structs and methods. ... If no io errors are encountered, this will return the callback's...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found