Skip to content

Commit

Permalink
Update docs for pre-release install
Browse files Browse the repository at this point in the history
  • Loading branch information
dbrattli committed Mar 5, 2022
1 parent 7e765eb commit 562a79c
Show file tree
Hide file tree
Showing 5 changed files with 71 additions and 71 deletions.
2 changes: 1 addition & 1 deletion .pre-commit-config.yaml
Expand Up @@ -26,7 +26,7 @@ repos:
language: node
pass_filenames: false
types: [python]
additional_dependencies: ["pyright@1.1.226"]
additional_dependencies: ["pyright@1.1.227"]
repo: local
- hooks:
- id: mypy
Expand Down
20 changes: 6 additions & 14 deletions README.rst
Expand Up @@ -33,7 +33,7 @@ install:

.. code:: console
pip3 install reactivex
pip3 install reactivex --pre
About ReactiveX
Expand Down Expand Up @@ -77,17 +77,9 @@ There is also a list of third party documentation available `here
Community
----------

Join the conversation on Slack!

The gracious folks at `PySlackers <https://pyslackers.com/>`_ have given us a home
in the `#rxpy <https://pythondev.slack.com/messages/rxpy>`_ Slack channel. Please
join us there for questions, conversations, and all things related to RxPY.

To join, navigate the page above to receive an email invite. After signing up,
join us in the #rxpy channel.

Please follow the community guidelines and terms of service.

Join the conversation on GitHub `Discussions
<https://github.com/ReactiveX/RxPY/discussions>`_! if you have any questions or
suggestions.

Differences from .NET and RxJS
------------------------------
Expand All @@ -100,8 +92,8 @@ is mostly a direct port of RxJS, but also borrows a bit from Rx.NET and RxJava i
terms of threading and blocking operators.

ReactiveX for Python follows `PEP 8 <http://legacy.python.org/dev/peps/pep-0008/>`_, so
all function and method names are lowercase with words separated by underscores as
necessary to improve readability.
all function and method names are ``snake_cased`` i.e lowercase with words separated by
underscores as necessary to improve readability.

Thus .NET code such as:

Expand Down
2 changes: 1 addition & 1 deletion authors.txt
@@ -1,4 +1,4 @@
RxPY v3 team
ReactiveX for Python maintainers

Dag Brattli @dbrattli
Erik Kemperman, @erikkemperman
Expand Down
2 changes: 1 addition & 1 deletion docs/installation.rst
Expand Up @@ -7,7 +7,7 @@ ReactiveX for Python v4.x runs on `Python <http://www.python.org/>`__ 3. To inst

.. code:: console
pip3 install reactivex
pip3 install reactivex --pre
RxPY v3.x runs on `Python <http://www.python.org/>`__ 3. To install RxPY:

