Skip to content

Commit

Permalink
Rename param.reactive to param.rx (#844)
Browse files Browse the repository at this point in the history
  • Loading branch information
philippjfr authored Sep 24, 2023
1 parent 00dc733 commit 86e8bcf
Show file tree
Hide file tree
Showing 6 changed files with 123 additions and 123 deletions.
22 changes: 11 additions & 11 deletions doc/user_guide/Reactive_Expressions.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"import param\n",
"import param.ipython\n",
"\n",
"from param import reactive as rx"
"from param import rx"
]
},
{
Expand Down Expand Up @@ -515,7 +515,7 @@
"metadata": {},
"outputs": [],
"source": [
"string_template = param.reactive('Hello {name}!')\n",
"string_template = rx('Hello {name}!')\n",
"\n",
"string_template"
]
Expand All @@ -535,7 +535,7 @@
"metadata": {},
"outputs": [],
"source": [
"name = param.reactive('world')\n",
"name = rx('world')\n",
"\n",
"str_expr = string_template.format(name=name)\n",
"\n",
Expand Down Expand Up @@ -625,7 +625,7 @@
"metadata": {},
"outputs": [],
"source": [
"param.reactive(1).rx.bool()"
"rx(1).rx.bool()"
]
},
{
Expand All @@ -645,7 +645,7 @@
"metadata": {},
"outputs": [],
"source": [
"param.reactive(2).rx.in_([1, 2, 3])"
"rx(2).rx.in_([1, 2, 3])"
]
},
{
Expand All @@ -665,7 +665,7 @@
"metadata": {},
"outputs": [],
"source": [
"param.reactive(None).rx.is_(None)"
"rx(None).rx.is_(None)"
]
},
{
Expand All @@ -685,7 +685,7 @@
"metadata": {},
"outputs": [],
"source": [
"param.reactive(None).rx.is_not(None)"
"rx(None).rx.is_not(None)"
]
},
{
Expand All @@ -705,7 +705,7 @@
"metadata": {},
"outputs": [],
"source": [
"param.reactive([1, 2, 3]).rx.len()"
"rx([1, 2, 3]).rx.len()"
]
},
{
Expand All @@ -725,7 +725,7 @@
"metadata": {},
"outputs": [],
"source": [
"param.reactive(1).rx.pipe(add, 2)"
"rx(1).rx.pipe(add, 2)"
]
},
{
Expand All @@ -735,7 +735,7 @@
"metadata": {},
"outputs": [],
"source": [
"param.reactive(8).rx.pipe(str)"
"rx(8).rx.pipe(str)"
]
},
{
Expand Down Expand Up @@ -855,7 +855,7 @@
"metadata": {},
"outputs": [],
"source": [
"condition = param.reactive(True)"
"condition = rx(True)"
]
},
{
Expand Down
2 changes: 1 addition & 1 deletion param/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3246,4 +3246,4 @@ def exceptions_summarized():
etype, value, tb = sys.exc_info()
print(f"{etype.__name__}: {value}", file=sys.stderr)

from .reactive import bind, reactive # noqa: api import
from .reactive import bind, rx # noqa: api import
4 changes: 2 additions & 2 deletions param/ipython.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

from param.depends import depends, register_display_accessor
from param.parameterized import resolve_ref
from param.reactive import reactive
from param.reactive import rx


# Whether to generate warnings when misformatted docstrings are found
Expand Down Expand Up @@ -365,7 +365,7 @@ def __init__(self, reactive):
self._reactive = reactive

def __call__(self):
if isinstance(self._reactive, reactive):
if isinstance(self._reactive, rx):
cb = self._reactive._callback
@depends(*self._reactive._params, watch=True)
def update_handle(*args, **kwargs):
Expand Down
Loading

0 comments on commit 86e8bcf

Please sign in to comment.