-
-
Notifications
You must be signed in to change notification settings - Fork 491
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
interactive_simplex_method: Enable typesetting of run_simplex_method in SageMathCloud #18852
Comments
screen shot - interactive simplex in SageMathCloud |
This comment has been minimized.
This comment has been minimized.
comment:1
Attachment: Screen Shot 2015-07-05 at 7.26.06 PM.png |
comment:2
Please don't make rush changes here - it was a lot of pain to make things work in SageNB and SageTeX. The name also may not be fitting if it was just printing something. Note that it does not return just a string - it returns a Although there are problems because of the long LaTeX code - I had to increase limits on the size of expressions handled by SMC. So there may be some sense in showing steps as separate formulas in |
comment:3
Thanks a lot for your comments! |
comment:4
I've opened sagemathinc/cocalc#40 |
comment:5
Replying to @novoselt:
I guess showing the steps as separate formulas would also allow to show a plot after each update step (if the user requests that), showing the current basic solution... |
Dependencies: #18292 |
comment:6
Once we have html blocks implemented,
|
comment:7
This sounds like a plan, though I must say that I don't understand the output model of Sage. I know that run_simplex_method stores the final dictionary in an attribute; but suppose it would have to be a return value instead. If the function wants to print its progress (sequence of dictionaries) on the screen AND return a value, would it then have to return two values: (1) the HTMLFragment and (2) the dictionary? |
comment:8
It is usually a bad idea to output "the progress": you can't be sure how output is handled and there will be no way to catch this output for further processing. |
comment:9
Well, it's called logging, and python has a somewhat sophisticated facility for this. Without using the logging facility, one could simply pass a callback function to a productive function such as run_simplex_method that is called when there is something to be output. |
comment:10
Logging and output are quite orthogonal, I would say. I am also not aware of many (if any) functions in Sage that use callbacks apart from "infrastructure". And there is certainly no need for them in this module. |
comment:11
OK, we'll just wait for #18292 |
comment:12
The new output code of #19097 is a better approach. This ticket can be closed. |
I tried to use interactive_simplex_method in SageMathCloud, and it seems the current model of
InteractiveLPProblemStandardForm.run_simplex_method
andLPDictionary.ELLUL
to return a string of LaTeX code is not a good fit. (See screenshot.)I propose to change these methods so they just call
pretty_print
repeatedly and return nothing. An optional keyword argument, show=False, would turn off output. This is used when, for example,run_simplex_method
is called byfinal_dictionary
.Depends on #18292
Depends on #19097
CC: @novoselt @nathanncohen
Component: numerical
Issue created by migration from https://trac.sagemath.org/ticket/18852
The text was updated successfully, but these errors were encountered: