Skip to content

Numerical Types issue #107

Description

@rpadmanabhan

Hi,
Thanks for maintaining this great library. We are running into an issue on Windows with some of the methods. We first noticed this in the original pyranges package and see that there are already a couple of issues on this topic there. We were hoping this new re-write might have fixed that but we see a similar problem :

>>> foo
index    |    Chromosome    Start     End       Strand      gene_name
int64    |    category      uint32    uint32    category    object
-------  ---  ------------  --------  --------  ----------  ---------------
0        |    GL000008.2    83331     200303    +           ENSG00000296732
1        |    GL000008.2    152368    170429    -           ENSG00000296775
2        |    GL000008.2    177109    208612    -           ENSG00000296756
3        |    GL000009.2    5120      35307     +           ENSG00000297619
...      |    ...           ...       ...       ...         ...
54855    |    chrY          26121657  26135789  +           ENSG00000293280
54856    |    chrY          26409157  26508246  +           ENSG00000294742
54857    |    chrY          26493591  26497550  +           ENSG00000294758
54858    |    chrY          56881848  56882115  +           ENSG00000305394
PyRanges with 54859 rows, 5 columns, and 1 index columns.
Contains 69 chromosomes and 2 strands.
>>> foo.cluster_overlaps()
Traceback (most recent call last):
  File "C:\venvs\pyranges1_test\Lib\site-packages\ruranges\__init__.py", line 1209, in _resolve_rust_fn
    suffix, tgt_grp, tgt_pos = _SUFFIX_TABLE[(grp_dt, pos_dt)]
                               ~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^
KeyError: (dtype('uint32'), dtype('uint32'))

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "C:\venvs\pyranges1_test\Lib\site-packages\pyranges\core\pyranges_main.py", line 745, in cluster_overlaps
    result = super().cluster_overlaps(
             ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\venvs\pyranges1_test\Lib\site-packages\pyranges\range_frame\range_frame.py", line 251, in cluster_overlaps
    cluster, idx = ruranges.cluster(  # type: ignore[attr-defined]
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\venvs\pyranges1_test\Lib\site-packages\ruranges\__init__.py", line 474, in cluster
    return _dispatch_unary(
           ^^^^^^^^^^^^^^^^
  File "C:\venvs\pyranges1_test\Lib\site-packages\ruranges\__init__.py", line 1236, in _dispatch_unary
    rust_fn, grp_t, pos_t = _resolve_rust_fn(prefix, groups.dtype if groups is not None else None, starts.dtype)
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\venvs\pyranges1_test\Lib\site-packages\ruranges\__init__.py", line 1211, in _resolve_rust_fn
    raise TypeError(f"Unsupported dtype pair: {grp_dt}, {pos_dt}") from exc
TypeError: Unsupported dtype pair: uint32, uint32

Do you think this is something you would be able to address to add support for Windows in the near future ? If you had any immediate ideas/suggestions on how to address the issue I can look into it as well.

Thank you
Raghav

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Fields

    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions