Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] <Your title here> #92

Open
yuzhegan opened this issue Jun 4, 2023 · 10 comments
Open

[Bug] <Your title here> #92

yuzhegan opened this issue Jun 4, 2023 · 10 comments
Labels
bug Something isn't working no repro

Comments

@yuzhegan
Copy link

yuzhegan commented Jun 4, 2023

Describe the bug
A clear and concise description of what the bug is.
/outputchunks.py", line 125, in _get_char_pixelsize assert pty is not None

To Reproduce
Steps to reproduce the behavior:

  1. Go to ':MagmaEvaluateVisual'
  2. See error, with plt.show()

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [arch]
  • Browser [e.g. chrome, safari]
  • Version [e.g. 22]

Additional context
Add any other context about the problem here.

==============================================================================
magma: health#magma#check

requirements ~

  • WARNING health#report_start is deprecated, use vim.health.start instead. :help |deprecated|
    This feature will be removed in Nvim version 0.11
  • OK NeoVim >=0.5
  • WARNING health#report_ok is deprecated, use vim.health.ok instead. :help |deprecated|
    This feature will be removed in Nvim version 0.11
  • OK Python >=3.8
  • OK Python package pynvim found
  • OK Python package jupyter-client found
  • OK Python package ueberzug found
  • OK Python package Pillow found
  • OK Python package cairosvg found
  • OK Python package pnglatex found
  • OK Python package plotly found
  • OK Python package kaleido found
@yuzhegan yuzhegan added the bug Something isn't working label Jun 4, 2023
@yuzhegan
Copy link
Author

yuzhegan commented Jun 4, 2023

