diff --git a/mathics/builtin/base.py b/mathics/builtin/base.py index ac3f1e1b7..4a21365a2 100644 --- a/mathics/builtin/base.py +++ b/mathics/builtin/base.py @@ -238,7 +238,6 @@ def eval_with_options(x, evaluation: Evaluation, options: dict): name: Optional[str] = None context: str = "" - abstract: bool = False attributes: int = A_PROTECTED is_numeric: bool = False rules: Dict[str, Any] = {} diff --git a/mathics/builtin/datentime.py b/mathics/builtin/datentime.py index 9221c3b4f..c2b64ce18 100644 --- a/mathics/builtin/datentime.py +++ b/mathics/builtin/datentime.py @@ -5,7 +5,8 @@ Dates and times are represented symbolically; computations can be performed on them. -Date object can also input and output dates and times in a wide range of formats, as well as handle calendars. +Date object can also input and output dates and times in a wide range of formats, as \ +well as handle calendars. """ import re @@ -259,7 +260,6 @@ def to_datelist(self, epochtime, evaluation): (isinstance(val, float) and i > 1) or isinstance(val, int) for i, val in enumerate(etime) ): - default_date = [1900, 1, 1, 0, 0, 0.0] datelist = etime + default_date[len(etime) :] prec_part, imprec_part = datelist[:2], datelist[2:] @@ -348,7 +348,8 @@ class AbsoluteTime(_DateFormat):
'AbsoluteTime[]' -
gives the local time in seconds since epoch January 1, 1900, in your time zone. +
gives the local time in seconds since epoch January 1, 1900, in your \ + time zone.
'AbsoluteTime[{$y$, $m$, $d$, $h$, $m$, $s$}]'
gives the absolute time specification corresponding to a date list. @@ -380,9 +381,7 @@ class AbsoluteTime(_DateFormat): = 1000 """ - abstract = "absolute time in seconds" - - summary_text = "absolute time in seconds" + summary_text = "get absolute time in seconds" def eval_now(self, evaluation): "AbsoluteTime[]" @@ -410,7 +409,8 @@ class AbsoluteTiming(Builtin):
'AbsoluteTiming[$expr$]' -
evaluates $expr$, returning a list of the absolute number of seconds in real time that have elapsed, together with the result obtained. +
evaluates $expr$, returning a list of the absolute number of seconds in \ + real time that have elapsed, together with the result obtained.
>> AbsoluteTiming[50!] @@ -421,7 +421,7 @@ class AbsoluteTiming(Builtin): attributes = A_HOLD_ALL | A_PROTECTED - summary_text = "total wall-clock time to run a Mathics command" + summary_text = "get total wall-clock time to run a Mathics command" def eval(self, expr, evaluation): "AbsoluteTiming[expr_]" @@ -612,7 +612,9 @@ class DateObject(_DateFormat, ImmutableValueMixin): ] messages = { - "notz": "Argument `1` in DateObject is not a recognized TimeZone specification.", + "notz": ( + "Argument `1` in DateObject is not a recognized " "TimeZone specification." + ), } options = { @@ -625,9 +627,7 @@ class DateObject(_DateFormat, ImmutableValueMixin): "DateObject[]": "DateObject[AbsoluteTime[]]", } - summary_text = ( - " an object representing a date of any granularity (year, hour, instant, ...)" - ) + summary_text = "get an object representing a date (year, hour, instant, ...)" def eval_any(self, args, evaluation: Evaluation, options: dict): "DateObject[args_, OptionsPattern[]]" @@ -779,7 +779,6 @@ def eval(self, date, off, evaluation): and isinstance(o[0], (float, int)) for o in pyoff ): - for o in pyoff: idate.addself([o[0] * TIME_INCREMENTS[o[1]][i] for i in range(6)]) else: @@ -987,7 +986,7 @@ class DateStringFormat(Predefined):
'$DateStringFormat' -
gives the format used for dates generated by 'DateString'. +
get the format used for dates generated by 'DateString'.
>> $DateStringFormat @@ -998,7 +997,7 @@ class DateStringFormat(Predefined): value = "DateTimeShort" - summary_text = "default date string format" + summary_text = "get default date string format as a list" # TODO: Methods to change this @@ -1091,7 +1090,8 @@ class SystemTimeZone(Predefined):
'$SystemTimeZone' -
gives the current time zone for the computer system on which Mathics is being run. +
gives the current time zone for the computer system on which Mathics is \ + being run.
>> $SystemTimeZone @@ -1101,7 +1101,7 @@ class SystemTimeZone(Predefined): name = "$SystemTimeZone" value = Real(-time.timezone / 3600.0) - summary_text = "time zone used by your system" + summary_text = "get the time zone used by your system" def evaluate(self, evaluation): return self.value @@ -1120,7 +1120,7 @@ class Now(Predefined): = ... """ - summary_text = "current date and time" + summary_text = "get current date and time" def evaluate(self, evaluation): return Expression(SymbolDateObject.evaluate(evaluation)) @@ -1142,9 +1142,9 @@ class TimeConstrained(Builtin): Possible issues: for certain time-consuming functions (like simplify) which are based on sympy or other libraries, it is possible that - the evaluation continues after the timeout. However, at the end of the evaluation, the function will return '$Aborted' and the results will not affect - the state of the \\Mathics kernel. - + the evaluation continues after the timeout. However, at the end of the \ + evaluation, the function will return '$Aborted' and the results will not affect + the state of the Mathics3 kernel. """ # FIXME: these tests sometimes cause SEGVs which probably means @@ -1166,7 +1166,10 @@ class TimeConstrained(Builtin): attributes = A_HOLD_ALL | A_PROTECTED messages = { - "timc": "Number of seconds `1` is not a positive machine-sized number or Infinity.", + "timc": ( + "Number of seconds `1` is not a positive machine-sized number " + "or Infinity." + ), } summary_text = "run a command for at most a specified time" @@ -1219,7 +1222,7 @@ class TimeZone(Predefined): "$TimeZone": str(value), } - summary_text = "resettable default time zone" + summary_text = "gets the default time zone" def eval(self, lhs, rhs, evaluation): "lhs_ = rhs_" @@ -1245,7 +1248,7 @@ class TimeUsed(Builtin): """ summary_text = ( - "the total number of seconds of CPU time in the current Mathics session" + "get the total number of seconds of CPU time in the current Mathics3 session" ) def eval(self, evaluation): @@ -1274,7 +1277,7 @@ class Timing(Builtin): attributes = A_HOLD_ALL | A_PROTECTED - summary_text = "CPU time to run a Mathics command" + summary_text = "get CPU time to run a Mathics3 command" def eval(self, expr, evaluation): "Timing[expr_]" @@ -1301,7 +1304,7 @@ class SessionTime(Builtin): """ summary_text = ( - "total elapsed time in seconds since the beginning of your Mathics session" + "get total elapsed time in seconds since the beginning of Mathics3 session" ) def eval(self, evaluation): @@ -1317,7 +1320,8 @@ class TimeRemaining(Builtin):
'TimeRemaining[]' -
Gives the number of seconds remaining until the earliest enclosing 'TimeConstrained' will request the current computation to stop. +
Gives the number of seconds remaining until the earliest enclosing \ + 'TimeConstrained' will request the current computation to stop.
'TimeConstrained[$expr$, $t$, $failexpr$]'
returns $failexpr$ if the time constraint is not met. @@ -1332,7 +1336,7 @@ class TimeRemaining(Builtin): """ - summary_text = "time before a time constraint in a running program" + summary_text = "get remaining time in allowed to run an expression" def eval(self, evaluation): "TimeRemaining[]"