Skip to content

Commit 037b10a

Browse files
authored
Update docs (#590)
1 parent fec5fd6 commit 037b10a

File tree

8 files changed

+49
-26
lines changed

8 files changed

+49
-26
lines changed

.readthedocs.yaml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# See https://docs.readthedocs.io/en/stable/config-file/v2.html for details
2+
version: 2
3+
build:
4+
os: ubuntu-22.04
5+
tools:
6+
python: "3.12"
7+
8+
sphinx:
9+
configuration: doc/source/conf.py
10+
# Temporarily turning off to get docs build passing
11+
# fail_on_warning: true
12+
13+
python:
14+
install:
15+
- requirements: doc/requirements.txt
16+
- method: pip
17+
path: .

doc/requirements.txt

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
sphinx
2+
furo

doc/source/conf.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@
9393

9494
# The theme to use for HTML and HTML Help pages. See the documentation for
9595
# a list of builtin themes.
96-
html_theme = 'default'
96+
html_theme = 'furo'
9797

9898
# Theme options are theme-specific and customize the look and feel of a theme
9999
# further. For a list of options available for each theme, see the
@@ -105,7 +105,7 @@
105105

106106
# The name for this set of Sphinx documents. If None, it defaults to
107107
# "<project> v<release> documentation".
108-
#html_title = None
108+
html_title = "Toolz"
109109

110110
# A shorter title for the navigation bar. Default is the same as html_title.
111111
#html_short_title = None

doc/source/heritage.rst

+14-18
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@ Heritage
22
========
33

44
While Python was originally intended as an imperative language
5-
[Guido_], it contains all elements necessary to support a rich set of features
5+
[`Guido`_], it contains all elements necessary to support a rich set of features
66
from the functional paradigm. In particular its core data structures, lazy
77
iterators, and functions as first class objects can be combined to implement a
88
common standard library of functions shared among many functional languages.
99

1010
This was first recognized and supported through the standard libraries
11-
itertools_ and functools_ which contain functions like ``permutations``,
11+
itertools_ and `functools`_ which contain functions like ``permutations``,
1212
``chain`` and ``partial`` to complement the standard ``map``, ``filter``,
1313
``reduce`` already found in the core language. While these libraries contain
1414
substantial functionality they do not achieve the same level of adoption found
@@ -17,35 +17,31 @@ incomplete and lack a number of commonly related functions like ``compose`` and
1717
``groupby`` which often complement these core operations.
1818

1919
A completion of this set of functions was first attempted in the projects
20-
itertoolz_ and functoolz_ (note the z). These libraries contained
21-
several functions that were absent in the standard itertools_/functools_
20+
`itertoolz`_ and `functoolz`_ (note the z). These libraries contained
21+
several functions that were absent in the standard itertools_ / `functools`_
2222
libraries. The ``itertoolz``/``functoolz`` libraries were eventually merged
2323
into the monolithic ``toolz`` project described here.
2424

2525
Most contemporary functional languages (Haskell, Scala, Clojure, ...) contain
2626
some variation of the functions found in ``toolz``. The ``toolz`` project
2727
generally adheres closely to the API found in the Clojure standard library (see
28-
cheatsheet_) and where disagreements occur that API usually dominates. The
28+
`cheatsheet`_) and where disagreements occur that API usually dominates. The
2929
``toolz`` API is also strongly affected by the principles of the Python
3030
language itself, and often makes deviations in order to be more approachable to
3131
that community.
3232

3333
The development of a functional standard library within a popular imperative
3434
language is not unique. Similar projects have arisen in other
3535
imperative-by-design languages that contain the necessary elements to support a
36-
functional standard library. Underscore.js_ in JavaScript has attained
36+
functional standard library. `Underscore.js <https://underscorejs.org>`_ in JavaScript has attained
3737
notable popularity in the web community. ``LINQ`` in C# follows a similar
3838
philosophy but mimics declarative database languages rather than functional
39-
ones. Enumerable_ is is the closest project in Ruby. Other excellent projects
40-
also exist within the Python ecosystem, most notably Fn.py_ and Funcy_.
39+
ones. `Enumerable <https://ruby-doc.org/core-2.0.0/Enumerable.html>`_ is is the closest project in Ruby. Other excellent projects
40+
also exist within the Python ecosystem, most notably `Fn.py <https://github.com/kachayev/fn.py>`_ and `Funcy <https://github.com/suor/funcy/>`_.
4141

