diff --git a/.gitignore b/.gitignore index 37a2088..1495c09 100644 --- a/.gitignore +++ b/.gitignore @@ -11,6 +11,7 @@ __pycache__/* .cache/* .*.swp */.ipynb_checkpoints/* +*.DS_Store # Project files .ropeproject diff --git a/.travis.yml b/.travis.yml index 7b59f70..aa63d41 100644 --- a/.travis.yml +++ b/.travis.yml @@ -4,21 +4,16 @@ sudo: false language: python -virtualenv: - system_site_packages: true -env: - matrix: - - DISTRIB="ubuntu" PYTHON_VERSION="2.7" COVERAGE="true" - - DISTRIB="conda" PYTHON_VERSION="2.7" COVERAGE="false" - - DISTRIB="conda" PYTHON_VERSION="3.3" COVERAGE="false" - - DISTRIB="conda" PYTHON_VERSION="3.4" COVERAGE="false" +python: + - "3.5" addons: apt: packages: - git - python-pip +env: + - export PYTHONPATH=$TRAVIS_BUILD_DIR install: - - source tests/travis_install.sh - pip install -r requirements.txt before_script: - git config --global user.email "you@example.com" diff --git a/distalg/process.py b/distalg/process.py index 5dd6724..945f006 100644 --- a/distalg/process.py +++ b/distalg/process.py @@ -30,8 +30,8 @@ def _receive_msgs(): def __init__(self, pid=None): self._id = pid or shortuuid.uuid() - self.in_channels = [] - self.out_channels = [] + self.in_channels = set() + self.out_channels = set() self.incoming_msgs = asyncio.Queue() self.receive_msgs = self._receive_msgs_creator() diff --git a/distalg/simulation.py b/distalg/simulation.py index 946c43f..756791d 100644 --- a/distalg/simulation.py +++ b/distalg/simulation.py @@ -43,8 +43,8 @@ def __init__(self, embedding_graph=None, process_type=Process, channel_type=Chan channel._back = rev_channel rev_channel._back = channel - process_n.out_channels.append(channel) - process_nbr.in_channels.append(channel) + process_n.out_channels.add(channel) + process_nbr.in_channels.add(channel) async def start_all(self): self.tasks += [asyncio.ensure_future(process.run()) for process in self.node_map] \ diff --git a/requirements.txt b/requirements.txt index 4d435c8..a16de93 100644 --- a/requirements.txt +++ b/requirements.txt @@ -13,3 +13,4 @@ python-dateutil==2.6.0 pytz==2017.2 shortuuid==0.5.0 six==1.10.0 +wrapt==1.10.11