Octave variables are not displayed in the Cantor's workspace. If there is a way to debug this issue, please let me know. [ moved to become a specific bug from https://bugs.kde.org/show_bug.cgi?id=406684 ]
Created attachment 119567 [details] Octave variable
(In reply to avlas from comment #0) > Octave variables are not displayed in the Cantor's workspace. If there is a > way to debug this issue, please let me know. The variables are shown in the variable panel as shown on the screenshot attached. What do you mean with the variable is not displayed? You create a variable and you don't get any input and nothing is shown in the variable panel?
(In reply to Alexander Semke from comment #2) > (In reply to avlas from comment #0) > > Octave variables are not displayed in the Cantor's workspace. If there is a > > way to debug this issue, please let me know. > The variables are shown in the variable panel as shown on the screenshot > attached. What do you mean with the variable is not displayed? You create a > variable and you don't get any input and nothing is shown in the variable > panel? I mean that in my system they do not appear in the panel.
(In reply to avlas from comment #3) > (In reply to Alexander Semke from comment #2) > > (In reply to avlas from comment #0) > > > Octave variables are not displayed in the Cantor's workspace. If there is a > > > way to debug this issue, please let me know. > > The variables are shown in the variable panel as shown on the screenshot > > attached. What do you mean with the variable is not displayed? You create a > > variable and you don't get any input and nothing is shown in the variable > > panel? > > I mean that in my system they do not appear in the panel. Is your input processed by octave at all? Can you please start cantor in the terminal, enter the variable and paste here the debug output? The relevant part of the output starts with "evaluating:...".
(In reply to Alexander Semke from comment #4) > (In reply to avlas from comment #3) > > (In reply to Alexander Semke from comment #2) > > > (In reply to avlas from comment #0) > > > > Octave variables are not displayed in the Cantor's workspace. If there is a > > > > way to debug this issue, please let me know. > > > The variables are shown in the variable panel as shown on the screenshot > > > attached. What do you mean with the variable is not displayed? You create a > > > variable and you don't get any input and nothing is shown in the variable > > > panel? > > > > I mean that in my system they do not appear in the panel. > Is your input processed by octave at all? Can you please start cantor in the > terminal, enter the variable and paste here the debug output? The variables are processed alright, it's rather a matter of the panel not showing them. > The relevant > part of the output starts with "evaluating:...". Will do... thanks! Btw, what version of Octave do you use? I use Octave 5.1.
(In reply to avlas from comment #5) > Btw, what version of Octave do you use? I use Octave 5.1. I'm using Octave 5.1.0 on openSUSE LEAP 15.
(In reply to Alexander Semke from comment #6) > (In reply to avlas from comment #5) > > Btw, what version of Octave do you use? I use Octave 5.1. > I'm using Octave 5.1.0 on openSUSE LEAP 15. Can you please restart cantor and do the following? #1: plot(1:10) #2: x = 2 It seems that it just doing #2 above works, but not if one does #1 first. This is what I see in the terminal: evaluating: "x =2" evaluate wsStatusChange 0 currentExpressionStatusChanged readOutput start parsing "x = 2\n" readOutput start parsing "CANTOR_OCTAVE_BACKEND_PROMPT:5> " parseOutput: "x = 2\n" setting result to a type 1 result update Entry currentExpressionStatusChanged Entry Appended
Created attachment 119568 [details] Octave variable 2
(In reply to Alexander Semke from comment #8) > Created attachment 119568 [details] > Octave variable 2 I see. Wondering why it fails here. Do you see anything wrong in the terminal info?
(In reply to avlas from comment #7) > (In reply to Alexander Semke from comment #6) > > (In reply to avlas from comment #5) > > > Btw, what version of Octave do you use? I use Octave 5.1. > > I'm using Octave 5.1.0 on openSUSE LEAP 15. > > Can you please restart cantor and do the following? > > #1: plot(1:10) > #2: x = 2 I added another screenshot. For the plot there is no variable created and added to the panel. For the second assignment there is the variable 'x' shown. Do you also have this? Or nothing? > > It seems that it just doing #2 above works, but not if one does #1 first. > > This is what I see in the terminal: > > evaluating: "x =2" > evaluate > wsStatusChange 0 > currentExpressionStatusChanged > readOutput > start parsing "x = 2\n" > readOutput > start parsing "CANTOR_OCTAVE_BACKEND_PROMPT:5> " > parseOutput: "x = 2\n" > setting result to a type 1 result > update Entry > currentExpressionStatusChanged > Entry Appended
(In reply to avlas from comment #9) > (In reply to Alexander Semke from comment #8) > > Created attachment 119568 [details] > > Octave variable 2 > > I see. Wondering why it fails here. Do you see anything wrong in the > terminal info? I don't see any 'start parsing "__cantor_delimiter_line__\n"' in your output... Somewhere else you mentioned an issues with __cantor_delimeter_line__ on your computer. What was it?
(In reply to Alexander Semke from comment #11) > (In reply to avlas from comment #9) > > (In reply to Alexander Semke from comment #8) > > > Created attachment 119568 [details] > > > Octave variable 2 > > > > I see. Wondering why it fails here. Do you see anything wrong in the > > terminal info? > I don't see any 'start parsing "__cantor_delimiter_line__\n"' in your > output... Somewhere else you mentioned an issues with > __cantor_delimeter_line__ on your computer. What was it? Can you please add here the full output after you've started Cantor? So, start cantor, execute those two commands and add the output here. Maybe as a text file.
This is the full info from the terminal (there is always a first error because the system path is not visible to flatpak, I workarounded this by copying the content in $HOME and adding it to the path): dir: "/usr/lib/x86_64-linux-gnu/qt5/plugins/cantor/backends" Creating NullBackend Creating PythonBackend dir: "/usr/bin/cantor/backends" Backend "Octave" offers extensions: ("HistoryExtension", "ScriptExtension", "PlotExtension", "LinearAlgebraExtension", "VariableManagementExtension", "PackagingExtension") OctaveSession(0x5629619bbf30) Cantor::VariableManagementExtension(0x5629619ab6f0, name = "VariableManagementExtension") "/usr/share/cantor/octavebackend/" new worksheetaccess interface loading assistants... dir: "/usr/lib/x86_64-linux-gnu/qt5/plugins/cantor/assistants" plugin "GràficAvançat" is not supported by "Octave" plugin "Crea una matriu" is supported by "Octave" , requires extensions ("LinearAlgebraExtension") plugin "Deriva" is not supported by "Octave" plugin "Valors propis (autovalors)" is supported by "Octave" , requires extensions ("LinearAlgebraExtension", "HistoryExtension") plugin "Vectors propis (autovectors)" is supported by "Octave" , requires extensions ("LinearAlgebraExtension", "HistoryExtension") plugin "Importació de paquet" is supported by "Octave" , requires extensions ("PackagingExtension") plugin "Integra" is not supported by "Octave" plugin "Inverteix una matriu" is supported by "Octave" , requires extensions ("LinearAlgebraExtension", "HistoryExtension") plugin "Plot2d" is supported by "Octave" , requires extensions ("PlotExtension") plugin "Plot3d" is supported by "Octave" , requires extensions ("PlotExtension") plugin "Gràfic de Qalculate" is not supported by "Octave" plugin "ExecutaScript" is supported by "Octave" , requires extensions ("ScriptExtension") plugin "Resol" is not supported by "Octave" dir: "/usr/bin/cantor/assistants" loading panel plugins for session of type "Octave" dir: "/usr/lib/x86_64-linux-gnu/qt5/plugins/cantor/panels" plugin "Ajuda" is supported, requires extensions ("") plugin "Gestor de variables" is supported, requires extensions ("VariableManagementExtension") dir: "/usr/bin/cantor/panels" Entry Appended adding panel for "Ajuda" adding panel for "Gestor de variables" ShortcutOverride 16777220 QFlags<Qt::KeyboardModifier>(ShiftModifier) login starting ("/var/lib/flatpak/exports/bin/org.octave.Octave", "--silent", "--interactive", "--persist", "--eval", "PS1('CANTOR_OCTAVE_BACKEND_PROMPT:\\#> ');", "--eval", "PS2('CANTOR_OCTAVE_BACKEND_SUBPROMPT:\\#> ');", "--eval", "addpath /usr/share/cantor/octavebackend/;", "--eval", "printf('%s\\n', ['____TMP_DIR____ = ' tempdir]);", "--eval", "suppress_verbose_help_message(1);", "--eval", "set (0, \"defaultfigurevisible\",\"off\");", "--eval", "graphics_toolkit gnuplot;") login input: "____TMP_DIR____ = /tmp/\n" Got temporary file dir: "/tmp/" wsStatusChange 1 login done evaluating: "plot(1:100)" evaluate Executing a plot command wsStatusChange 0 currentExpressionStatusChanged readOutput start parsing "CANTOR_OCTAVE_BACKEND_PROMPT:1> " readError currentExpressionStatusChanged evaluating: "printf('__cantor_delimiter_line__\\n');__cantor_list__ = who();__cantor_parse_values__ = true;for __cantor_index__ = 1:length(__cantor_list__) __cantor_varname__ = char(__cantor_list__{__cantor_index__}); printf([__cantor_varname__ '\\n']); if (__cantor_parse_values__) try eval(['__cantor_string__ = disp(' __cantor_varname__ ');']); printf(__cantor_string__); catch printf(['<unprintable value>' '\\n']); end_try_catch; endif; printf('__cantor_delimiter_line__\\n')endfor;clear __cantor_list__;clear __cantor_index__;clear __cantor_varname__;clear __cantor_parse_values__;clear __cantor_string__;" evaluate wsStatusChange 0 currentExpressionStatusChanged readError currentExpressionStatusChanged wsStatusChange 1 Octave code for parsing variables finish with error message: "warning: your version of GraphicsMagick limits images to 8 bits per pixel\n" readError readOutput start parsing "CANTOR_OCTAVE_BACKEND_PROMPT:2> " readOutput start parsing "__cantor_delimiter_line__\n" readOutput start parsing "CANTOR_OCTAVE_BACKEND_PROMPT:3> " ShortcutOverride 16777220 QFlags<Qt::KeyboardModifier>(ShiftModifier) evaluating: "plot(1:100)" evaluate Executing a plot command wsStatusChange 0 currentExpressionStatusChanged readOutput start parsing "CANTOR_OCTAVE_BACKEND_PROMPT:4> " parseOutput: "" parsePlotFile OctaveExpression::parsePlotFile: "/tmp/c-ob-qcGjuu.eps" setting result to a type 5 result update Entry rendering eps file: QUrl("file:///tmp/c-ob-qcGjuu.eps") scale: 1.8 dimension: 864 x 604.8 currentExpressionStatusChanged Entry Appended ShortcutOverride 16777220 QFlags<Qt::KeyboardModifier>(ShiftModifier) evaluating: "x = 2" evaluate wsStatusChange 0 currentExpressionStatusChanged readOutput start parsing "x = 2\n" readOutput start parsing "CANTOR_OCTAVE_BACKEND_PROMPT:5> " parseOutput: "x = 2\n" setting result to a type 1 result update Entry currentExpressionStatusChanged Entry Appended
> Maybe as a text file. Sorry, we crossed emails
I think this issue may be related to the other one I mentioned about warnings. Could you please try the following? create a function which filename is called f_test.m with the following content: function x = test(y) x = y.^2; end now open cantor and do: y = f_test(3) this should trigger a warning because the name of the function does not match the name of the file in my case no more than the warning is displayed, and I need to press shift-enter again to see the output in the terminal: y = 9 but nothing appears in the workspace panel if I'm not wrong warnings (and perhaps other signals too) trigger this behavior because of a flatpak issue, I got a warning from plotting (this is being fixed while we are talking), but the point here is that warnings trigger this weird behavior, at least in my system. could you please try to reproduce? then
Hi avlas, Octave writes error messages and warnings into stderr. In Cantor we don't distinguish between warnings and errors. And, if a expression finished with error, Cantor show only error and don't show output of failed command.
(In reply to Nikita Sirgienko from comment #16) > Hi avlas, Octave writes error messages and warnings into stderr. In Cantor > we don't distinguish between warnings and errors. And, if a expression > finished with error, Cantor show only error and don't show output of failed > command. That sounds good. But the output should still appear for warnings in addition to the warning message, right? For whatever reason this doesn't seem to be the case in my system. Did you have a chance to try the f_test I mentioned?
About plot and variable model: Octave (and it isn't correct behaviour) could print warning with some delay after printing prompt. So, according your log, Cantor get warning message, when he finished with "plot" command (and waits for plot file) and computing an internal command for updating variable panel. So, Cantor thinks, that the internal command failed and don't updates the panel.
Created attachment 119570 [details] f_test function usage
(In reply to avlas from comment #17) > (In reply to Nikita Sirgienko from comment #16) > > Hi avlas, Octave writes error messages and warnings into stderr. In Cantor > > we don't distinguish between warnings and errors. And, if a expression > > finished with error, Cantor show only error and don't show output of failed > > command. > > That sounds good. But the output should still appear for warnings in > addition to the warning message, right? No, I mean, in this moment, Cantor don't show output for warnings (yes, it's not very compfort for user). See https://bugs.kde.org/show_bug.cgi?id=406777 for my advanced explanetion. > For whatever reason this doesn't seem to be the case in my system. > > Did you have a chance to try the f_test I mentioned? Yes, you can see a result of this in attachments.
(In reply to Nikita Sirgienko from comment #20) > (In reply to avlas from comment #17) > > (In reply to Nikita Sirgienko from comment #16) > > > Hi avlas, Octave writes error messages and warnings into stderr. In Cantor > > > we don't distinguish between warnings and errors. And, if a expression > > > finished with error, Cantor show only error and don't show output of failed > > > command. > > > > That sounds good. But the output should still appear for warnings in > > addition to the warning message, right? > > No, I mean, in this moment, Cantor don't show output for warnings (yes, it's > not very compfort for user). See https://bugs.kde.org/show_bug.cgi?id=406777 > for my advanced explanetion. > > > For whatever reason this doesn't seem to be the case in my system. > > > > Did you have a chance to try the f_test I mentioned? > Yes, you can see a result of this in attachments. Thank you for testing and for the explanation. Unfortunately it is not very obvious to reproduce :/ One last way I can imagine to try to reproduce my issue is the following: - Move the functions of the backend to a different location in the filesystem and add the new location to octave's path (in .octaverc). This is basically what I need to do given that Octave's flatpak cannot reach system's location: "warning: addpath: /usr/share/cantor/octavebackend/: The file or directory does not exist" I even tried moving it to the home share folder $HOME/.local/share/cantor/octavebackend/ but this didn't work either. Perhaps one thing that might help would be checking if backend functions are in octave's path, instead of just looking for them in the expected filesystem location.
(In reply to avlas from comment #21) > (В ответ на Никиту Сиргиенко из комментария № 20 ) > > (В ответ на Авлас из комментария № 17 ) > >> (В ответ на Никиту Сиргиенко из комментария № 16 ) > >>> Привет, Авлас, Octave записывает сообщения об ошибках и предупреждения в stderr. В Канторе > >>> мы не различаем предупреждения и ошибки. И, если выражение > >>> завершилось с ошибкой, Кантор показывает только ошибку и не показывает вывод команды «>>> > . > >> > >> Это звучит хорошо. Но вывод все равно должен появляться для предупреждений в > >> дополнении к предупреждающему сообщению, верно? > >> > Нет, я имею в виду, в этот момент Кантор не > > Не очень комфортно для пользователя). См. Https://bugs.kde.org/show_bug.cgi?id=406777 > > мое расширенное объяснение. > >>> > По какой-то причине в моей системе это не так. > >> > >> Возможно , у вас есть шанс попробовать f_test я говорил? > > Да, вы можете увидеть результат этого во вложениях. > > Спасибо за тестирование и за объяснение. > > К сожалению, это не очень очевидно для воспроизведения: / > > Один из последних способов воспроизвести мою проблему заключается в > следующем: > > - Переместите функции бэкэнда в другое место в файловой системе и добавьте > новое местоположение в путь октавы (в .octaverc). > > Это в основном то, что мне нужно сделать, учитывая, что flatpak Octave не > может добраться до местоположения системы: «предупреждение: addpath: / usr / > share / cantor / octavebackend /: файл или каталог не существует» It's strange, actually. Cantor searchs directory "octavebackend" in "~/.local/share/cantor", "/usr/local/share/cantor", "/usr/share/cantor". So, this is strange, that the directory was found, but don't exist. But, it is current behaviour. I am not familiar with flatpak, it's used kde apllication releases (19.04 in this moment), or current code in repository? > Я даже попытался переместить его в папку домашнего ресурса $ HOME / .local / > share / cantor / octavebackend /, но это тоже не сработало. > > Возможно, одна вещь, которая могла бы помочь, это проверить, находятся ли > бэкэнд-функции в пути октавы, вместо того, чтобы просто искать их в > ожидаемом местоположении файловой системы.
Created attachment 119572 [details] Cantor crash Sometimes Cantor crashes while doing these tests. This is a backtrace of one of them.
(In reply to avlas from comment #23) > Created attachment 119572 [details] > Cantor crash > > Sometimes Cantor crashes while doing these tests. This is a backtrace of one > of them. Thanks, this is helps (Some precondition failed and Cantor crashes), but I still don't understand, why they precondition failed.
(In reply to Nikita Sirgienko from comment #24) > (In reply to avlas from comment #23) > > Created attachment 119572 [details] > > Cantor crash > > > > Sometimes Cantor crashes while doing these tests. This is a backtrace of one > > of them. > > Thanks, this is helps (Some precondition failed and Cantor crashes), but I > still don't understand, why they precondition failed. Mmm, maybe the flatpak container does not have access to ~/.local/share/cantor either :/
(In reply to avlas from comment #25) > (In reply to Nikita Sirgienko from comment #24) > > (In reply to avlas from comment #23) > > > Created attachment 119572 [details] > > > Cantor crash > > > > > > Sometimes Cantor crashes while doing these tests. This is a backtrace of one > > > of them. > > > > Thanks, this is helps (Some precondition failed and Cantor crashes), but I > > still don't understand, why they precondition failed. > > > Mmm, maybe the flatpak container does not have access to > ~/.local/share/cantor either :/ Well it does (but only when I put it in .octaverc): evaluate wsStatusChange 0 currentExpressionStatusChanged readOutput start parsing "'cantor_print' is a function from the file /home/jsardid/.local/share/cantor/octavebackend/cantor_print.m\n" readOutput start parsing "CANTOR_OCTAVE_BACKEND_PROMPT:2> " parseOutput: "'cantor_print' is a function from the file /home/jsardid/.local/share/cantor/octavebackend/cantor_print.m\n" setting result to a type 1 result currentExpressionStatusChanged wsStatusChange 1 readOutput start parsing "__cantor_delimiter_line__\n" readOutput start parsing "ans\n" readOutput start parsing "0\n" start parsing "__cantor_delimiter_line__\n" readOutput start parsing "CANTOR_OCTAVE_BACKEND_PROMPT:3> "
(In reply to Nikita Sirgienko from comment #24) > (In reply to avlas from comment #23) > > Created attachment 119572 [details] > > Cantor crash > > > > Sometimes Cantor crashes while doing these tests. This is a backtrace of one > > of them. > > Thanks, this is helps (Some precondition failed and Cantor crashes), but I > still don't understand, why they precondition failed. Are you 100% sure cantor looks in ~/.local/share/cantor location? I only see it checking in /usr/share/cantor: starting ("/var/lib/flatpak/exports/bin/org.octave.Octave", "--silent", "--interactive", "--persist", "--eval", "PS1('CANTOR_OCTAVE_BACKEND_PROMPT:\\#> ');", "--eval", "PS2('CANTOR_OCTAVE_BACKEND_SUBPROMPT:\\#> ');", "--eval", "addpath /usr/share/cantor/octavebackend/;", "--eval", "printf('%s\\n', ['____TMP_DIR____ = ' tempdir]);", "--eval", "suppress_verbose_help_message(1);", "--eval", "set (0, \"defaultfigurevisible\",\"off\");", "--eval", "graphics_toolkit gnuplot;") login input: "____TMP_DIR____ = /tmp/\n"
(In reply to avlas from comment #27) > (In reply to Nikita Sirgienko from comment #24) > > (In reply to avlas from comment #23) > > > Created attachment 119572 [details] > > > Cantor crash > > > > > > Sometimes Cantor crashes while doing these tests. This is a backtrace of one > > > of them. > > > > Thanks, this is helps (Some precondition failed and Cantor crashes), but I > > still don't understand, why they precondition failed. > > Are you 100% sure cantor looks in ~/.local/share/cantor location? I only see > it checking in /usr/share/cantor: > > starting ("/var/lib/flatpak/exports/bin/org.octave.Octave", "--silent", > "--interactive", "--persist", "--eval", > "PS1('CANTOR_OCTAVE_BACKEND_PROMPT:\\#> ');", "--eval", > "PS2('CANTOR_OCTAVE_BACKEND_SUBPROMPT:\\#> ');", "--eval", "addpath > /usr/share/cantor/octavebackend/;", "--eval", "printf('%s\\n', > ['____TMP_DIR____ = ' tempdir]);", "--eval", > "suppress_verbose_help_message(1);", "--eval", "set (0, > \"defaultfigurevisible\",\"off\");", "--eval", "graphics_toolkit gnuplot;") > login input: "____TMP_DIR____ = /tmp/\n" Depends of Cantor version, 19.04 and current master branch does, but older versions use only /usr/share/cantor/octavebackend. Also, directory, used in `addpath` statement, is a first 'octavebackend' directory found by Cantor in paths, that I mentioned. There is 'About Cantor' in 'Help' menu. The version, mentioned there, is 19.04?
Created attachment 119575 [details] cantor version Cantor version 19.04
(In reply to avlas from comment #29) > Created attachment 119575 [details] > cantor version > > Cantor version 19.04 Could you please test manually moving the files out of /usr/share/cantor/octavebackend/ and setting them in ~/local/share/cantor/octavebackend? Perhaps the best/easiest of all would be to replicate what I have (installing octave from flatpak): "flatpak install flathub org.octave.Octave" and configure the executable to: /var/lib/flatpak/exports/bin/org.octave.Octave
(In reply to avlas from comment #30) > (In reply to avlas from comment #29) > > Created attachment 119575 [details] > > cantor version > > > > Cantor version 19.04 > > Could you please test manually moving the files out of > /usr/share/cantor/octavebackend/ and setting them in > ~/local/share/cantor/octavebackend? > > Perhaps the best/easiest of all would be to replicate what I have > (installing octave from flatpak): > > "flatpak install flathub org.octave.Octave" > > and configure the executable to: > /var/lib/flatpak/exports/bin/org.octave.Octave Yes, you right, I was mistaken. 19.04 has fix for file location, but unlike of master branch, the patch haven't code for octave, my fault. I will add fix for this tommorow, and it will be in 19.04.1
Excellent, thank you very much!
Git commit 4b78512e9a83f67984583b4e393963c77b026e98 by Nikita Sirgienko. Committed on 23/04/2019 at 12:01. Pushed by sirgienko into branch 'Applications/19.04'. [Octave] Some fixes: - add paths for all found octave script directory to Octave - improve parsing logic, for preventing loosing some output from octave (from printf) FIXED-IN: 19.04.1 M +21 -3 src/backends/octave/octavesession.cpp M +10 -0 src/lib/session.cpp M +1 -0 src/lib/session.h https://commits.kde.org/cantor/4b78512e9a83f67984583b4e393963c77b026e98
Actually, we will have some warnings from flakpak Octave about non-existings paths, because Cantor searchs 'octavebackend' in host filesystem (for example, /usr/local/share/cantor) and in this filesystem the directory exists, but in container filesystem this is not true.
(In reply to Nikita Sirgienko from comment #34) > Actually, we will have some warnings from flakpak Octave about non-existings > paths, because Cantor searchs 'octavebackend' in host filesystem (for > example, /usr/local/share/cantor) and in this filesystem the directory > exists, but in container filesystem this is not true. That's right. There could be ways to workaround this, but I would suggest to wait and see if https://bugs.kde.org/show_bug.cgi?id=406777 fixes the issue, so warnings are not harmful anymore.