Skip to content

Commit b049d96

Browse files
committed
Fixing pymathics
1 parent 7a7e32c commit b049d96

4 files changed

Lines changed: 11 additions & 11 deletions

File tree

mathics/builtin/assignment.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1749,8 +1749,8 @@ def apply(self, module, evaluation):
17491749
evaluation.message(self.get_name(), 'notfound', module)
17501750
return SymbolFailed
17511751

1752-
# Add PyMathics` to $ContextPath so that when user don't
1753-
# have to qualify PyMathics variables and functions,
1752+
# Add Pymathics` to $ContextPath so that when user don't
1753+
# have to qualify Pymathics variables and functions,
17541754
# as the those in the module just loaded.
17551755
# Following the example of $ContextPath in the WL
17561756
# reference manual where PackletManager appears first in

mathics/builtin/base.py

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ def contribute(self, definitions, is_pymodule=False):
9191
name = self.get_name()
9292
options = {}
9393
option_syntax = "Warn"
94+
9495
for option, value in self.options.items():
9596
if option == "$OptionSyntax":
9697
option_syntax = value
@@ -147,7 +148,7 @@ def check_options(options_to_check, evaluation):
147148
for pattern, function in self.get_functions(is_pymodule=is_pymodule):
148149
rules.append(
149150
BuiltinRule(
150-
name, pattern, function, check_options, system=not is_pymodule
151+
name, pattern, function, check_options, system=True
151152
)
152153
)
153154
for pattern, replace in self.rules.items():
@@ -260,6 +261,7 @@ def contextify_form_name(f):
260261
pattern = Expression("Default", Symbol(name), Integer(spec))
261262
if pattern is not None:
262263
defaults.append(Rule(pattern, value, system=True))
264+
263265
definition = Definition(
264266
name=name,
265267
rules=rules,
@@ -312,11 +314,10 @@ def get_functions(self, prefix="apply", is_pymodule=False):
312314
pattern = m.group(2)
313315
else:
314316
attrs = []
315-
if is_pymodule:
316-
name = ensure_context(self.get_name(short=True), "Pymathics")
317-
else:
318-
name = self.get_name()
319-
317+
# if is_pymodule:
318+
# name = ensure_context(self.get_name(short=True), "Pymathics")
319+
# else:
320+
name = self.get_name()
320321
pattern = pattern % {"name": name}
321322
definition_class = (
322323
PyMathicsDefinitions() if is_pymodule else SystemDefinitions()

mathics/core/definitions.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,6 @@ def load_pymathics_module(self, module, remove_on_quit=True):
152152
if not var.context:
153153
var.context = "Pymathics`"
154154
symbol_name = instance.get_name()
155-
self.pymathics[symbol_name] = instance
156155
builtins_by_module[loaded_module.__name__].append(instance)
157156
newsymbols[symbol_name] = instance
158157

mathics/core/parser/util.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,12 +72,12 @@ def lookup_name(self, name):
7272
class PyMathicsDefinitions(object):
7373
"""
7474
Dummy Definitions object that puts every unqualified symbol in
75-
PyMathics`.
75+
Pymathics`.
7676
"""
7777

7878
def lookup_name(self, name):
7979
assert isinstance(name, str)
80-
context = "System`" if name in SYSTEM_LIST else "PyMathics`"
80+
context = "System`" if name in SYSTEM_LIST else "Pymathics`"
8181
# print("XXX", name, context)
8282
return ensure_context(name, context)
8383

0 commit comments

Comments
 (0)