-
Notifications
You must be signed in to change notification settings - Fork 63
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1723 from fetchai/develop
Release v0.6.0
- Loading branch information
Showing
624 changed files
with
21,946 additions
and
20,033 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,68 +1,34 @@ | ||
[MASTER] | ||
ignore-patterns=serialization.py,message.py,__main__.py,.*_pb2.py,launch.py,transaction.py | ||
ignore-patterns=serialization.py,message.py,__main__.py,.*_pb2.py | ||
|
||
[MESSAGES CONTROL] | ||
disable=C0103,C0201,C0330,C0301,C0302,W1202,W1203,W0511,W0107,W0105,W0621,W0235,W0613,W0221,R0902,R0913,R0914,R1720,R1705,R0801,R0904,R0903,R0911,R0912,R0901,R1704,R0916,R1702,R0915,R1710,R1703,R0401 | ||
disable=C0103,C0201,C0301,C0302,C0330,W0105,W0107,W1202,W1203,R0902,R0913,R0914,R0801,R0904,R0903,R0911,R0912,R0901,R0916,R1702,R0915 | ||
|
||
ENABLED: | ||
# W0703: broad-except | ||
# W0212: protected-access | ||
# W0706: try-except-raise | ||
# W0108: unnecessary-lambda | ||
# W0622: redefined-builtin | ||
# W0163: unused-argument | ||
# W0201: attribute-defined-outside-init | ||
# W0222: signature-differs | ||
# W0223: abstract-method | ||
# W0611: unused-import | ||
# W0612: unused-variable | ||
# W1505: deprecated-method | ||
# W0106: expression-not-assigned | ||
# R0201: no-self-use | ||
# R0205: useless-object-inheritance | ||
# R1723: no-else-break | ||
# R1721: unnecessary-comprehension | ||
# R1718: consider-using-set-comprehension | ||
# R1716: chained-comparison | ||
# R1714: consider-using-in | ||
# R0123: literal-comparison | ||
# R1711: useless-return | ||
# R1722: consider-using-sys-exit | ||
|
||
## Resolve these: | ||
# R0401: cyclic-import | ||
# W0221: arguments-differ | ||
## Eventually resolve these: | ||
# R0902: too-many-instance-attributes | ||
# R0913: too-many-arguments | ||
# R0914: too-many-locals | ||
# R1720: no-else-raise | ||
# R1705: no-else-return | ||
# R0904: too-many-public-methods | ||
# R0903: too-few-public-methods | ||
# R0911: too-many-return-statements | ||
# R0912: too-many-branches | ||
# R0901: too-many-ancestors | ||
# R1704: redefined-argument-from-local | ||
# R0916: too-many-boolean-expressions | ||
# R1702: too-many-nested-blocks | ||
# R0915: too-many-statements | ||
# R1710: inconsistent-return-statements | ||
# R1703: simplifiable-if-statement | ||
# decide on a logging policy: | ||
# W1202: logging-format-interpolation | ||
# W1203: logging-fstring-interpolation | ||
|
||
## Keep the following: | ||
# C0103: invalid-name | ||
# C0201: consider-iterating-dictionary | ||
# C0330: Wrong haning indentation | ||
# http://pylint-messages.wikidot.com/messages:c0301 > Line too long (%s/%s) | ||
# http://pylint-messages.wikidot.com/messages:c0302 > Too many lines in module (%s) | ||
# W1202: logging-format-interpolation | ||
# W1203: logging-fstring-interpolation | ||
# W0511: fixme | ||
# W0107: unnecessary-pass | ||
# W0105: pointless-string-statement | ||
# W0621: redefined-outer-name | ||
# W0235: useless-super-delegation | ||
# R0801: similar lines | ||
# C0301: http://pylint-messages.wikidot.com/messages:c0301 > Line too long (%s/%s) | ||
# C0302: http://pylint-messages.wikidot.com/messages:c0302 > Too many lines in module (%s) | ||
# C0330: Wrong hanging indentation | ||
# W0105: pointless-string-statement, # kept as no harm | ||
# W0107: unnecessary-pass, # kept as no harm | ||
# R0801: similar lines, # too granular | ||
|
||
[IMPORTS] | ||
ignored-modules=aiohttp,defusedxml,gym,fetch,matplotlib,memory_profiler,numpy,oef,openapi_core,psutil,tensorflow,temper,skimage,vyper,web3 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,3 +12,4 @@ This is the official list of Fetch.AI authors for copyright purposes. | |
* Yuri Turchenkov <[email protected]> [solarw](https://github.com/solarw) | ||
* Lokman Rahmani <[email protected]> [lrahmani](https://github.com/lrahmani) | ||
* Jiří Vestfál <[email protected]> [MissingNO57](https://github.com/MissingNO57) | ||
* Ed Fitzgerald <[email protected]> [ejfitzgerald](https://github.com/ejfitzgerald) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,125 @@ | ||
# -*- coding: utf-8 -*- | ||
# ------------------------------------------------------------------------------ | ||
# | ||
# Copyright 2018-2019 Fetch.AI Limited | ||
# | ||
# Licensed under the Apache License, Version 2.0 (the "License"); | ||
# you may not use this file except in compliance with the License. | ||
# You may obtain a copy of the License at | ||
# | ||
# http://www.apache.org/licenses/LICENSE-2.0 | ||
# | ||
# Unless required by applicable law or agreed to in writing, software | ||
# distributed under the License is distributed on an "AS IS" BASIS, | ||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
# See the License for the specific language governing permissions and | ||
# limitations under the License. | ||
# | ||
# ------------------------------------------------------------------------------ | ||
"""This module contains the interface definition of the abstract agent.""" | ||
import datetime | ||
from abc import ABC, abstractmethod, abstractproperty | ||
from typing import Any, Callable, Dict, List, Optional, Tuple | ||
|
||
from aea.connections.base import Connection | ||
from aea.mail.base import Envelope | ||
|
||
|
||
class AbstractAgent(ABC): | ||
"""This class provides an abstract base interface for an agent.""" | ||
|
||
@abstractproperty | ||
def name(self) -> str: | ||
"""Get agent's name.""" | ||
|
||
@abstractmethod | ||
def start(self) -> None: | ||
""" | ||
Start the agent. | ||
:return: None | ||
""" | ||
|
||
@abstractmethod | ||
def stop(self) -> None: | ||
""" | ||
Stop the agent. | ||
:return: None | ||
""" | ||
|
||
@abstractmethod | ||
def setup(self) -> None: | ||
""" | ||
Set up the agent. | ||
:return: None | ||
""" | ||
|
||
@abstractmethod | ||
def act(self) -> None: | ||
""" | ||
Perform actions on period. | ||
:return: None | ||
""" | ||
|
||
@abstractmethod | ||
def handle_envelope(self, envelope: Envelope) -> None: | ||
""" | ||
Handle an envelope. | ||
:param envelope: the envelope to handle. | ||
:return: None | ||
""" | ||
|
||
@abstractmethod | ||
def get_periodic_tasks( | ||
self, | ||
) -> Dict[Callable, Tuple[float, Optional[datetime.datetime]]]: | ||
""" | ||
Get all periodic tasks for agent. | ||
:return: dict of callable with period specified | ||
""" | ||
|
||
@abstractmethod | ||
def get_message_handlers(self) -> List[Tuple[Callable[[Any], None], Callable]]: | ||
""" | ||
Get handlers with message getters. | ||
:return: List of tuples of callables: handler and coroutine to get a message | ||
""" | ||
|
||
@abstractmethod | ||
def get_multiplexer_setup_options(self) -> Optional[Dict]: | ||
""" | ||
Get options to pass to Multiplexer.setup. | ||
:return: dict of kwargs | ||
""" | ||
|
||
@abstractproperty | ||
def connections(self) -> List[Connection]: | ||
"""Return list of connections.""" | ||
|
||
@abstractmethod | ||
def exception_handler( | ||
self, exception: Exception, function: Callable | ||
) -> Optional[bool]: | ||
""" | ||
Handle exception raised during agent main loop execution. | ||
:param exception: exception raised | ||
:param function: a callable exception raised in. | ||
:return: skip exception if True, otherwise re-raise it | ||
""" | ||
|
||
@abstractmethod | ||
def teardown(self) -> None: | ||
""" | ||
Tear down the agent. | ||
:return: None | ||
""" |
Oops, something went wrong.