superduper icon indicating copy to clipboard operation
superduper copied to clipboard

Remove all __post_init__ from Component/Model subclasses.

Open jieguangzhou opened this issue 1 year ago • 1 comments
trafficstars

When implementing a new class, we use post_init to handle initialization logic. However, we must not call parent class methods.

def __post_init__(self, db, artifacts):
    super().__post_init__(db, artifacts)

This is unnecessary for overriding a new class.

We can remove the initialization of post_init in the ext module and use the init function instead.

Ultimately, we only need to implement three methods:

•	init (optional)
•	predict_one
•	predict

Additionally, we can use init for lazy loading, performing initialization only during actual function calls.

jieguangzhou avatar May 17 '24 09:05 jieguangzhou