geomeppy icon indicating copy to clipboard operation
geomeppy copied to clipboard

issue #264: fixed MutableSequence import from collections (it now is collections.abc)

Open maynouf opened this issue 1 year ago • 0 comments

I was having the error which is mentioned in issue #264 : ImportError: cannot import name 'MutableSequence' from 'collections'

According to this StackOverflow answer:

You need to import collections.abc

Here the link to doc

Deprecated since version 3.3, will be removed in version 3.10: Moved Collections Abstract Base Classes to the collections.abc module. For backwards compatibility, they continue to be visible in this module through Python 3.9.

Ref. https://docs.python.org/3.9/library/

This PR fixes this particular error. I've tested it locally and it seems to work on my machine, however this is my first contribution to a public repo so I'm not 100 % shure that it's replicable everywhere (it should, because it is the "collections" package that has changed its internal structure).

I've tried running the tests, and some of them fail (one esoreader import, some related with the EnergyPlus version that is hardcoded, etc.). However, when I try to run the tests from the master branch, they fail too at the "collections" import. In order to keep thinks compartimentalized, I'll try to document the issues with the tests as separate issues, and perhaps I'll try fixing them.

I realize that the repo is not being "actively" worked on--so to speak--but so far it has been invaluable for my work so this is my humble attempt to contributing to this great project!

maynouf avatar Nov 16 '23 12:11 maynouf