Skip to content

Commit 5a29934

Browse files
committed
change imports track Mathics3 changes
Overall, modularity is better in Mathics3 so we don't have to import pattern_object inside methods anymore.
1 parent 3d59f5e commit 5a29934

File tree

2 files changed

+3
-7
lines changed

2 files changed

+3
-7
lines changed

pymathics/graph/base.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@
1515
from mathics.core.convert.expression import ListExpression, from_python, to_mathics_list
1616
from mathics.core.element import BaseElement
1717
from mathics.core.expression import Expression
18+
from mathics.core.pattern import pattern_objects
1819
from mathics.core.symbols import Symbol, SymbolList, SymbolTrue
1920
from mathics.core.systemsymbols import (
2021
SymbolBlank,
@@ -853,7 +854,6 @@ class AdjacencyList(_NetworkXBuiltin):
853854
summary_text = "list the adjacent vertices"
854855

855856
def _retrieve(self, graph, what, neighbors, expression, evaluation):
856-
from mathics.builtin import pattern_objects
857857

858858
if what.get_head_name() in pattern_objects:
859859
collected = set()
@@ -1426,7 +1426,6 @@ def eval(self, graph, what, expression, evaluation, options) -> Optional[Graph]:
14261426
"VertexDelete[graph_, what_, OptionsPattern[VertexDelete]]"
14271427
graph = self._build_graph(graph, evaluation, options, expression)
14281428
if graph:
1429-
from mathics.builtin import pattern_objects
14301429

14311430
head_name = what.get_head_name()
14321431
if head_name in pattern_objects:
@@ -1567,7 +1566,6 @@ def eval(self, graph, what, expression, evaluation, options) -> Optional[Graph]:
15671566
"EdgeDelete[graph_, what_, OptionsPattern[EdgeDelete]]"
15681567
graph = self._build_graph(graph, evaluation, options, expression)
15691568
if graph:
1570-
from mathics.builtin import pattern_objects
15711569

15721570
head_name = what.get_head_name()
15731571
if head_name in pattern_objects:

test/consistency-and-style/test_summary_text.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import pytest
88

99
from pymathics.graph import __file__ as module_initfile_path
10-
from mathics.builtin import name_is_builtin_symbol
10+
from mathics.core.load_builtin import name_is_builtin_symbol
1111
from mathics.builtin.base import Builtin
1212
from mathics.doc.common_doc import skip_doc
1313

@@ -70,8 +70,7 @@
7070
module_subdirs = tuple()
7171

7272
__py_files__ = [
73-
osp.basename(f[0:-3])
74-
for f in glob.glob(osp.join(module_path, "[a-z]*.py"))
73+
osp.basename(f[0:-3]) for f in glob.glob(osp.join(module_path, "[a-z]*.py"))
7574
]
7675

7776

@@ -124,7 +123,6 @@ def check_grammar(text: str):
124123
return False
125124

126125

127-
128126
def check_well_formatted_docstring(docstr: str, instance: Builtin, module_name: str):
129127
assert (
130128
docstr.count("<dl>") >= 1

0 commit comments

Comments
 (0)