pombreda / pysal

Automatically exported from code.google.com/p/pysal
Other
0 stars 0 forks source link

Move calls to random functions out of the doctests and modify the unit tests to support different archhitectures. #52

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
File "/home/serge/Dropbox/pysal/src/pysal/pysal/region/maxp.py", line 508, 
in pysal.region.maxp.Maxp_LISA
Failed example:
    mpl.regions[0]
Expected:
    [98, 97, 96]
Got:
    [98, 97, 87]

why?

Original issue reported on code.google.com by sjsrey on 26 Feb 2010 at 11:52

GoogleCodeExporter commented 9 years ago
In the other doc tests that use seeds, the following form is used:
>>> random.seed(100)
>>> np.random.seed(100)

However, in Maxp_LISA the order is changed:
>>> np.random.seed(100)
>>> random.seed(100)

I don't have a Linux machine with pysal installed so I cannot test this (crazy)
hypothesis that swapping the order matters.

Original comment by dfo...@gmail.com on 27 Feb 2010 at 8:54

GoogleCodeExporter commented 9 years ago
nice find, but swapping the order of random.seed and np.random.seed makes no 
difference on the machine where the test fails. 

Original comment by sjsrey on 27 Feb 2010 at 10:42

GoogleCodeExporter commented 9 years ago
i think this might be a platform issue as on one linux box the test passes:

serge@angeline:~/Dropbox/pysal/src/pysal/pysal/tests$ uname -a
Linux angeline 2.6.31-19-generic #56-Ubuntu SMP Thu Jan 28 02:39:34 UTC 2010 
x86_64 
GNU/Linux

but on a 32-bit machine it fails:
serge@think:~/tmp/pysal/pysal$ uname -a
Linux think 2.6.31-19-generic #56-Ubuntu SMP Thu Jan 28 01:26:53 UTC 2010 i686 
GNU/Linux

Original comment by sjsrey on 27 Feb 2010 at 10:57

GoogleCodeExporter commented 9 years ago
doctests that involve calls to random functions can result in slightly 
different results 
across different platforms. this isn't a bug per se, but it will trigger 
failures in doctests. 
so we should move these cases out of the doctests and modify the unittests to 
support 
different architectures.

Original comment by sjsrey on 20 Mar 2010 at 5:30

GoogleCodeExporter commented 9 years ago

Original comment by sjsrey on 20 Mar 2010 at 5:59

GoogleCodeExporter commented 9 years ago

Original comment by sjsrey on 4 May 2010 at 9:12

GoogleCodeExporter commented 9 years ago

Original comment by sjsrey on 28 Jan 2011 at 7:27

GoogleCodeExporter commented 9 years ago

Original comment by phil.stp...@gmail.com on 19 Apr 2011 at 1:42

GoogleCodeExporter commented 9 years ago
Run current unit test on a Linux machine.

Original comment by dfo...@gmail.com on 19 May 2011 at 4:56

GoogleCodeExporter commented 9 years ago
See attached log from running tests.py on Ubuntu 11.04 on a thinkpad x201

Original comment by dreamessence on 19 May 2011 at 5:04

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by dfo...@gmail.com on 19 May 2011 at 6:21

GoogleCodeExporter commented 9 years ago
I am not able to replicate the problem.  We have not been able to reproduce the 
problem on 3 other Linux boxes.  I am going to close the ticket for now and 
list this as a known issue.

Original comment by dfo...@gmail.com on 10 Jun 2011 at 9:26