Expand Down
116 changes: 62 additions & 54 deletions notebooks/Getting Started.ipynb
Expand Up @@ -56,7 +56,7 @@
],
"source": [
"%%bash\n",
"pip install rx"
"pip install reactivex"
]
},
{
Expand All @@ -68,14 +68,15 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 7,
"metadata": {
"collapsed": true
},
"outputs": [],
"source": [
"import reactivex\n",
"from reactivex import Observable, Observer"
"from reactivex import operators as ops\n",
"from reactivex import Observer"
]
},
{
Expand All @@ -89,7 +90,7 @@
},
{
"cell_type": "code",
"execution_count": 5,
"execution_count": 23,
"metadata": {
"collapsed": false
},
Expand All @@ -113,23 +114,23 @@
}
],
"source": [
"class MyObserver(Observer):\n",
" def on_next(self, x):\n",
" print(\"Got: %s\" % x)\n",
" \n",
" def on_error(self, e):\n",
" print(\"Got error: %s\" % e)\n",
" \n",
"class MyObserver(Observer[int]):\n",
" def on_next(self, value: int):\n",
" print(\"Got: %s\" % value)\n",
"\n",
" def on_error(self, error: Exception):\n",
" print(\"Got error: %s\" % error)\n",
"\n",
" def on_completed(self):\n",
" print(\"Sequence completed\")\n",
"\n",
"xs = Observable.from_iterable(range(10))\n",
"xs = reactivex.from_iterable(range(10))\n",
"d = xs.subscribe(MyObserver())"
]
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 4,
"metadata": {
"collapsed": false
},
Expand All @@ -152,7 +153,7 @@
}
],
"source": [
"xs = Observable.from_(range(10))\n",
"xs = reactivex.from_(range(10))\n",
"d = xs.subscribe(print)"
]
},
Expand All @@ -172,7 +173,7 @@
},
{
"cell_type": "code",
"execution_count": 4,
"execution_count": 9,
"metadata": {
"collapsed": false,
"scrolled": true
Expand All @@ -191,10 +192,11 @@
}
],
"source": [
"xs = Observable.from_(range(10))\n",
"d = xs.filter(\n",
"xs = reactivex.from_(range(10))\n",
"d = xs.pipe(\n",
" ops.filter(\n",
" lambda x: x % 2\n",
" ).subscribe(print)"
" )).subscribe(print)"
]
},
{
Expand All @@ -206,7 +208,7 @@
},
{
"cell_type": "code",
"execution_count": 7,
"execution_count": 10,
"metadata": {
"collapsed": false
},
Expand All @@ -229,10 +231,11 @@
}
],
"source": [
"xs = Observable.from_(range(10))\n",
"d = xs.map(\n",
"xs = reactivex.from_(range(10))\n",
"d = xs.pipe(\n",
" ops.map(\n",
" lambda x: x * 2\n",
" ).subscribe(print)"
" )).subscribe(print)"
]
},
{
Expand All @@ -244,7 +247,7 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 12,
"metadata": {
"collapsed": false
},
Expand All @@ -262,10 +265,11 @@
}
],
"source": [
"xs = Observable.from_(range(10, 20, 2))\n",
"d = xs.map(\n",
"xs = reactivex.from_(range(10, 20, 2))\n",
"d = xs.pipe(\n",
" ops.map_indexed(\n",
" lambda x, i: \"%s: %s\" % (i, x * 2)\n",
" ).subscribe(print)"
" )).subscribe(print)"
]
},
{
Expand All @@ -279,7 +283,7 @@
},
{
"cell_type": "code",
"execution_count": 6,
"execution_count": 13,
"metadata": {
"collapsed": false
},
Expand All @@ -288,23 +292,22 @@
"name": "stdout",
"output_type": "stream",
"text": [
"a\n",
"1\n",
"a\n",
"b\n",
"2\n",
"c\n",
"3\n",
"d\n",
"4\n",
"e\n",
"5\n"
"2\n",
"3\n",
"4\n"
]
}
],
"source": [
"xs = Observable.range(1, 5)\n",
"ys = Observable.from_(\"abcde\")\n",
"zs = xs.merge(ys).subscribe(print)"
"xs = reactivex.range(1, 5)\n",
"ys = reactivex.from_(\"abcde\")\n",
"zs = xs.pipe(ops.merge(ys)).subscribe(print)"
]
},
{
Expand All @@ -329,11 +332,11 @@
"source": [
"## Marbles and Marble Diagrams\n",
"\n",
"As we saw in the previous section it's nice to add some time when playing with Rx and RxPY. A great way to explore RxPY is to use the `marbles` test module that enables us to play with [marble diagrams](http://rxmarbles.com). The marbles module adds two new extension methods to `Observable`. The methods are `from_marbles()` and `to_marbles()`.\n",
"As we saw in the previous section it's nice to add some time when playing with Rx and RxPY. A great way to explore RxPY is to use the `marbles` test module that enables us to play with [marble diagrams](http://rxmarbles.com). The marbles module adds two new function to. The methods are `from_marbles()` and `to_marbles()`.\n",
"\n",
"Examples:\n",
"1. `res = reactivex.Observable.from_marbles(\"1-2-3-|\")`\n",
"2. `res = reactivex.Observable.from_marbles(\"1-2-3-x\", rx.Scheduler.timeout)`\n",
"1. `res = reactivex.from_marbles(\"1-2-3-|\")`\n",
"2. `res = reactivex.from_marbles(\"1-2-3-x\", rx.Scheduler.timeout)`\n",
"\n",
"The marble string consists of some special characters:\n",
"\n",
Expand All @@ -350,27 +353,25 @@
},
{
"cell_type": "code",
"execution_count": 8,
"execution_count": 17,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"'a-b-c-|'"
"['a', 'b', 'c']"
]
},
"execution_count": 8,
"execution_count": 17,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"from reactivex.testing import marbles\n",
"\n",
"xs = Observable.from_marbles(\"a-b-c-|\")\n",
"xs.to_blocking().to_marbles()"
"xs = reactivex.from_marbles(\"a-b-c-|\")\n",
"xs.pipe(ops.to_list()).run()"
]
},
{
Expand All @@ -384,26 +385,33 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 24,
"metadata": {
"collapsed": false
},
"outputs": [
{
"data": {
"text/plain": [
"'11-22-33-4x'"
"<reactivex.disposable.disposable.Disposable at 0x10cf777c0>"
]
},
"execution_count": 9,
"execution_count": 24,
"metadata": {},
"output_type": "execute_result"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"error\n"
]
}
],
"source": [
"xs = Observable.from_marbles(\"1-2-3-x-5\")\n",
"ys = Observable.from_marbles(\"1-2-3-4-5\")\n",
"xs.merge(ys).to_blocking().to_marbles()"
"xs = reactivex.from_marbles(\"1-2-3-#-\")\n",
"ys = reactivex.from_marbles(\"1-2-3-4-5\")\n",
"xs.pipe(ops.merge(ys)).subscribe(on_error=print)"
]
},
{
Expand All @@ -419,7 +427,7 @@
},
{
"cell_type": "code",
"execution_count": 9,
"execution_count": 16,
"metadata": {
"collapsed": false
},
Expand All @@ -435,7 +443,7 @@
"source": [
"from reactivex.subject import Subject\n",
"\n",
"stream = Subject()\n",
"stream = Subject[int]()\n",
"stream.on_next(41)\n",
"\n",
"d = stream.subscribe(lambda x: print(\"Got: %s\" % x))\n",
Expand Down Expand Up @@ -479,7 +487,7 @@
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.4.3"
"version": "3.10.0"
}
},
"nbformat": 4,
Expand Down

0 comments on commit 562a79c

Please sign in to comment.