err detail:
Error detected while processing function MagmaTick[1]..remote#define#request:
line 2:
Error invoking '/home/david/.config/nvim/dein/repos/github.com/dccsillag/magma-
nvim/rplugin/python3/magma:function:MagmaTick' on channel 4 (python3-rplugin-ho
st):
error caught in request handler '/home/david/.config/nvim/dein/repos/github.com
/dccsillag/magma-nvim/rplugin/python3/magma:function:MagmaTick [[2]]':
Traceback (most recent call last):
File "/home/david/.config/nvim/dein/repos/github.com/dccsillag/magma-nvim/rpl
ugin/python3/magma/utils.py", line 13, in inner
func(self, *args, **kwargs)
File "/home/david/.config/nvim/dein/repos/github.com/dccsillag/magma-nvim/rpl
ugin/python3/magma/init.py", line 414, in function_magma_tick
magma.tick()
File "/home/david/.config/nvim/dein/repos/github.com/dccsillag/magma-nvim/rpl
ugin/python3/magma/magmabuffer.py", line 132, in tick
self.update_interface()
File "/home/david/.config/nvim/dein/repos/github.com/dccsillag/magma-nvim/rpl
ugin/python3/magma/magmabuffer.py", line 203, in update_interface
self._show_selected(self.selected_cell)
File "/home/david/.config/nvim/dein/repos/github.com/dccsillag/magma-nvim/rpl
ugin/python3/magma/magmabuffer.py", line 246, in _show_selected
self.outputs[span].show(span.end)
File "/home/david/.config/nvim/dein/repos/github.com/dccsillag/magma-nvim/rpl
ugin/python3/magma/outputbuffer.py", line 94, in show
chunktext = chunk.place(
^^^^^^^^^^^^
File "/home/david/.config/nvim/dein/repos/github.com/dccsillag/magma-nvim/rpl
ugin/python3/magma/outputchunks.py", line 171, in place
nlines = self._determine_n_lines(lineno, shape)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/david/.config/nvim/dein/repos/github.com/dccsillag/magma-nvim/rpl
ugin/python3/magma/outputchunks.py", line 144, in _determine_n_lines
maybe_pixelsizes = self._get_char_pixelsize()
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/david/.config/nvim/dein/repos/github.com/dccsillag/magma-nvim/rpl
ugin/python3/magma/outputchunks.py", line 125, in _get_char_pixelsize
assert pty is not None
^^^^^^^^^^^^^^^
AssertionError

@WhiteBlackGoose
Copy link
Collaborator

Can you give a precise reproduction? EvaluateVisual on its own works for me

@yuzhegan
Copy link
Author

处理 CursorMoved 自动命令 "*"..function MagmaUpdateInterface[1]..remote#define#request 时发生错误:
第 2 行:
Error invoking '/home/dav/.local/share/nvim/lazy/magma-nvim/rplugin/python3/magma:function:MagmaUpdateInterface' on ch
annel 7 (python3-rplugin-host):
error caught in request handler '/home/dav/.local/share/nvim/lazy/magma-nvim/rplugin/python3/magma:function:MagmaUpdat
eInterface [[]]':
Traceback (most recent call last):
File "/home/dav/.local/share/nvim/lazy/magma-nvim/rplugin/python3/magma/utils.py", line 13, in inner
func(self, *args, **kwargs)
File "/home/dav/.local/share/nvim/lazy/magma-nvim/rplugin/python3/magma/init.py", line 437, in function_update_i
nterface
self._update_interface()
File "/home/dav/.local/share/nvim/lazy/magma-nvim/rplugin/python3/magma/init.py", line 125, in _update_interface

magma.update_interface()

File "/home/dav/.local/share/nvim/lazy/magma-nvim/rplugin/python3/magma/magmabuffer.py", line 217, in update_interfa
ce
self._show_selected(self.selected_cell)
File "/home/dav/.local/share/nvim/lazy/magma-nvim/rplugin/python3/magma/magmabuffer.py", line 260, in _show_selected

self.outputs[span].show(span.end)

File "/home/dav/.local/share/nvim/lazy/magma-nvim/rplugin/python3/magma/outputbuffer.py", line 94, in show
chunktext = chunk.place(
^^^^^^^^^^^^
File "/home/dav/.local/share/nvim/lazy/magma-nvim/rplugin/python3/magma/outputchunks.py", line 171, in place
nlines = self._determine_n_lines(lineno, shape)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/dav/.local/share/nvim/lazy/magma-nvim/rplugin/python3/magma/outputchunks.py", line 144, in determine_n
lines
maybe_pixelsizes = self._get_char_pixelsize()
^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/home/dav/.local/share/nvim/lazy/magma-nvim/rplugin/python3/magma/outputchunks.py", line 125, in _get_char_pix
elsize
assert pty is not None
^^^^^^^^^^^^^^^
AssertionError

@yuzhegan
Copy link
Author

:python3 from ueberzug.process import get_pty_slave; import os; print(get_pty_slave(os.getppid()))
1689590050272.png

@yuzhegan
Copy link
Author

1689590128953.png

@WhiteBlackGoose
Copy link
Collaborator

Not the errors, but step by step how to get this error. I could not get it so far

@yuzhegan
Copy link
Author

yuzhegan commented Jul 18, 2023

this is my code

import numpy as np
import matplotlib.pyplot as plt

X = np.linspace(-np.pi, np.pi, 256)
C, S = np.cos(X), np.sin(X)

plt.plot(X, C)
plt.plot(X, S)

plt.show()

this is my config :

return {
	-- jupyter nvim
	"dccsillag/magma-nvim",
	build = ":UpdateRemotePlugins",
	config = function()
		vim.cmd([[nnoremap <silent> <leader>mk :MagmaInit Python3<CR>
		nnoremap <silent> <leader>m  :MagmaEvaluateOperator<CR>
		nnoremap <silent> <leader>mm :MagmaEvaluateLine<CR>
		xnoremap <silent> <leader>m  :<C-u>MagmaEvaluateVisual<CR>
		nnoremap <silent> <leader>mc :MagmaReevaluateCell<CR>
		nnoremap <silent> <leader>md :MagmaDelete<CR>
		nnoremap <silent> <leader>mo :MagmaShowOutput<CR>
		nnoremap <silent> <leader>ms :MagmaSave<CR>

		let g:magma_automatically_open_output = v:false
		let g:magma_image_provider = "ueberzug"
		let g:magma_save_path = "~/tmp/magma"

		]])
	end,
}

when i use "leader"m, then show this error.

@dmighty007
Copy link

Is this solved? Having the same issue. Code runs well, but image (by matplotlib or seaborn etc) does not show, rather throws this error. Previously having error in wayland but persists in Xorg as well.

@yunus-sun
Copy link

Is this solved? Having the same issue. Code runs well, but image (by matplotlib or seaborn etc) does not show, rather throws this error. Previously having error in wayland but persists in Xorg as well.

Same Issue for me.

@benlubas
Copy link

You can try https://github.com/benlubas/molten-nvim, I forked this plugin and fixed up a bunch of things, added a bunch too. It uses Image.nvim to render images (which in turn uses either Uberzug++ or Kitty Graphics Protocol), and it's much less buggy in my experience.
@yunus-sun @dmighty007

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working no repro
Projects
None yet
Development

No branches or pull requests

5 participants