higlass / higlass/higlass-python

Opening display from a script

Đang mở
#95 4 bình luận 0 reaction 0 người được giao Xem trên GitHub
Ngôn ngữ chính
Python
Star
66
Fork
11
Chỉ số merge pull request
Không có pull request nào được merge trong 30 ngày

Mô tả

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.

Hướng dẫn đóng góp

Mở hướng dẫn đóng góp

Hướng nghiên cứu

Start by reproducing the failure from a non-Jupyter script using higlass.display(..., fuse=False), then compare its startup path with the working notebook usage. Investigate the Flask server error involving WERKZEUG_SERVER_FD; done means the script opens the display without raising the reported KeyError.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Đánh giá

Công nghệ
flask, jupyter-notebook, python
Lĩnh vực
api, backend
Loại issue
Lỗi
Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức độ hoạt động
Đình trệ
Độ rõ ràng
Khá rõ ràng
Mức phù hợp với người mới
35/100

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.