MDPOW icon indicating copy to clipboard operation
MDPOW copied to clipboard

Obscure TypeError when supplying unused kwargs to `Gsolv`

Open a-ws-m opened this issue 2 years ago • 1 comments

Additional kwargs get passed to the super() class, which is Journalled. Journalled then passes them on to object, from which it inherits. This results in a slightly obscure error:

TypeError: object.__init__() takes exactly one argument (the instance to initialize)

It may be better to check for any extra keyword arguments in Journalled.__init__(), replacing the super().__init__() call.

a-ws-m avatar Sep 04 '23 15:09 a-ws-m

Yes, make sense.

I think when I wrote this a log time ago I was only slowly learning how to do class inheritance and using super() and friends was still a bit mystifying. There's definitely room for improvement!

Also, I don't think that the "restarting" code is particularly well tested. It seemed like a good idea at the time to make it convenient to restart, but I don't think I was a strong believer in tests then :-(.

orbeckst avatar Sep 11 '23 01:09 orbeckst