Skip to content

latest version of pvfactors cannot be installed with pvlib 0.10.0 #1796

@kandersolar

Description

@kandersolar

The last several versions of pvfactors require pvlib<0.10 to preempt possible breaking changes. In fact this turned out to be unnecessary; to the best of my knowledge, there is no actual incompatibility between pvfactors==1.5.2 (the latest) and pvlib==0.10.0.

However, that upper limit does prevent pip from installing pvfactors==1.5.2 and pvlib==0.10.0 simultaneously. What it does instead is go back to pvfactors==1.4.1, the last version that doesn't require pvlib<0.10. The problem is that this version of pvfactors is old enough to not contain a compatibility fix with the latest shapely, resulting in a broken installation that errors when you try to actually use pvfactors. See for example this failed docs build: https://readthedocs.org/projects/pvlib-python/builds/21171307/

Users have two options to work around this problem in the immediate term. Option 1: downgrade shapely to a version that works with pvfactors==1.4.1:

$ pip install pvlib==0.10.0 pvfactors  # installs pvfactors 1.4.1 and shapely 2.x
$ pip install 'shapely<2.0'  # might need to use double quotes in some terminals

Option 2: tell pip to ignore pvfactors when it says it isn't compatible with pvlib 0.10.0. This will allow you to keep using pvfactors 1.5.2:

$ pip install pvfactors==1.5.2  # installs pvlib 0.9.5, and shapely 1.8.5
$ pip install --no-deps pvlib==0.10.0  # installs pvlib 0.10.0 alongside pvfactors 1.5.2

For a more permanent fix, the best solution would be for pvfactors to release a new version that doesn't have this unnecessary pvlib<0.10 requirement. But since that project is no longer maintained, we can't expect that to happen.

In the absence of that, I see two options, both of which require going to 0.10.1:

  • A simple solution would be to add shapely<2.0 to our optional requirements, effectively making Option 1 above automatic. This has the downside of using an older version of pvfactors, which is missing a minor bugfix that a small minority of users might care about.
  • Another option is to use this as motivation to get solarfactors sufficiently up to speed such that we could switch pvlib to depend on it instead of pvfactors. I will look into how much work that would take.

An aside: although I did make a local v0.10.0 tag and ensure that the tests passed before making the official 0.10.0 release, I neglected to install pvlib[optional] in the fresh test environment, so the pvfactors tests were skipped and this problem did not arise. Had I been more thorough, this problem could have been found out before pvlib 0.10.0 was actually released.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions