openvax / openvax/gtfparse

Pin `numpy` to 1.X.X

Open
#55 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
129
Forks
34
PR merge metrics
No merged PRs in 30d

Description

Downloading pyensembl in a fresh environment yielded:

Traceback (most recent call last):  File "/opt/mamba/envs/pyensembl/bin/pyensembl", line 8, in <module>
    sys.exit(run())
  File "/opt/mamba/envs/pyensembl/lib/python3.10/site-packages/pyensembl/shell.py", line 281, in run
    genome.index(overwrite=args.overwrite)
  File "/opt/mamba/envs/pyensembl/lib/python3.10/site-packages/pyensembl/genome.py", line 280, in index
    self.db.connect_or_create(overwrite=overwrite)
  File "/opt/mamba/envs/pyensembl/lib/python3.10/site-packages/pyensembl/database.py", line 286, in connect_or_create
    return self.create(overwrite=overwrite)
  File "/opt/mamba/envs/pyensembl/lib/python3.10/site-packages/pyensembl/database.py", line 206, in create
    df = self._load_gtf_as_dataframe(
  File "/opt/mamba/envs/pyensembl/lib/python3.10/site-packages/pyensembl/database.py", line 613, in _load_gtf_as_dataframe
    df = read_gtf(
  File "/opt/mamba/envs/pyensembl/lib/python3.10/site-packages/gtfparse/read_gtf.py", line 257, in read_gtf
    result_df = result_df.to_pandas()
  File "/opt/mamba/envs/pyensembl/lib/python3.10/site-packages/polars/dataframe/frame.py", line 2093, in to_pandas
    return self._to_pandas_without_object_columns(
  File "/opt/mamba/envs/pyensembl/lib/python3.10/site-packages/polars/dataframe/frame.py", line 2144, in _to_pandas_without_object_columns
    record_batches = df._df.to_pandas()
  File "/opt/mamba/envs/pyensembl/lib/python3.10/site-packages/pyarrow/__init__.py", line 65, in <module>
    import pyarrow.lib as _lib
AttributeError: _ARRAY_API not found

It seems like pyarrow is not pinning numpy correctly, but I think you'll have a hard time making changes in that library in a timely fashion.
Would enforce in gtfparse. Reinstalling to the latest 1.X.X, eg:

pip install numpy==1.24.3

Fixes the issue.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the dependency configuration for gtfparse and reproduce the failure through read_gtf.py in a fresh environment. Pin numpy to a 1.x release as requested, then verify that the pyarrow import no longer raises the reported _ARRAY_API error.

Written by the indexing model from the issue text.

Assessment

Tech stack
numpy, python
Domain
bioinformatics, data
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.