Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ConstantSetのJudgeMethodをシンプルな構造で格納する #160

Open
kyuridenamida opened this issue Oct 6, 2019 · 0 comments
Open

Comments

@kyuridenamida
Copy link
Owner

kyuridenamida commented Oct 6, 2019

現在、ConstantSetに格納するときにジャッジ方式を複雑な方法、つまり抽象クラスをinheritしたDecimalJudge, NormalJudge を直接格納しています。

class Judge(metaclass=ABCMeta):
    @abstractmethod
    def verify(self, output, expected):
        pass

    @abstractmethod
    def to_dict(self):
        pass


class NormalJudge(Judge):
    ...

class DecimalJudge(Judge):
    ...

これは誤差値をテンプレート内で扱うときに手間になるので、ConstantSetの段階で格納するのはシンプルなものにしたほうが良い。

tester.pyで扱うときには今の抽象化のほうが良いと思っているので、単純に定数値を格納するだけの責務を持ったクラスを作る

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant