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
Maxima outputs warnings which prevent saving a STACK question #349
Comments
I'll look into t his. We already have code in place to ignore some warnings, but I don't like doing this as a blanket approach, since I think that is very poor practice as frustrating as it is. I agree that not letting users save questions with errors can be annoying, and I've been annoyed by this myself in the past. I've already started working on a mechanism to separate out the "validation" of questions form the Moodle form element, and as part of this implemented a separate "warning" mechanism. This might be a good reason to use the warnings, and to bring all this forward. |
Tim, |
Give the reply below, should we squash all such "WARNING" messages? I can't actually generate one in anger, but I'll try the "compile" trick on SBCL to see if this works.... Chris From: Robert Dodier [robert.dodier@gmail.com] On Sun, Feb 18, 2018 at 4:13 AM, SANGWIN Chris C.J.Sangwin@ed.ac.uk wrote:
Well, you can generate such warnings by defining a Lisp function and I'm toying with trying to trigger the warning and it appears Clisp compile_file ("/tmp/foo.mac"); where /tmp/foo.mac contains foo(x) := anything. But the presence of these warnings in the test suite is a bug, really best, Robert Dodier |
Mikael, If you have access to the server files, you could put in a dummy command, e.g. pValue : 1-cdf_f(Ftest, nu1, nu2); for specific values around here: This should throw the warnings at image compile time, and so not when you are trying to use a question. This will, I think, be a work-around until we can figure out a permanent fix. |
Chris, As a more complete/complex solution we could build an Maxima image generator that would call through all the functions we ever support before saving the image thus ensuring that everything the functions do to the state of the Maxima process, i.e. loading of optional deeper libraries and defining of additional functions, gets done and warnings given, before we actually start to give it stuff to process. This would have the benefit of eating up the setup time of those functions that do additional loads and definitions only at the time of first call. We would "just" need to have a list of functions and test inputs triggering all possible branches... Maxima probably has those in unit tests somewhere... (might tie in nicely with that keyval.-editor I have worked on, as it too has a need for function signatures) Taking that further the image generator could check which functions are present and if they work as expected and even patch (redefine) bad versions so that our Maxima support could cover some less than optimal releases. However, we would then just be building an unit testing system for Maxima on STACKs side with our assumptions on what Maxima should do. Naturally, such an image generator would take much longer to generate images but once generated they would probably have much better worst case performance and give no warnings about re-definitions from inside system functions. Might however increase the image size a bit and best case performance in non Pool situations might suffer. |
Thanks for the workaround, Chris! I started looking into disabling all warnings in the pre-optimized Maxima image rather than doing it for only one command at a time, but found that it seems to depend on which flavour of LISP is being used. Matti's approach is much better. Here is what I found for CLISP: I ended up not using the affected question in this year's incarnation of the course, so I didn't try any of the suggestions in the threads myself. I just include them here in case they help someone while a better solution is being worked out. |
Thanks, that is really helpful. |
Well, I guess the problem is with those functions that do definitions within themselves and thus redefine things like those stats functions tend to do on first calls. And we would need to know that those functions have this "behaviour" and ignore just those warnings. Problem is that such context awareness is difficult. Ideally, we should have white-lists of warnings but as we cannot know all the warnings that could exist in the future that would matter we would need to go for black-lists and as that leads to the context awareness issue we may need to go for something else. And that something else is to trigger the warnings before we care about warnings like in your workaround. As to In any case such an image generator would be an handy tool for MaximaPool admins and might act as and testing tool for others and I think I'll look at it at some point as I have other interests in that direction. |
Partial resolution of bug reported to mailing list 2018-02-18: "Trying to write some unit tests: how to I reliably generate a WARNING:: XXX in DEFUN?" See also: maths/moodle-qtype_stack#349 (2) Remove redundant, identical definition of FLOAT-OR-RATIONAL-P.
Partial resolution of bug reported to mailing list 2018-02-18: "Trying to write some unit tests: how to I reliably generate a WARNING:: XXX in DEFUN?" See also: maths/moodle-qtype_stack#349 (2) Remove redundant, identical definition of FLOAT-OR-RATIONAL-P.
I've just tested this on the latest dev code, and we no longer have this problem in STACK 4.0. |
Hi,
In a question, I need to compute a certain p value using the command
pValue : 1-cdf_f(Ftest, nu1, nu2);
Then my Maxima 5.41.0 with SBCL 1.4.4 spits out the warnings
WARNING: redefining MAXIMA::SIMP-UNIT-STEP in DEFUN
WARNING: redefining MAXIMA::SIMP-POCHHAMMER in DEFUN
but it nevertheless computes the asked-for p value. Now STACK interprets these warnings as a reason not to let me save the question -- instead it prints out an error message above my question variables textbox.
I ask: Can STACK be changed so that Maxima warnings are ignored, but Maxima errors are not? Or is there a simple way for me to suppress Maxima warnings for an individual quesition?
Thanks!
Mikael
The text was updated successfully, but these errors were encountered: