Skip to content

Adding previous generations' damage relation data (+ data changelog discussion) #572

@phrasmotica

Description

@phrasmotica

Hey all. Was wondering if there would be some interest in supporting data that has changed over time, e.g. between generations. For example, Poison was supereffective on Bug in Generation I but did normal damage thereafter, so we should be able to see that reflected in the Type model.

I have some prospective changes for this in a branch: master...phrasmotica:feature/past-type-efficacy

These changes create a new field past_damage_relations in the Type model. The field is a list of objects containing damage relations data alongside the generation in which the damage relations data was last valid for the given Type. While this works, I think it might be best to have such a new field instead be a generation-by-generation changelog of the type's damage relations, which would include the damage relations for the current generation if applicable. Furthermore the past_ prefix hints at some attachment to the current generation, so the field's name could be changed to something like damage_relations_changelog instead.

Assuming the damage relations data was kept current in its CSV file, this would result in the existing damage_relations field containing the same data as the last element in the damage_relations_changelog field. At which point might it be sensible to store all damage relations data in a single CSV file, where all entries contain the ID of the generation in which they were first used (not last used, since we do not know the last generation that the current data will be used in). Then the damage_relations field could be deprecated, although I think it would be nice to keep it for easy access to the current data.

I think this pattern could be applied to any data that changed over the course of version groups/generations/etc. I made a PR recently (#457) that involved creating a past_types field in the Pokemon model for a similar purpose, which could benefit from this new pattern also. Would love to hear people's thoughts on the idea 😃

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