elephant icon indicating copy to clipboard operation
elephant copied to clipboard

[Bug] Test failure on armv7hl: UETestCase.test__UE_surrogate

Open sanjayankur31 opened this issue 3 years ago • 1 comments

Describe the bug While updating to 0.10.0 in Fedora, on the 32 bit builders (armv7hl), this test fails:

To Reproduce

  1. run tests on 32 bit (armv7hl) system

This is the error we see:

________________________ UETestCase.test__UE_surrogate_________________________
self = <elephant.test.test_unitary_event_analysis.UETestCase testMethod=test__UE_surrogate>
    def test__UE_surrogate(self):
        mat = self.binary_sts
        pattern_hash = np.array([4])
        _, rate_avg_surr, _, n_emp_surr, indices_surr =\
>           ue._UE(
                mat,
                pattern_hash,
                method='surrogate_TrialByTrial',
                n_surrogates=100)
elephant/test/test_unitary_event_analysis.py:305: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
elephant/unitary_event_analysis.py:687: in _UE
    pval = dist_exp(n_emp)
elephant/unitary_event_analysis.py:585: in pval
    hist = np.bincount(np.int64(n_exp))
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
args = (array([1, 2, 1, 1, 1, 1, 0, 0, 2, 2, 0, 2, 1, 1, 1, 0, 0, 2, 0, 1, 1, 0,
       1, 1, 1, 1, 1, 1, 1, 0, 2, 2, 1, 1, 2... 1, 2, 0, 1, 0, 0, 0, 0, 2, 1, 1, 2, 1, 2, 1, 2, 0, 0, 1, 2,
       2, 1, 1, 2, 1, 2, 0, 0, 0, 0, 2, 1], dtype=int64),)
kwargs = {}
relevant_args = (array([1, 2, 1, 1, 1, 1, 0, 0, 2, 2, 0, 2, 1, 1, 1, 0, 0, 2, 0, 1, 1, 0,
       1, 1, 1, 1, 1, 1, 1, 0, 2, 2, 1, 1, 2..., 0, 1, 0, 0, 0, 0, 2, 1, 1, 2, 1, 2, 1, 2, 0, 0, 1, 2,
       2, 1, 1, 2, 1, 2, 0, 0, 0, 0, 2, 1], dtype=int64), None)
>   ???
E   TypeError: Cannot cast array data from dtype('int64') to dtype('int32') according to the rule 'safe'
<__array_function__ internals>:5: TypeError

Expected behavior Not sure tbh.

Environment

  • OS (e.g., Linux): Fedora Linux (rawhide/development/35)
  • How you installed elephant (conda, pip, source): source
  • Python version: platform linux -- Python 3.9.2, pytest-6.2.2, py-1.10.0, pluggy-0.13.1
  • neo python package version: 0.9.0
  • elephant python package version: 0.10.0

This is the hardware information:

CPU info:
Architecture:        armv7l
Byte Order:          Little Endian
CPU(s):              5
On-line CPU(s) list: 0-4
Thread(s) per core:  1
Core(s) per socket:  5
Socket(s):           1
Vendor ID:           APM
Model:               2
Model name:          X-Gene
Stepping:            0x3
BogoMIPS:            80.00
Flags:               half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt vfpd32 lpae evtstrm aes pmull sha1 sha2 crc32

The build and root log files are both attached. They contain the complete build output, and the complete list of software that is installed in the buildroot.

elephant-arm7hl-build.txt elephant-arm7hl-root.txt

sanjayankur31 avatar Mar 11 '21 15:03 sanjayankur31

Hey @sanjayankur31 ,

I've created a bugfix in PR #500 , please let me know if this solves the issue.

Moritz-Alexander-Kern avatar Jul 20 '22 08:07 Moritz-Alexander-Kern