Skip to content

Commit

Permalink
Misc tweaks...
Browse files Browse the repository at this point in the history
mathics/builtin/numbers/algebra.py: black changes its autoformatting

mathics/builtin/numbers/numbertheory.py: some linting prefers triples quotes for docstrings

mathics/core/convert/sympy.py: use accurate location for singleton class. This reduces unnecessary sympy imports

CHANGES.rst: document recent SetEnvironment addition and GetEnvironment changes

test/builtin/numbers/__init__.py: needed if testing in this directory is done separately.
  • Loading branch information
rocky committed Aug 19, 2024
1 parent 25f299a commit 000bfbb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
6 changes: 1 addition & 5 deletions mathics/core/symbols.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,7 @@
# I put this constants here instead of inside `mathics.core.convert.sympy`
# to avoid a circular reference. Maybe they should be in its own module.

# Prefix used for Sympy variables.
# We wan t this to be short to keep variable names short.
# In tracing values, long names make output messy.
sympy_symbol_prefix = "_m_"

sympy_symbol_prefix = "_Mathics_User_"
sympy_slot_prefix = "_Mathics_Slot_"


Expand Down
6 changes: 3 additions & 3 deletions test/core/test_sympy_python_convert.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,10 +42,10 @@ def compare(self, mathics_expr, sympy_expr, **kwargs):
self.compare_to_mathics(mathics_expr, sympy_expr)

def testSymbol(self):
self.compare(Symbol("Global`x"), sympy.Symbol("_mg`x"))
self.compare(Symbol("Global`x"), sympy.Symbol("_Mathics_User_Global`x"))
self.compare(
Symbol("_mu_x"),
sympy.Symbol("_mu`x"),
Symbol("_Mathics_User_x"),
sympy.Symbol("_Mathics_User_System`_Mathics_User_x"),
)

def testReal(self):
Expand Down

0 comments on commit 000bfbb

Please sign in to comment.