pylops icon indicating copy to clipboard operation
pylops copied to clipboard

Alter LinearOperator so as to become independent of scipy

Open cako opened this issue 3 years ago • 3 comments

Motivation

When PyLops was idealized, it relied heavily on the widely available SciPy implementation of a LinearOperator. This was great in the beginning as it allowed for rapid development and integration into the NumPy/SciPy ecosystem. As PyLops grew, it has implemented a richer environment for LinearOperators. At the same time, we are now finding that, since LinearOperator's internals are subject to change from SciPy, it may be advantageous to offer an implementation fully independent from SciPy.

Definition of solved

  • Implement all functionality that SciPy's LinearOperator already offers directly into PyLops' LinearOperator.
  • Remove any unecessary usage of scipy.sparse.linalg.LinearOperator
  • Ensure that all tests pass ideally without any modification

cako avatar Feb 13 '22 19:02 cako

I think it's related, but import pylops gives me the error : ImportError: cannot import name '_ProductLinearOperator' from 'scipy.sparse.linalg.interface' (/home/nicolas/.local/lib/python3.8/site-packages/scipy/sparse/linalg/interface.py) with scipy 1.8.0 Downgrading to scipy1.7.3 solved it.

NicolasMICAUX avatar Feb 14 '22 16:02 NicolasMICAUX

Hi @NicolasMICAUX thank you very much for reporting this. Indeed this issue was raised exactly because of this change in SciPy. @mrava87 has issued a fix, so we will be releasing a new version with the fix very soon. For now, the solution is to downgrade as you mentioned.

@mrava87: Branch v1.17.x has all commits since dev split from master (they are all non-breaking) so I think the best thing is to release v1.17.1 from the tip of v1.17.x whenever you have a chance.

cako avatar Feb 14 '22 17:02 cako

One more option for now, if you really want to have all features beyond 1.17.0 is:

pip install git+https://[email protected]/PyLops/pylops.git@dev

and that would work with scipy 1.8.0. Or you can wait a couple of days, I am going to make the new release no later than next weekend :)

mrava87 avatar Feb 14 '22 17:02 mrava87

Closed by #482

cako avatar Feb 19 '23 00:02 cako