pvlib-python icon indicating copy to clipboard operation
pvlib-python copied to clipboard

`pvlib.irradiance.poa_horizontal_ratio` should be removed

Open mikofski opened this issue 1 year ago • 4 comments

Describe the bug Currently pvlib.irradiance.poa_horizontal_ratio is untested according to codecov

To Reproduce Steps to reproduce the behavior:

  1. Go to https://app.codecov.io/gh/pvlib/pvlib-python/blob/main/pvlib/irradiance.py#L259

Expected behavior 100% test coverage

Screenshots image

Versions:

  • pvlib.__version__: 0.9.5-dirty
  • pandas.__version__: ?
  • python: ?

Additional context This causes codecov to fail for any edits to irradiance.py that reduce the number of lines because then code coverage goes down.

mikofski avatar Mar 13 '23 22:03 mikofski

Apparently I added this function 9 years ago during a large refactor, perhaps in an aborted effort at DRY code, but never used it. Tests were hardly a thing at that time. In any case, I suggest we delete it.

wholmgren avatar Mar 13 '23 22:03 wholmgren

@wholmgren Function pvlib.irradiance.poa_horizontal_ratio is being used in example irradiance.ipynb also what is the following checking for?

try:
    ratio.name = 'poa_ratio'
except AttributeError:
    pass

name attribute of a float?same try-except is for many other functions in irradiance module

Lakshyadevelops avatar Mar 19 '23 19:03 Lakshyadevelops

Function pvlib.irradiance.poa_horizontal_ratio is being used in example irradiance.ipynb

Those notebooks are not maintained and likely will be deleted in the future.

also what is the following checking for?

If the inputs are series, then ratio is also a Series and this line will assign a name to it. It's not a great pattern.

wholmgren avatar Mar 20 '23 18:03 wholmgren

Hi, I would like to tackle this issue. It seems like there is more to it aside from just deleting the poa_horizontal_ratio function. If I delete that function, then do I do anything with the docs/tutorials/irradiance.ipynb notebook that uses the function?

Please recommend other requirements for this issue if applicable.

Thanks.

matsuobasho avatar Nov 10 '23 23:11 matsuobasho