3

Naming The name of __genereate_initial_guess() starts with a double underscore. Since it is not a method, it will not get mangled with a class name anyway. I'd suggest to remove the underscores. Then the name of your function does not convey in any way what it's doing. It is not generating a guess in any way. It's extracting parameters and limits. ...


2

Functions should not modify their inputs silently or needlessly. If someone calls a function with arguments, they do not not expect the function to modify the arguments unless it was advertised as such. By applying del to the input data, you are destroying the input rather than merely extracting information from it. Your current data structure seems ...


1

Although you are using a map for the keys, you're still iterating over all the values in the excludes list -- so the map isn't doing as much work for you as it could be. If, instead, you use composite keys so the key and value are combined into a key in the map, then you can use the efficient map lookup instead of iterating over excludes. You do still have ...


Only top voted, non community-wiki answers of a minimum length are eligible