From 46d0221b925c485d024204febd9966956f869049 Mon Sep 17 00:00:00 2001
From: "Olivier J.N. Bertrand" <olivier.bertrand@uni-bielefeld.de>
Date: Wed, 7 Feb 2018 17:06:10 +0100
Subject: [PATCH] Correct PEP8

---
 doc/source/tutorials.rst    | 9 ++++++++-
 navipy/__init__.py          | 9 +++++----
 navipy/moving/agent.py      | 6 ++----
 navipy/moving/test_agent.py | 8 +++++---
 4 files changed, 20 insertions(+), 12 deletions(-)

diff --git a/doc/source/tutorials.rst b/doc/source/tutorials.rst
index da5d1ca..78c50b6 100644
--- a/doc/source/tutorials.rst
+++ b/doc/source/tutorials.rst
@@ -66,7 +66,14 @@ In close loop
 
 Catchment area of ASV
 ---------------------
-
+To calculate the catchment area of homing method for a given goal location, \
+the agent should be displaced multiple time at different location, and obsverve \
+if the agent returned home or not. If it did, then the point in space from which the \
+agent started its return trip is part of the catchment area.
+
+When the agent is restricted to move a grid, and its motion at a given place, only \
+depends on the current surrounding, then to calculate a catchment area one only to \
+build a graph of motion and check how many points converge to it. 
 
 Comparing modalities
 --------------------
diff --git a/navipy/__init__.py b/navipy/__init__.py
index 11aa540..ff78826 100644
--- a/navipy/__init__.py
+++ b/navipy/__init__.py
@@ -1,6 +1,6 @@
 """
 Every agent comes with a brain processing the about of \
-senses or sensors for biological or technical agent, respectively. 
+senses or sensors for biological or technical agent, respectively.
 
 The senses of agents in navipy are limited
 to:
@@ -23,8 +23,8 @@ Then the brain can be updated at a new position orientation:
 Building your own brain
 -----------------------
 
-The Brain class is an abstract Brain, such that it can not control an agent. To control, \
-an agent, the Brain should have a function called velocity. 
+The Brain class is an abstract Brain, such that it can not control an agent. \
+To control, an agent, the Brain should have a function called velocity.
 
 For example, an stationary agent should always return a null velocity.
 
@@ -39,6 +39,7 @@ An agent using an average skyline homing vector, could be build as follow
 """
 from navipy.database import DataBaseLoad
 
+
 class Bunch:
     def __init__(self, **kwds):
         self.__dict__.update(kwds)
@@ -69,5 +70,5 @@ class Brain():
         if isinstance(self.renderer, DataBaseLoad):
             return self.renderer.posorients
         else:
-            raise NotImplementedError("Subclasses should implement this, "+
+            raise NotImplementedError("Subclasses should implement this, " +
                                       "when renderer is not DataBaseLoad")
diff --git a/navipy/moving/agent.py b/navipy/moving/agent.py
index 8a7b2e5..0ac0c9c 100644
--- a/navipy/moving/agent.py
+++ b/navipy/moving/agent.py
@@ -16,9 +16,7 @@ import networkx as nx
 import multiprocessing
 from multiprocessing import Queue, JoinableQueue, Process
 import inspect
-from navipy.database import DataBaseLoad
 import navipy.moving.maths as navimomath
-from navipy import Brain
 
 version = float(nx.__version__)
 
@@ -160,7 +158,7 @@ GridAgent is a close loop agent here its position is snap to a grid.
         self.brain = brain
         self._posorients_queue = posorients_queue
         self._results_queue = results_queue
-        
+
     @property
     def mode_of_motion(self):
         """
@@ -294,7 +292,7 @@ the agent motion, or
                             results_queue=results_queue)
                   for _ in range(num_agents)]
         for w in agents:
-            w.mode_of_motion=self.mode_of_motion
+            w.mode_of_motion = self.mode_of_motion
             w.start()
 
         # Add a poison pill for each agent
diff --git a/navipy/moving/test_agent.py b/navipy/moving/test_agent.py
index ace9b78..67a33ea 100644
--- a/navipy/moving/test_agent.py
+++ b/navipy/moving/test_agent.py
@@ -16,15 +16,16 @@ version = float(nx.__version__)
 
 class BrainTest(Brain):
     def __init__(self, renderer=None):
-        Brain.__init__(self,renderer=renderer)
+        Brain.__init__(self, renderer=renderer)
         self.__posorient_col = ['x', 'y', 'z',
-                            'alpha_0', 'alpha_1', 'alpha_2']
+                                'alpha_0', 'alpha_1', 'alpha_2']
         self.__velocity_col = ['d' + col for col in self.__posorient_col]
         self.__posorient_vel_col = self.__posorient_col
         self.__posorient_vel_col.extend(self.__velocity_col)
 
     def velocity(self):
-        return pd.Series(data=0,index=self.__posorient_vel_col)
+        return pd.Series(data=0, index=self.__posorient_vel_col)
+
 
 class TestNavipyMovingAgent(unittest.TestCase):
     def setUp(self):
@@ -40,6 +41,7 @@ class TestNavipyMovingAgent(unittest.TestCase):
     #
     # AbstractAgent
     #
+
     def test_move_abstractagent(self):
         agent = naviagent.AbstractAgent()
         with self.assertRaises(NameError):
-- 
GitLab