42-
.. [itertools] https://docs.python.org/2/library/itertools.html
43-
.. [functools] https://docs.python.org/2/library/functools.html
44-
.. [itertoolz] https://github.com/mrocklin/itertoolz
45-
.. [functoolz] https://github.com/mrocklin/functoolz
46-
.. [Underscore.js] https://underscorejs.org
47-
.. [cheatsheet] https://clojure.org/cheatsheet
48-
.. [Guido] https://python-history.blogspot.com/2009/04/origins-of-pythons-functional-features.html
49-
.. [Enumerable] https://ruby-doc.org/core-2.0.0/Enumerable.html
50-
.. [funcy] https://github.com/suor/funcy/
51-
.. [fn.py] https://github.com/kachayev/fn.py
42+
.. _itertools: https://docs.python.org/library/itertools.html
43+
.. _functools: https://docs.python.org/library/functools.html
44+
.. _itertoolz: https://github.com/mrocklin/itertoolz
45+
.. _functoolz: https://github.com/mrocklin/functoolz
46+
.. _cheatsheet: https://clojure.org/cheatsheet
47+
.. _Guido: https://python-history.blogspot.com/2009/04/origins-of-pythons-functional-features.html

doc/source/install.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,4 +11,4 @@ three ways:
1111

1212
1. Toolz is pure Python
1313
2. Toolz relies only on the standard library
14-
3. Toolz simultaneously supports Python versions 3.5+ and PyPy
14+
3. Toolz simultaneously supports Python versions 3.8+ and PyPy

doc/source/laziness.rst

+4-5
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ memory. They act like lists but don't take up space.
99
Example - A Tale of Two Cities
1010
------------------------------
1111

12-
We open a file containing the text of the classic text "A Tale of Two Cities"
13-
by Charles Dickens[1_].
12+
We open `a file <http://www.gutenberg.org/cache/epub/98/pg98.txt>`_ containing
13+
the text of the classic text "A Tale of Two Cities"
14+
by Charles Dickens.
1415

1516
.. code::
1617
@@ -98,6 +99,4 @@ In this case ``frequencies`` is a sort of reduction. At no time were more than
9899
a few hundred bytes of Tale of Two Cities necessarily in memory. We could just
99100
have easily done this computation on the entire Gutenberg collection or on
100101
Wikipedia. In this case we are limited by the size and speed of our hard drive
101-
and not by the capacity of our memory.
102-
103-
.. [1] http://www.gutenberg.org/cache/epub/98/pg98.txt
102+
and not by the capacity of our memory.

toolz/itertoolz.py

+1
Original file line numberDiff line numberDiff line change
@@ -817,6 +817,7 @@ def join(leftkey, leftseq, rightkey, rightseq,
817817
This is a semi-streaming operation. The LEFT sequence is fully evaluated
818818
and placed into memory. The RIGHT sequence is evaluated lazily and so can
819819
be arbitrarily large.
820+
820821
(Note: If right_default is defined, then unique keys of rightseq
821822
will also be stored in memory.)
822823

toolz/sandbox/parallel.py

+8
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,18 @@ def fold(binop, seq, default=no_default, map=map, chunksize=128, combine=None):
1414
"""
1515
Reduce without guarantee of ordered reduction.
1616
17+
Parameters
18+
----------
19+
binops
20+
Associative operator. The associative property allows us to
21+
leverage a parallel map to perform reductions in parallel.
22+
23+
1724
inputs:
1825
1926
``binop`` - associative operator. The associative property allows us to
2027
leverage a parallel map to perform reductions in parallel.
28+
2129
``seq`` - a sequence to be aggregated
2230
``default`` - an identity element like 0 for ``add`` or 1 for mul
2331

0 commit comments

Comments
 (0)