From 0c8ebe6fb15323e079776c55a04ba8a2a48903a1 Mon Sep 17 00:00:00 2001 From: David Minarsch Date: Mon, 16 Sep 2019 15:26:05 +0100 Subject: [PATCH] Bumps to new aea version 0.1.2 and fixes --- HISTORY.rst | 8 ++++++++ Makefile | 1 + Pipfile | 2 +- Pipfile.lock | 8 ++++---- sandbox/oef_healthcheck.py | 2 +- tac/__version__.py | 2 +- tac/agents/controller/agent.py | 4 ++-- tac/agents/controller/base/handlers.py | 2 +- tac/agents/participant/v1/agent.py | 2 +- tac/agents/participant/v1/base/dialogues.py | 6 +++--- tac/agents/participant/v1/base/game_instance.py | 2 +- tac/agents/participant/v1/base/helpers.py | 2 +- tac/agents/participant/v1/base/states.py | 4 ++-- tac/agents/participant/v1/base/stats_manager.py | 2 +- tac/agents/participant/v2/agent.py | 2 +- templates/v1/advanced.py | 2 +- templates/v1/expert.py | 2 +- tests/common.py | 2 +- tests/test_agent/test_agent_state.py | 2 +- tests/test_agent/test_misc.py | 2 +- tests/test_mail.py | 2 +- 21 files changed, 35 insertions(+), 26 deletions(-) diff --git a/HISTORY.rst b/HISTORY.rst index 74f9c94d..5ac8da18 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -29,3 +29,11 @@ Release History - Updated to OEF SDK version 0.6.7 - Transition to AEA architecture and extraction of AEA framework. - Updated to AEA version 0.1.1 + +0.1.5 (2019-09-16) +------------------- + +- Bump to latest oef image 0.7 +- Bump to latest aea version 0.1.2 +- Static type checking with Mypy +- Test/bug fixes diff --git a/Makefile b/Makefile index 09cdf657..a3db06d5 100644 --- a/Makefile +++ b/Makefile @@ -19,6 +19,7 @@ clean-test: rm -fr htmlcov/ rm -fr .hypothesis rm -fr .pytest_cache + rm -fr .mypy_cache/ find . -name 'log.txt' -exec rm -fr {} + find . -name 'log.*.txt' -exec rm -fr {} + diff --git a/Pipfile b/Pipfile index a2779f55..8d7f8aff 100644 --- a/Pipfile +++ b/Pipfile @@ -36,7 +36,7 @@ sphinxcontrib-apidoc = "*" sphinx = "*" wtforms = "*" visdom = "*" -aea = {index = "test-pypi",version = "==0.1.1"} +aea = {index = "test-pypi",version = "==0.1.2"} colorlog = "*" [requires] diff --git a/Pipfile.lock b/Pipfile.lock index ebb4c4d4..5ff399ed 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "8ac8ed5aeb2da98fefe6d2c21d0179fea7491e46381f879b57fa8aa0161218ec" + "sha256": "d1928f34028d7094fa600b7868589202139043d33473822c945aa253a3841293" }, "pipfile-spec": 6, "requires": { @@ -23,11 +23,11 @@ "default": { "aea": { "hashes": [ - "sha256:5a61ef8df80647b3a5021e48359594b8a3dde20f12359f67f2bb1a07e190c1cd", - "sha256:adb8185b7c948baebc5d277f14a3e764f1c61c6ad9a37e9453ea2af9f023a0a9" + "sha256:127d9cad4e9fa38a0ea830ac56f85721e335df13600f8f41390c33b780bbf561", + "sha256:ef562485c9840f3aa74ba8aac1de304979875383e7104fecbf799b5770076204" ], "index": "test-pypi", - "version": "==0.1.1" + "version": "==0.1.2" }, "alabaster": { "hashes": [ diff --git a/sandbox/oef_healthcheck.py b/sandbox/oef_healthcheck.py index 1c9b80e7..45181043 100644 --- a/sandbox/oef_healthcheck.py +++ b/sandbox/oef_healthcheck.py @@ -25,7 +25,7 @@ import logging from aea.crypto.base import Crypto -from aea.channel.oef import OEFMailBox +from aea.channels.oef import OEFMailBox logger = logging.getLogger(__name__) diff --git a/tac/__version__.py b/tac/__version__.py index ad9b86a6..d8f91688 100644 --- a/tac/__version__.py +++ b/tac/__version__.py @@ -23,7 +23,7 @@ __title__ = 'tac' __description__ = 'Trading Agent Competition agents' __url__ = 'https://github.com/fetchai/agents-tac.git' -__version__ = '0.1.4' +__version__ = '0.1.5' __author__ = 'Fetch.AI Limited' __license__ = 'Apache 2.0' __copyright__ = '2019 Fetch.AI Limited' diff --git a/tac/agents/controller/agent.py b/tac/agents/controller/agent.py index f6d46911..ece60adb 100644 --- a/tac/agents/controller/agent.py +++ b/tac/agents/controller/agent.py @@ -31,7 +31,7 @@ import dateutil.parser from aea.agent import Agent -from aea.channel.oef import OEFMailBox +from aea.channels.oef import OEFMailBox from aea.mail.base import Envelope from tac.agents.controller.base.handlers import OEFHandler, GameHandler, AgentMessageDispatcher @@ -270,7 +270,7 @@ def main( base_good_endowment=base_good_endowment, lower_bound_factor=lower_bound_factor, upper_bound_factor=upper_bound_factor, - start_time=dateutil.parser.parse(start_time), + start_time=dateutil.parser.parse(str(start_time)), registration_timeout=registration_timeout, competition_timeout=competition_timeout, inactivity_timeout=inactivity_timeout, diff --git a/tac/agents/controller/base/handlers.py b/tac/agents/controller/base/handlers.py index 1a21b939..74d7a0a0 100644 --- a/tac/agents/controller/base/handlers.py +++ b/tac/agents/controller/base/handlers.py @@ -388,7 +388,7 @@ def is_game_running(self) -> bool: :return: Return True if there is a game running, False otherwise. """ - return self.current_game is not None + return self._current_game is not None def start_competition(self): """Create a game and send the game setting to every registered agent.""" diff --git a/tac/agents/participant/v1/agent.py b/tac/agents/participant/v1/agent.py index 45b8560d..030a5774 100644 --- a/tac/agents/participant/v1/agent.py +++ b/tac/agents/participant/v1/agent.py @@ -25,7 +25,7 @@ from typing import Optional from aea.agent import Agent -from aea.channel.oef import OEFMailBox +from aea.channels.oef import OEFMailBox from aea.mail.base import Envelope from tac.agents.participant.v1.base.game_instance import GameInstance from tac.agents.participant.v1.base.handlers import ControllerHandler, DialogueHandler, OEFHandler diff --git a/tac/agents/participant/v1/base/dialogues.py b/tac/agents/participant/v1/base/dialogues.py index dc69f1ff..5c5875d6 100644 --- a/tac/agents/participant/v1/base/dialogues.py +++ b/tac/agents/participant/v1/base/dialogues.py @@ -29,9 +29,9 @@ import logging from typing import Any, Dict, List, Optional -from aea.dialogue.base import DialogueLabel -from aea.dialogue.base import Dialogue as BaseDialogue -from aea.dialogue.base import Dialogues as BaseDialogues +from aea.helpers.dialogue.base import DialogueLabel +from aea.helpers.dialogue.base import Dialogue as BaseDialogue +from aea.helpers.dialogue.base import Dialogues as BaseDialogues from aea.mail.base import Address from aea.protocols.base.message import Message from aea.protocols.fipa.message import FIPAMessage diff --git a/tac/agents/participant/v1/base/game_instance.py b/tac/agents/participant/v1/base/game_instance.py index 142cb897..c53a3384 100644 --- a/tac/agents/participant/v1/base/game_instance.py +++ b/tac/agents/participant/v1/base/game_instance.py @@ -24,7 +24,7 @@ import random from typing import Any, List, Optional, Set, Tuple, Dict, Union, Sequence, cast -from aea.channel.oef import MailStats +from aea.channels.oef import MailStats from aea.mail.base import Address from aea.protocols.oef.models import Description, Query from aea.protocols.tac.message import TACMessage diff --git a/tac/agents/participant/v1/base/helpers.py b/tac/agents/participant/v1/base/helpers.py index 636dcfb6..33aa1627 100644 --- a/tac/agents/participant/v1/base/helpers.py +++ b/tac/agents/participant/v1/base/helpers.py @@ -22,7 +22,7 @@ import logging from typing import Dict, List, Set, Sequence -from aea.dialogue.base import DialogueLabel +from aea.helpers.dialogue.base import DialogueLabel from aea.mail.base import Address from aea.protocols.oef.models import DataModel, Attribute, Description, Query, Constraint, Or from tac.platform.game.base import TransactionId diff --git a/tac/agents/participant/v1/base/states.py b/tac/agents/participant/v1/base/states.py index 7bd9a911..22642818 100644 --- a/tac/agents/participant/v1/base/states.py +++ b/tac/agents/participant/v1/base/states.py @@ -30,9 +30,9 @@ import pprint from typing import Dict, List +from aea.helpers.state.base import AgentState as BaseAgentState +from aea.helpers.state.base import WorldState as BaseWorldState from aea.mail.base import Address -from aea.state.base import AgentState as BaseAgentState -from aea.state.base import WorldState as BaseWorldState from tac.agents.participant.v1.base.price_model import GoodPriceModel from tac.platform.game.helpers import logarithmic_utility from tac.platform.game.base import Transaction diff --git a/tac/agents/participant/v1/base/stats_manager.py b/tac/agents/participant/v1/base/stats_manager.py index b4991c82..4d11be2d 100644 --- a/tac/agents/participant/v1/base/stats_manager.py +++ b/tac/agents/participant/v1/base/stats_manager.py @@ -27,7 +27,7 @@ import numpy as np -from aea.channel.oef import MailStats +from aea.channels.oef import MailStats class EndState(Enum): diff --git a/tac/agents/participant/v2/agent.py b/tac/agents/participant/v2/agent.py index ff741b19..58016d4e 100644 --- a/tac/agents/participant/v2/agent.py +++ b/tac/agents/participant/v2/agent.py @@ -25,7 +25,7 @@ from typing import Optional from aea.agent import Agent -from aea.channel.oef import OEFMailBox +from aea.channels.oef import OEFMailBox from aea.mail.base import Envelope from tac.gui.dashboards.agent import AgentDashboard diff --git a/templates/v1/advanced.py b/templates/v1/advanced.py index 27503194..1ac8b195 100644 --- a/templates/v1/advanced.py +++ b/templates/v1/advanced.py @@ -25,8 +25,8 @@ import logging from typing import List, Optional, Set +from aea.helpers.state.base import WorldState from aea.protocols.oef.models import Description -from aea.state.base import WorldState from tac.agents.participant.v1.base.strategy import RegisterAs, SearchFor, Strategy from tac.agents.participant.v1.examples.baseline import BaselineAgent from tac.gui.dashboards.agent import AgentDashboard diff --git a/templates/v1/expert.py b/templates/v1/expert.py index 78658a0d..af466cf6 100644 --- a/templates/v1/expert.py +++ b/templates/v1/expert.py @@ -26,7 +26,7 @@ from typing import Optional from aea.agent import Agent -from aea.mail.oef import OEFMailBox +from aea.channels.oef import OEFMailBox logger = logging.getLogger(__name__) diff --git a/tests/common.py b/tests/common.py index f49c3ba0..1518c9dd 100644 --- a/tests/common.py +++ b/tests/common.py @@ -19,7 +19,7 @@ """This module contains an OEF agent for testing.""" -from aea.channel.oef import OEFMailBox +from aea.channels.oef import OEFMailBox class TOEFAgent(OEFMailBox): diff --git a/tests/test_agent/test_agent_state.py b/tests/test_agent/test_agent_state.py index 000247cf..ed329e69 100644 --- a/tests/test_agent/test_agent_state.py +++ b/tests/test_agent/test_agent_state.py @@ -24,7 +24,7 @@ from threading import Thread from aea.agent import Agent, AgentState -from aea.channel.oef import OEFMailBox +from aea.channels.oef import OEFMailBox class TAgent(Agent): diff --git a/tests/test_agent/test_misc.py b/tests/test_agent/test_misc.py index 94bd2f1d..9f5f0371 100644 --- a/tests/test_agent/test_misc.py +++ b/tests/test_agent/test_misc.py @@ -23,7 +23,7 @@ from unittest.mock import MagicMock from aea.agent import Agent -from aea.channel.oef import OEFMailBox +from aea.channels.oef import OEFMailBox class TAgent(Agent): diff --git a/tests/test_mail.py b/tests/test_mail.py index d54721d8..49379035 100644 --- a/tests/test_mail.py +++ b/tests/test_mail.py @@ -20,7 +20,7 @@ """This module contains tests for the mail module.""" import time -from aea.channel.oef import OEFMailBox +from aea.channels.oef import OEFMailBox from aea.crypto.base import Crypto from aea.mail.base import Envelope from aea.protocols.default.message import DefaultMessage