Skip to content

Constants as values or Enums #198

@emrysshevek

Description

@emrysshevek

Although not yet merged, PR #192 factors constant values into a separate file, and places some groups of constants into Enum classes. Currently, only ProblemType and MetafeatureGroup are defined as enums, but we could potentially do the same for things like column types (like categorical, numeric, etc) or computing error values (like NO_TARGETS, NUMERIC_TARGETS, etc).

We should discuss whether to keep these values separate or combine them into Enums. As a starter, @epeters3 mentioned in the pull request:

I was torn on this idea. Enums are clean and more strict, but when you want to use the actual string of an Enum, i.e. if you want to use the string value "NUMERIC", you have to say ColumnType.NUMERIC.value, rather than consts.NUMERIC. We could restructure all uses of column_types to reference ColumnType enum members instead of strings, and just say ComputeErrors.NO_TARGETS.value in the case of compute errors.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions