ecell / ecell4_base

An integrated software environment for multi-algorithm, multi-timescale, multi-spatial-representation simulation of various cellular phenomena
https://ecell4.e-cell.org/
GNU General Public License v3.0
63 stars 23 forks source link

Errors in Python unittests #308

Open kozo2 opened 5 years ago

kozo2 commented 5 years ago

env

Errors

(base) C:\Users\a\ecell4\python\tests>python -m unittest
EEE.......E.EE.
======================================================================
ERROR: test1 (core.test_context.ContextText)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Users\a\ecell4\python\tests\core\test_context.py", line 13, in test1
    self.assertEqual(sp1.count(Species("A")), 1)
  File "lib\ecell4\Species.pxi", line 245, in ecell4.core.Species.count
RuntimeError: deprecated

======================================================================
ERROR: test2 (core.test_context.ContextText)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Users\a\ecell4\python\tests\core\test_context.py", line 18, in test2
    self.assertEqual(sp1.count(Species("A.B")), 1)
  File "lib\ecell4\Species.pxi", line 245, in ecell4.core.Species.count
RuntimeError: deprecated

======================================================================
ERROR: test3 (core.test_context.ContextText)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Users\a\ecell4\python\tests\core\test_context.py", line 23, in test3
    self.assertEqual(sp1.count(Species("A(p=u^1).B(b^1)")), 1)
  File "lib\ecell4\Species.pxi", line 245, in ecell4.core.Species.count
RuntimeError: deprecated

======================================================================
ERROR: test2 (core.test_species.SpeciesTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Users\a\ecell4\python\tests\core\test_species.py", line 21, in test2
    self.assertEqual(sp.num_units(), 3)
AttributeError: 'ecell4.core.Species' object has no attribute 'num_units'

======================================================================
ERROR: test4 (core.test_species.SpeciesTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Users\a\ecell4\python\tests\core\test_species.py", line 51, in test4
    sp.deserialize('A.B.C')
AttributeError: 'ecell4.core.Species' object has no attribute 'deserialize'

======================================================================
ERROR: test5 (core.test_species.SpeciesTest)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "C:\Users\a\ecell4\python\tests\core\test_species.py", line 66, in test5
    self.assertEqual(sp.num_units(), 2)
AttributeError: 'ecell4.core.Species' object has no attribute 'num_units'

----------------------------------------------------------------------
Ran 15 tests in 0.003s

FAILED (errors=6)
kaizu commented 5 years ago

Species's count, num_units, and deserialize are deprecated. Species::count could be replaced with count_species_matches. To count the number of unit species, check the size of a list given by Species::units. Function Species::deserialize has no alternative. Just use Species constructor instead.

kaizu commented 5 years ago

Close this. If not fixed, please reopen.

kozo2 commented 5 years ago

It failed again. Refer to https://api.travis-ci.org/v3/job/455078340/log.txt