Skip to content
Snippets Groups Projects
Commit d097dff1 authored by Olivier Bertrand's avatar Olivier Bertrand
Browse files

Fix convention issues in test function of agent

parent c2463643
No related branches found
No related tags found
No related merge requests found
......@@ -49,7 +49,7 @@ class DefaultBrain():
class AbstractAgent():
def __init__(self, convention='rxyz'):
def __init__(self, convention='rzyx'):
self._brain = DefaultBrain()
self._alter_posorientvel = defaultcallback
tuples = [('location', 'x'), ('location', 'y'),
......
......@@ -18,7 +18,7 @@ version = float(nx.__version__)
class BrainTest(Brain):
def __init__(self, renderer=None):
Brain.__init__(self, renderer=renderer)
convention = 'rxyz'
convention = 'rzyx'
tuples = [('location', 'x'), ('location', 'y'),
('location', 'z'), (convention, 'alpha_0'),
(convention, 'alpha_1'), (convention, 'alpha_2')]
......@@ -48,21 +48,23 @@ class TestNavipyMovingAgent(unittest.TestCase):
self.mydb_filename = pkg_resources.resource_filename(
'navipy', 'resources/database.db')
self.mydb = navidb.DataBaseLoad(self.mydb_filename)
self.convention = 'rzyx'
self.brain = BrainTest(self.mydb)
convention = 'rxyz'
tuples = [('location', 'x'), ('location', 'y'),
('location', 'z'), (convention, 'alpha_0'),
(convention, 'alpha_1'), (convention, 'alpha_2')]
('location', 'z'), (self.convention, 'alpha_0'),
(self.convention, 'alpha_1'), (self.convention, 'alpha_2')]
index = pd.MultiIndex.from_tuples(tuples,
names=['position',
'orientation'])
self.__posorient_col = index
tuples_vel = [('location', 'x'), ('location', 'y'),
('location', 'z'), (convention, 'alpha_0'),
(convention, 'alpha_1'), (convention, 'alpha_2'),
('location', 'z'), (self.convention, 'alpha_0'),
(self.convention, 'alpha_1'),
(self.convention, 'alpha_2'),
('location', 'dx'), ('location', 'dy'),
('location', 'dz'), (convention, 'dalpha_0'),
(convention, 'dalpha_1'), (convention, 'dalpha_2')]
('location', 'dz'), (self.convention, 'dalpha_0'),
(self.convention, 'dalpha_1'),
(self.convention, 'dalpha_2')]
index_vel = pd.MultiIndex.from_tuples(tuples_vel,
names=['position',
'orientation'])
......@@ -87,7 +89,7 @@ class TestNavipyMovingAgent(unittest.TestCase):
# GridAgent
#
def test_move_gridagent(self):
agent = naviagent.GridAgent(self.brain, 'rxyz')
agent = naviagent.GridAgent(self.brain, self.convention)
initposorient = None
with warnings.catch_warnings(record=True):
initposorient = self.brain.posorients.loc[13, :]
......@@ -114,7 +116,7 @@ class TestNavipyMovingAgent(unittest.TestCase):
obtained, initposorient.loc[obtained.index]))
def test_fly_gridagent(self):
agent = naviagent.GridAgent(self.brain, 'rxyz')
agent = naviagent.GridAgent(self.brain, self.convention)
initposorient = None
with warnings.catch_warnings(record=True):
initposorient = self.brain.posorients.loc[13, :]
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment