Skip to content

Sequence generation failing on Windows machine #6

@mmamica

Description

@mmamica

Hi, I was exploring your modules for sequence generation. I stumbled across one issue appearing in sequence_generation.py and sonia.py scripts. I was getting below error:

ValueError: high is out of bounds for int32

for the part of code that is generating the seeds values:

seeds=np.random.randint(2**32-1,size=num_gen_seqs)

Since no dtype is provided for np.random.randint method, numpy is using a default int, which is platform dependant. For Windows64 machines this will be int32 (you can read about it here: https://stackoverflow.com/questions/36278590/numpy-array-dtype-is-coming-as-int32-by-default-in-a-windows-10-64-bit-machine). Since it's a signed 32 bits integer, the 2**32-1 value is out of bounds. You can easily fix it by specifying dtype while generating seeds, for example:
seeds=np.random.randint(2**32-1,size=num_seqs,dtype=np.int64)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions