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

Refactor code to avoid eager dependencies #248

Closed
bcollazo opened this issue Jan 17, 2023 · 1 comment
Closed

Refactor code to avoid eager dependencies #248

bcollazo opened this issue Jan 17, 2023 · 1 comment

Comments

@bcollazo
Copy link
Owner

Right now it seems tensorflow, numpy, and pandas are only needed for CsvDataAccumulator which seems to be a Machine Learning inclined feature. It would be nice if the catanatron could come with the simulator without having to include heavy dependencies like these (tensorflow, numpy, and pandas). Actually, maybe even without including rich or click.

This issue is to study and think about how could we structure the codebase so that people could use the simulator by just pip install catanatron and something like:

from catanatron import RandomPlayer, Color, play_batch

# Play a simple 4v4 game
players = [
    RandomPlayer(Color.RED),
    RandomPlayer(Color.BLUE),
    RandomPlayer(Color.WHITE),
    RandomPlayer(Color.ORANGE),
]
results = play_batch(100, players)  # simulates 100 games

or so.

Maybe have a catanatron_cli package that uses this core play_batch and includes the click and rich libraries to do its thing? Maybe another catanatron_ai that includes the ML-based features like the CsvDataAccumulator and the AI-based players that depend on tensorflow, numpy, and pandas?

This would help with slow startup time #208 and would make it easier to adopt in M1 machines where tensorflow is a little more involved to install. Open to thoughts.

@bcollazo
Copy link
Owner Author

bcollazo commented Apr 8, 2023

Improved by #252. Still further work could be done.

@bcollazo bcollazo closed this as completed Apr 8, 2023
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