ModelicaRes icon indicating copy to clipboard operation
ModelicaRes copied to clipboard

Compatiblity issue with matplotlib version >=3.1.0

Open zhanglexander opened this issue 5 years ago • 6 comments

There are multiple imports of matplolib.cbook.iterable (1, 2), however, this object is deprecated with maplotlib from version v3.1.0 (source). This has already causing import errors.

An eassiest fix would be specifying matplotlib's version <3.1.0 in setup.py. In my case v3.0.0 worked.

zhanglexander avatar Aug 21 '20 10:08 zhanglexander

I have the exact same problem with my conda installation. I tried your solution. But noticed that ModelicaRes is still using a newer version of matplotlib. I ran conda list and saw that matplotlib-base version 3.3.1 is installed. I removed it and re-ran the setup.py of ModelicaRes. Now I am getting ImportError: cannot import name 'rcParams' from 'matplotlib' (unknown location) Is there any other solution?

Edit: It now seems to work. I installed the oldest version 3.1.2 of matplotlib-base.

Enoch23 avatar Sep 10 '20 12:09 Enoch23

The downgrade to matplotlib 3.1.2 worked for me as well.

Is ModelicaRes still maintained? I feel like this is something that should be fixed sooner or later, otherwise people will not be able to use the package any more..

cabu3 avatar Nov 27 '20 12:11 cabu3

It looks like that this is just used to check whether an object is iterable. In this case, some alternative seems to be available as in this stackoverflow question.

For example, the following could be used:

from collections.abc import Iterable

if isinstance(e, Iterable):
    # e is iterable

It looks not so difficult to implement...but is ModelicaRes still maintained?

Sonyoyo avatar Jan 05 '21 13:01 Sonyoyo

Unfortunately it doesn't look like.. The latest commit was made 5 years ago.

After a little googling I found BuildingsPy (https://github.com/lbl-srg/BuildingsPy), which can be used (among other things) to read result files from Dymola and OpenModelica. Also, it seems to be maintained. For me it has been working so far.

cabu3 avatar Jan 06 '21 14:01 cabu3

There are multiple imports of matplolib.cbook.iterable (1, 2), however, this object is deprecated with maplotlib from version v3.1.0 (source). This has already causing import errors.

An eassiest fix would be specifying matplotlib's version <3.1.0 in setup.py. In my case v3.0.0 worked.

use from numpy import Iterable

modify 3 py files: simres, linres, util

lukasz83krk avatar Mar 18 '22 07:03 lukasz83krk

In my forked version I have implemented the above fix, you can then install it through pip with 'pip install git+https://github.com/sede-fa/ModelicaRes.git' There were a few other issues I came across and fixed, since I forked the latest commit which had some different code to the release.

sede-fa avatar Dec 19 '22 14:12 sede-fa