Skip to content

Commit

Permalink
Bump minor version number, document *_list methods
Browse files Browse the repository at this point in the history
  • Loading branch information
statusfailed committed Jun 6, 2023
1 parent 51f692d commit 0a34ba5
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 8 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[project]
name = "yarrow-diagrams"
version = "0.0.2.1"
version = "0.0.2.2"
authors = [
{ name="Paul Wilson", email="[email protected]" }
]
Expand Down
9 changes: 5 additions & 4 deletions yarrow/bipartite_multigraph.py
Original file line number Diff line number Diff line change
Expand Up @@ -178,10 +178,11 @@ def __matmul__(f, g):
return f.coproduct(g)

@classmethod
def coproduct_list(cls, Gs: 'List[BipartiteMultigraph]', wn=None, xn=None):
""" Compute the coproduct of a list of bipartite multigraphs.
Note that while this is O(n) in the sequential case, it does not enjoy
parallel speedups.
def coproduct_list(cls, Gs: 'List[AbstractBipartiteMultigraph]', wn=None, xn=None):
""" Compute the coproduct of a list of bipartite multigraphs. O(n) in the size of the result.
.. warning::
Does not speed up to O(log n) in the parallel case.
"""
if len(Gs) == 0:
assert wn is not None
Expand Down
13 changes: 11 additions & 2 deletions yarrow/diagram.py
Original file line number Diff line number Diff line change
Expand Up @@ -310,7 +310,12 @@ def __rshift__(f, g):

# TODO: IMPROVE THIS
@classmethod
def tensor_list(cls, ds: 'List[Diagram]', wn=None, xn=None):
def tensor_list(cls, ds: 'List[AbstractDiagram]', wn=None, xn=None):
""" Compute the tensor product of a list of diagrams. O(n) time in the size of the result.
.. warning::
Does not speed up to O(log n) in the parallel case
"""
if len(ds) == 0:
assert wn is not None
assert xn is not None
Expand All @@ -328,14 +333,18 @@ def tensor_operations(cls, ops: Operations):
pass # hide the docstring for now
""" Compute the X-fold tensoring of operations
.. code-block:: text
xn : X → Σ₁
whose typings are given by the segmented finite functions
.. code-block:: text
s_type : sum_{i ∈ X} arity(xn(i)) → Σ₀
t_type : sum_{i ∈ X} coarity(xn(i)) → Σ₀
(This is Proposition 4.13 in the paper)
See Proposition 4.13 in :cite:t:`dpafsd`.
"""
Fun = cls._Fun
Array = Fun._Array
Expand Down
11 changes: 10 additions & 1 deletion yarrow/finite_function.py
Original file line number Diff line number Diff line change
Expand Up @@ -276,7 +276,11 @@ def argsort(f: 'AbstractFiniteFunction'):

@classmethod
def coproduct_list(cls, fs: List['AbstractFiniteFunction'], target=None):
""" Compute the coproduct of a list of finite functions with a common target """
""" Compute the coproduct of a list of finite functions. O(n) in size of the result.
.. warning::
Does not speed up to O(log n) in the parallel case.
"""
# NOTE: this function is not parallelized!
if len(fs) == 0:
return cls.initial(0 if target is None else target)
Expand All @@ -287,6 +291,11 @@ def coproduct_list(cls, fs: List['AbstractFiniteFunction'], target=None):

@classmethod
def tensor_list(cls, fs: List['AbstractFiniteFunction']):
""" Compute the tensor product of a list of finite functions. O(n) in size of the result.
.. warning::
Does not speed up to O(log n) in the parallel case.
"""
if len(fs) == 0:
return cls.initial(0)

Expand Down

0 comments on commit 0a34ba5

Please sign in to comment.