rm CondaPkg environment

This commit is contained in:
ton
2023-04-06 13:53:47 +07:00
parent 0a57ed7884
commit c43d949309
3329 changed files with 5725 additions and 447022 deletions

View File

@@ -75,8 +75,8 @@ def not_implemented_for(*graph_types):
)
# 3-way logic: True if "directed" input, False if "undirected" input, else None
dval = ("directed" in graph_types) or not ("undirected" in graph_types) and None
mval = ("multigraph" in graph_types) or not ("graph" in graph_types) and None
dval = ("directed" in graph_types) or "undirected" not in graph_types and None
mval = ("multigraph" in graph_types) or "graph" not in graph_types and None
errmsg = f"not implemented for {' '.join(graph_types)} type"
def _not_implemented_for(g):
@@ -97,7 +97,7 @@ fopeners = {
".gzip": gzip.open,
".bz2": bz2.BZ2File,
}
_dispatch_dict = defaultdict(lambda: open, **fopeners) # type: ignore
_dispatch_dict = defaultdict(lambda: open, **fopeners)
def open_file(path_arg, mode="r"):

View File

@@ -154,12 +154,12 @@ class MappedQueue:
def __init__(self, data=None):
"""Priority queue class with updatable priorities."""
if data is None:
self.heap = list()
self.heap = []
elif isinstance(data, dict):
self.heap = [_HeapElement(v, k) for k, v in data.items()]
else:
self.heap = list(data)
self.position = dict()
self.position = {}
self._heapify()
def _heapify(self):

View File

@@ -135,7 +135,7 @@ def connected_cuthill_mckee_ordering(G, heuristic=None):
while queue:
parent = queue.popleft()
yield parent
nd = sorted(list(G.degree(set(G[parent]) - visited)), key=itemgetter(1))
nd = sorted(G.degree(set(G[parent]) - visited), key=itemgetter(1))
children = [n for n, d in nd]
visited.update(children)
queue.extend(children)

View File

@@ -217,9 +217,7 @@ class TestRandomState:
@py_random_state(1)
def instantiate_py_random_state(self, random_state):
assert isinstance(random_state, random.Random) or isinstance(
random_state, PythonRandomInterface
)
assert isinstance(random_state, (random.Random, PythonRandomInterface))
return random_state.random()
def test_random_state_None(self):

View File

@@ -83,7 +83,7 @@ class UnionFind:
"""
# Ensure fully pruned paths
for x in self.parents.keys():
for x in self.parents:
_ = self[x] # Evaluated for side-effect only
yield from groups(self.parents).values()