Skip to content

Commit 712337b

Browse files
authored
fixing check manifest (#1142)
This PR just fixes and reinstall the SYMBOL_MANIFEST consistency check, to avoid erase/ duplicate symbols.
1 parent e7ca026 commit 712337b

6 files changed

Lines changed: 39 additions & 66 deletions

File tree

.github/workflows/consistency-checks.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,3 +35,4 @@ jobs:
3535
- name: Test Mathics Consistency and Style
3636
run: |
3737
make check-consistency-and-style
38+
make check-builtin-manifest

SYMBOLS_MANIFEST.txt

Lines changed: 26 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
CombinatoricaOld`BinarySearch
21
HTML`DataImport
32
HTML`FullDataImport
43
HTML`HyperlinksImport
@@ -40,6 +39,7 @@ System`$Machine
4039
System`$MachineEpsilon
4140
System`$MachineName
4241
System`$MachinePrecision
42+
System`$MaxLengthIntStringConversion
4343
System`$MaxMachineNumber
4444
System`$MaxPrecision
4545
System`$MinMachineNumber
@@ -105,7 +105,6 @@ System`Apart
105105
System`Append
106106
System`AppendTo
107107
System`Apply
108-
System`ApplyLevel
109108
System`ArcCos
110109
System`ArcCosh
111110
System`ArcCot
@@ -134,10 +133,12 @@ System`Attributes
134133
System`Automatic
135134
System`Axes
136135
System`Axis
136+
System`Background
137137
System`BarChart
138138
System`BaseForm
139139
System`Begin
140140
System`BeginPackage
141+
System`BellB
141142
System`BernoulliB
142143
System`BernsteinBasis
143144
System`BesselI
@@ -197,6 +198,7 @@ System`ChartLegends
197198
System`ChebyshevT
198199
System`ChebyshevU
199200
System`Check
201+
System`CheckAbort
200202
System`ChessboardDistance
201203
System`Chop
202204
System`Circle
@@ -238,6 +240,7 @@ System`ConditionalExpression
238240
System`Cone
239241
System`Cone3DBox
240242
System`Conjugate
243+
System`ConjugateTranspose
241244
System`Constant
242245
System`ConstantArray
243246
System`ContainsOnly
@@ -322,6 +325,8 @@ System`Dispatch
322325
System`Divide
323326
System`DivideBy
324327
System`Divisible
328+
System`DivisorSigma
329+
System`DivisorSum
325330
System`Divisors
326331
System`Do
327332
System`Dodecahedron
@@ -355,12 +360,14 @@ System`Erf
355360
System`Erfc
356361
System`Erosion
357362
System`EuclideanDistance
363+
System`EulerE
358364
System`EulerGamma
359365
System`EulerPhi
360366
System`Evaluate
361367
System`EvenQ
362368
System`ExactNumberQ
363369
System`Except
370+
System`Exit
364371
System`Exp
365372
System`ExpIntegralE
366373
System`ExpIntegralEi
@@ -526,6 +533,8 @@ System`Integer
526533
System`IntegerDigits
527534
System`IntegerExponent
528535
System`IntegerLength
536+
System`IntegerPart
537+
System`IntegerPartitions
529538
System`IntegerQ
530539
System`IntegerReverse
531540
System`IntegerString
@@ -543,6 +552,7 @@ System`InverseGudermannian
543552
System`InverseHaversine
544553
System`JaccardDissimilarity
545554
System`JacobiP
555+
System`JacobiSymbol
546556
System`Join
547557
System`Joined
548558
System`KelvinBei
@@ -554,6 +564,7 @@ System`Keys
554564
System`Khinchin
555565
System`KnownUnitQ
556566
System`KroneckerProduct
567+
System`KroneckerSymbol
557568
System`Kurtosis
558569
System`LABColor
559570
System`LCHColor
@@ -574,9 +585,9 @@ System`LessEqual
574585
System`LetterCharacter
575586
System`LetterNumber
576587
System`LetterQ
577-
System`LeviCivitaTensor
578588
System`Level
579589
System`LevelQ
590+
System`LeviCivitaTensor
580591
System`LightBlue
581592
System`LightBrown
582593
System`LightCyan
@@ -600,6 +611,7 @@ System`ListLinePlot
600611
System`ListLogPlot
601612
System`ListPlot
602613
System`ListQ
614+
System`ListStepPlot
603615
System`Listable
604616
System`LoadModule
605617
System`Locked
@@ -612,13 +624,15 @@ System`LogisticSigmoid
612624
System`Longest
613625
System`Lookup
614626
System`LowerCaseQ
627+
System`LucasL
615628
System`MachineNumberQ
616629
System`MachinePrecision
617630
System`Magenta
618631
System`MakeBoxes
619632
System`ManhattanDistance
620633
System`MantissaExponent
621634
System`Map
635+
System`MapApply
622636
System`MapAt
623637
System`MapIndexed
624638
System`MapThread
@@ -642,6 +656,7 @@ System`Medium
642656
System`MemberQ
643657
System`MemoryAvailable
644658
System`MemoryInUse
659+
System`MersennePrimeExponent
645660
System`Mesh
646661
System`Message
647662
System`MessageName
@@ -655,6 +670,7 @@ System`Missing
655670
System`Mod
656671
System`ModularInverse
657672
System`Module
673+
System`MoebiusMu
658674
System`MorphologicalComponents
659675
System`Most
660676
System`Multinomial
@@ -760,6 +776,7 @@ System`PolyGamma
760776
System`Polygon
761777
System`Polygon3DBox
762778
System`PolygonBox
779+
System`PolygonalNumber
763780
System`PolynomialQ
764781
System`Position
765782
System`Positive
@@ -768,6 +785,7 @@ System`Postfix
768785
System`Power
769786
System`PowerExpand
770787
System`PowerMod
788+
System`PowersRepresentations
771789
System`PreDecrement
772790
System`PreIncrement
773791
System`Precedence
@@ -793,6 +811,7 @@ System`PseudoInverse
793811
System`Purple
794812
System`Put
795813
System`PutAppend
814+
System`PythonCProfileEvaluation
796815
System`PythonForm
797816
System`QRDecomposition
798817
System`Quantile
@@ -827,8 +846,8 @@ System`ReadProtected
827846
System`Real
828847
System`RealAbs
829848
System`RealDigits
830-
System`RealNumberQ
831849
System`RealSign
850+
System`RealValuedNumberQ
832851
System`Reals
833852
System`Reap
834853
System`Record
@@ -855,6 +874,7 @@ System`ResetDirectory
855874
System`Rest
856875
System`Return
857876
System`Reverse
877+
System`ReverseSort
858878
System`Riffle
859879
System`Right
860880
System`RogersTanimotoDissimilarity
@@ -886,6 +906,7 @@ System`Set
886906
System`SetAttributes
887907
System`SetDelayed
888908
System`SetDirectory
909+
System`SetEnvironment
889910
System`SetFileDate
890911
System`SetOptions
891912
System`SetStreamPosition
@@ -925,6 +946,7 @@ System`SplitBy
925946
System`Sqrt
926947
System`SqrtBox
927948
System`SquaredEuclideanDistance
949+
System`SquaresR
928950
System`StandardDeviation
929951
System`StandardForm
930952
System`StartOfLine

admin-tools/build_and_check_manifest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
from mathics.core.builtin import Builtin
66
from mathics.core.load_builtin import (
77
import_and_load_builtins,
8-
modules,
8+
mathics3_builtins_modules,
99
name_is_builtin_symbol,
1010
)
1111

@@ -15,7 +15,7 @@
1515
def generate_available_builtins_names():
1616
msg = ""
1717
builtins_by_name = {}
18-
for module in modules:
18+
for module in mathics3_builtins_modules:
1919
vars = dir(module)
2020
for name in vars:
2121
var = name_is_builtin_symbol(module, name)

mathics/builtin/atomic/strings.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -411,14 +411,16 @@ class HexadecimalCharacter(Builtin):
411411

412412
# This isn't your normal Box class. We'll keep this here rather than
413413
# in mathics.builtin.box for now.
414-
class InterpretationBox(PrefixOperator):
414+
# mmatera commenct: This does not even exist in WMA. \! should be associated
415+
# to `ToExpression`, but it was not properly implemented by now...
416+
class InterpretedBox(PrefixOperator):
415417
r"""
416418
<url>
417419
:WMA link:
418420
https://reference.wolfram.com/language/ref/InterpretationBox.html</url>
419421
420422
<dl>
421-
<dt>'InterpretationBox[$box$]'
423+
<dt>'InterpretedBox[$box$]'
422424
<dd>is the ad hoc fullform for \! $box$. just for internal use...
423425
</dl>
424426
@@ -430,7 +432,7 @@ class InterpretationBox(PrefixOperator):
430432
summary_text = "interpret boxes as an expression"
431433

432434
def eval(self, boxes, evaluation: Evaluation):
433-
"""InterpretationBox[boxes_]"""
435+
"""InterpretedBox[boxes_]"""
434436
# TODO: the following is a very raw and dummy way to
435437
# handle these expressions.
436438
# In the first place, this should handle different kind

mathics/builtin/files_io/filesystem.py

Lines changed: 0 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -346,63 +346,6 @@ def eval(self, evaluation: Evaluation):
346346
return String(result)
347347

348348

349-
class DirectoryName(Builtin):
350-
"""
351-
<url>:WMA link:https://reference.wolfram.com/language/ref/DirectoryName.html</url>
352-
353-
<dl>
354-
<dt>'DirectoryName["$name$"]'
355-
<dd>extracts the directory name from a filename.
356-
</dl>
357-
358-
>> DirectoryName["a/b/c"]
359-
= a/b
360-
361-
>> DirectoryName["a/b/c", 2]
362-
= a
363-
"""
364-
365-
messages = {
366-
"string": "String expected at position 1 in `1`.",
367-
"intpm": ("Positive machine-sized integer expected at " "position 2 in `1`."),
368-
}
369-
370-
options = {
371-
"OperatingSystem": "$OperatingSystem",
372-
}
373-
summary_text = "directory part of a filename"
374-
375-
def eval_with_n(self, name, n, evaluation: Evaluation, options: dict):
376-
"DirectoryName[name_, n_, OptionsPattern[DirectoryName]]"
377-
378-
if n is None:
379-
expr = to_expression("DirectoryName", name)
380-
py_n = 1
381-
else:
382-
expr = to_expression("DirectoryName", name, n)
383-
py_n = n.to_python()
384-
385-
if not (isinstance(py_n, int) and py_n > 0):
386-
evaluation.message("DirectoryName", "intpm", expr)
387-
return
388-
389-
py_name = name.to_python()
390-
if not (isinstance(py_name, str) and py_name[0] == py_name[-1] == '"'):
391-
evaluation.message("DirectoryName", "string", expr)
392-
return
393-
py_name = py_name[1:-1]
394-
395-
result = py_name
396-
for i in range(py_n):
397-
(result, tmp) = osp.split(result)
398-
399-
return String(result)
400-
401-
def eval(self, name, evaluation: Evaluation, options: dict):
402-
"DirectoryName[name_, OptionsPattern[DirectoryName]]"
403-
return self.eval_with_n(name, None, evaluation, options)
404-
405-
406349
class DirectoryStack(Builtin):
407350
"""
408351
<url>:WMA link:https://reference.wolfram.com/language/ref/DirectoryStack.html</url>

mathics/builtin/numbers/constants.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -756,3 +756,8 @@ class Underflow(Builtin):
756756
instance = cls(expression=False)
757757
val = instance.get_constant()
758758
NUMERICAL_CONSTANTS[instance.symbol] = MachineReal(val.value)
759+
760+
# Remove these variables to prevent errors in the SYMBOL_MANIFEST check.
761+
del cls
762+
del instance
763+
del val

0 commit comments

Comments
 (0)