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

External data strategy needs decided! #43

Closed
AoifeHughes opened this issue Jun 20, 2023 · 5 comments
Closed

External data strategy needs decided! #43

AoifeHughes opened this issue Jun 20, 2023 · 5 comments
Assignees
Labels
future work help wanted Extra attention is needed question Further information is requested

Comments

@AoifeHughes
Copy link
Collaborator

We're about to start needing external data sources. E.g., the Pokédex. Do we want to say that everything needs to be run from the root directory. Or do we want to support the library being more portable? If the later then we need to configure how pip install will setup and copy across data files.

@phinate how would you like this done?


Examples of data needed to be usable by the library:

@AoifeHughes AoifeHughes added help wanted Extra attention is needed question Further information is requested future work labels Jun 20, 2023
@hsahovic
Copy link

@AoifeHughes in case you missed it, this data is accessible without any other required work from poke-env, through:

from poke_env.data import GenData

gen_9_dex = GenData.from_gen(9).pokedex

It's lazy loaded and cached for further use. Ditto for moves, natures and type charts. Learnsets are not included yet, but can be added if you need it.

@AoifeHughes
Copy link
Collaborator Author

@hsahovic this was my plan originally, but it doesn't seem to include the learnsets?

@hsahovic
Copy link

No, not yet. The data is included in the static folder though.

You could add it through something like:

def load_learnsets(self) -> Dict[str, Dict[str, Union[int, float]]]:
        with open(os.path.join(self._static_files_root, "learnsets.json")) as f:
            return orjson.loads(f.read())

and adding learnsets in GenData's init - if you want to open a PR to poke-env I would happily merge it.

@AoifeHughes
Copy link
Collaborator Author

Good shout! Yeah I'll do that. Thanks!

@AoifeHughes
Copy link
Collaborator Author

Think this is done with recent PR #44

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
future work help wanted Extra attention is needed question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants