higlass / higlass/higlass-python
Opening display from a script
- 主要语言
- Python
- 星标
- 66
- 派生
- 11
- PR 合并指标
- 30 天内没有已合并 PR
描述
I've got higlass working from within a Jupyter notebook, but the same code gives an error when I run it from a script. Is there something different that needs to be done for non-jupyter notebook usage?
Here is the error:
```
Process Process-1:
Traceback (most recent call last):
File "/Users/wnoble/opt/anaconda3/envs/ppx/lib/python3.9/site-packages/multiprocess/process.py", line 315, in _bootstrap
self.run()
File "/Users/wnoble/opt/anaconda3/envs/ppx/lib/python3.9/site-packages/multiprocess/process.py", line 108, in run
self._target(*self._args, **self._kwargs)
File "/Users/wnoble/opt/anaconda3/envs/ppx/lib/python3.9/site-packages/flask/app.py", line 1188, in run
run_simple(t.cast(str, host), port, self, **options)
File "/Users/wnoble/opt/anaconda3/envs/ppx/lib/python3.9/site-packages/werkzeug/serving.py", line 1069, in run_simple
fd = int(os.environ["WERKZEUG_SERVER_FD"])
File "/Users/wnoble/opt/anaconda3/envs/ppx/lib/python3.9/os.py", line 679, in __getitem__
raise KeyError(key) from None
KeyError: 'WERKZEUG_SERVER_FD'
```
And here is the code:
```
my_array = sparse_matrix.toarray().astype(float)
ts = Tileset(
tileset_info=lambda: npmatrix.tileset_info(my_array),
tiles=lambda tids: npmatrix.tiles_wrapper(my_array, tids)
)
display, server, viewconf = higlass.display([
View([
Track(track_type='top-axis', position='top'),
Track(track_type='left-axis', position='left'),
Track(track_type='heatmap',
position='center',
tileset=ts,
height=500),
])
], fuse=False)
display
```
I am running this on MacOS 12.5.1.
贡献指南
调研方向
首先,使用 higlass.display(..., fuse=False) 在非 Jupyter 脚本中复现该故障,然后将其启动路径与正常工作的 notebook 用法进行比较。调查涉及 WERKZEUG_SERVER_FD 的 Flask 服务器错误;当脚本打开显示内容且不引发报告的 KeyError 时,即表示完成。
由索引模型根据 Issue 内容生成。
评估
- 技术栈
- flask, jupyter-notebook, python
- 领域
- api, backend
- Issue 类型
- 缺陷
- 难度
- 3/5
- 预计耗时
- 1-2 天
- 活跃度
- 停滞
- 描述清晰度
- 基本清楚
- 新手友好度
- 35/100