Skip to content

Add NotImplementedError to abstract methods #585

Closed
1 task
alex-hse-repository opened this issue Mar 5, 2022 · 2 comments
Closed
1 task

Add NotImplementedError to abstract methods #585

alex-hse-repository opened this issue Mar 5, 2022 · 2 comments
Labels
enhancement New feature or request

Comments

@alex-hse-repository
Copy link
Collaborator

馃殌 Feature Request

Replace pass to NotImplementedError in all the abstract methods

Motivation

Abstract methods should raise this exception when they require derived classes to override the method

Proposal

Replace pass to NotImplementedError in all the abstract methods

Test cases

No response

Alternatives

No response

Additional context

No response

Checklist

  • I discussed this issue with ETNA Team
@alex-hse-repository alex-hse-repository added the enhancement New feature or request label Mar 5, 2022
@iKintosh
Copy link
Contributor

It is not necessary because we use ABC package.

from etna.models.base import Model

class ModelChild(Model):
    pass

ModelChild()

> Traceback (most recent call last):
>   File "...", line 3524, in run_code
>     exec(code_obj, self.user_global_ns, self.user_ns)
>   File "<ipython-input-4-add2283b5471>", line 1, in <cell line: 1>
>     ModelChild()
> TypeError: Can't instantiate abstract class ModelChild with abstract methods fit, forecast

@alex-hse-repository
Copy link
Collaborator Author

Actually I created the issue after your comment )

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
Status: Done
Development

No branches or pull requests

2 participants