mindee / tawazi

A DAG Scheduler library written in pure python
https://mindee.github.io/tawazi/
Apache License 2.0
70 stars 5 forks source link

Refactor node #189

Closed bashirmindee closed 8 months ago

bashirmindee commented 8 months ago

Description

Use dataclass for ExecNode in order to facilitate reading the code.

We should avoid validating the type of attributes if the type is boolean. We can be happy by using the Truthy value of the attribute. This should never fail for users

this is why the following code was removed:


        if not isinstance(self.is_sequential, bool):
            raise TypeError(
                f"is_sequential should be of type bool, but {self.is_sequential} provided"
            )

        if not isinstance(self.debug, bool):
            raise TypeError(f"debug must be of type bool, but {self.debug} provided")

        if not isinstance(self.setup, bool):
            raise TypeError(f"setup must be of type bool, but {self.setup} provided")

Fixes # (issue)

Type of change

Checklist: