DrrDom / crem

CReM: chemically reasonable mutations framework
BSD 3-Clause "New" or "Revised" License
198 stars 38 forks source link

[bug] package is incompatible with python 3.11+ #19

Closed aebrer closed 1 year ago

aebrer commented 1 year ago

per the python 3.11 documentation:

The population parameter of random.sample() must be a sequence, and automatic conversion of sets to lists is no longer supported. Also, if the sample size is larger than the population size, a ValueError is raised. (Contributed by Raymond Hettinger in bpo-40465.)

This causes crem to crash when running, as it attempts to use random.sample on a dict.keys object, which apparently is now a non-sequence type (and no longer gets automatically converted).

This is fixed by first converting to a list (or other sequence datatype) prior to calling random.sample.

aebrer commented 1 year ago

created a PR (#20) that I think should fix it, hopefully that helps at least to explain what I meant! :)

Thanks!

(btw I LOVE crem, this is an amazing package!)