On TimeConstrained[]
#1235
Replies: 7 comments 12 replies
-
@aravindh-krishnamoorthy To be able to correct the problems with But even informally, what steps does one have to do to see the problem? My understanding is that you were going to add a mathics-core issue or feature, right? |
Beta Was this translation helpful? Give feedback.
-
Hello @rocky ! Based on a comment from @mmatera, I think there was a previous version of |
Beta Was this translation helpful? Give feedback.
-
A summary on the current state of
Depending on how we want to go with this:
So, to summarise the requirements (from my side):
Note: IMHO, the related function |
Beta Was this translation helpful? Give feedback.
-
This was the implementation before stopit: mathics-core/mathics/builtin/datentime.py Line 1178 in b0b7efe mathics-core/mathics/core/evaluation.py Line 98 in b0b7efe Another issue with it was that long sympy evaluations were not stopped with it. |
Beta Was this translation helpful? Give feedback.
-
I think that the test case that @rocky ask for would be something like
and
With this PR glenfant/stopit#36, I get this behavior. Something that I could do is to include a subclass of |
Beta Was this translation helpful? Give feedback.
-
This is a real example from Ruby: from IntegrationUtilityFunctions.m: 2178,
This function tries to simplify an expression by first applying the |
Beta Was this translation helpful? Give feedback.
-
Recently I looked at stopit, the code we have for In short, I think one can come up with reasonable support for But it is more involved and subtle than any of the Python code I've seen so far. It will take a bit of work to get right. And right now, we still don't have good, isolated cases. The current TimeConstraint test cases aren't robust. It is a good idea to encapsulate a problem of time-constrained execution in a module such as However Testing uses the old JUnit-inspired unitest which is a little clunky and the directory organization structure is one that is no longer current practice. Nowadays tests pretty universally tests go in a test directory. If it were just this and the older pre-Python 3.8 coding style, we could live with it. But the most serious problem with the current organization is the warning that using setuptools will be soon discontinued. (Thanks, Python!) And then there is the For our purposes though, we could use some implementation changes to the Right now, the underlying model of One advantage we get from wall-time recording is that if the implementation happens to include a Another advantage is that it can reduce the excess time obtained by attempting to measure time n as the sum of n 1/n time intervals.
One of the workarounds for the fact that MS Windows does not support Lastly, I'll mention that for systems that do support |
Beta Was this translation helpful? Give feedback.
-
Nested
TimeConstrained[]
andRemainingTime[]
are crucial for Rubi and other applications. In this thread, I propose to collect: (a) the requirements for these functions, (b) some initial design ideas, and (c) why the old implementation had to be removed. The impact of future multi-threading will also need to be considered. This will help me or others implement the feature better.Beta Was this translation helpful? Give feedback.
All reactions