{ "cells": [ { "attachments": {}, "cell_type": "markdown", "metadata": {}, "source": [ "Benches from https://github.com/manny405/sapai#battles" ] }, { "cell_type": "code", "execution_count": 5, "metadata": {}, "outputs": [], "source": [ "from sapai.pets import Pet\n", "from sapai.teams import Team\n", "from sapai.battle import Battle" ] }, { "cell_type": "code", "execution_count": 6, "metadata": {}, "outputs": [], "source": [ "team0 = Team([\"ant\",\"ox\",\"tiger\"])\n", "team1 = Team([\"sheep\",\"tiger\"])" ] }, { "cell_type": "code", "execution_count": 7, "metadata": {}, "outputs": [], "source": [ "def timing_test():\n", " b = Battle(team0,team1)\n", " winner = b.battle()" ] }, { "cell_type": "code", "execution_count": 8, "metadata": {}, "outputs": [ { "name": "stdout", "output_type": "stream", "text": [ "4.29 ms ± 51.8 µs per loop (mean ± std. dev. of 7 runs, 100 loops each)\n" ] } ], "source": [ "%timeit timing_test()" ] } ], "metadata": { "kernelspec": { "display_name": "venv", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.9.11" }, "orig_nbformat": 4, "vscode": { "interpreter": { "hash": "f3ea3260dc28cb374a11ed536a33e78617293d231c865b57a16e1e960612baf9" } } }, "nbformat": 4, "nbformat_minor": 2 }