PhonologicalCorpusTools / CorpusTools

Phonological CorpusTools
http://phonologicalcorpustools.github.io/CorpusTools/
GNU General Public License v3.0
113 stars 16 forks source link

ProD environments cause PCT to crash #743

Closed kchall closed 4 years ago

kchall commented 4 years ago

Running ProD on the example corpus with pair [m], [n]. If no environment is selected at all, analysis runs normally and a frequency-only result is calculated as expected. If a non-exhaustive list of environments is given (e.g., only # ), and "Enforce exhaustivity" is selected, PCT correctly identifies that the list is not exhaustive and shows missing words. But if an exhaustive list is given (e.g., # , e, o), PCT just crashes entirely. No error message is printed to the console.

kchall commented 4 years ago

Note: the algorithm is working okay in the current release, 1.4.1 -- just not in the current master branch. @stannam is it possible that something you did in adding an environment filter to MI affected the behaviour for ProD?

stannam commented 4 years ago

I found out what the problem is. It is not from the environment filter, as the algorithm itself runs without any issue. The culprit seems to be the new result window. I'll fix it shortly.

kchall commented 4 years ago

Excellent, thanks, @stannam !

stannam commented 4 years ago

The problem was mainly a GUI issue and not related to the environment filter. It occurred after finishing the calculation and when reporting the results.

The issue was from that a value for 'Algorithm name,' the new column in the result window, was only provided when no environment is selected, but the result window still requires one anyway. When the user specifies environments, 'Algorithm name' does not feed to the result window, and the result window needs a value for 'Algorithm name', thus crash.

Specifically, I didn't notice that the kwargs (i.e., result values from a calculation) for the result window are assigned separately between when an environment is specified or not. So I simply made PCT generate the 'Algorithm name' column only when no environment is specified. I should have added the same line of code for the case where an environment is specified.

I have double-checked it in other functions and there should not be the same problem.