Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
Error propagating exceptions on-non subclassable types #269
I was using joblib to run 8 optimizations using nlopt in parallel, and got this error:
My understanding is because a bunch of nlopt types are actually all generated using SWIG, and cannot be naturally inherited. Should there be a check before joblib tries creating a nice custom exception that the type can indeed be inherited from?
Interesting, I don't really see a way to work-around this problem cleanly off the top of my head.
I have been working on this code recently and as far as I understand the reason we want to inherit from
Another way to look at it is that in the following snippet, you don't want that the exception you are catching depends on whether
try: Parallel(n_jobs=n_jobs)(delayed(f)(i) for i in range(10)) except ValueError: # do something
Something that could be done in your case is that
try: Parallel(n_jobs=n_jobs)(delayed(f)(i) for i in range(10)) except ValueError, JoblibException: # do something
Better suggestions welcome !