Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename param.reactive to param.rx #844

Merged
merged 8 commits into from
Sep 24, 2023
Merged
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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",
philippjfr marked this conversation as resolved.
Show resolved Hide resolved
"string_template = param.rx('Hello {name}!')\n",
"\n",
"string_template"
]
Expand All @@ -535,7 +535,7 @@
"metadata": {},
"outputs": [],
"source": [
"name = param.reactive('world')\n",
"name = param.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()"
"param.rx(1).rx.bool()"
]
},
{
Expand All @@ -645,7 +645,7 @@
"metadata": {},
"outputs": [],
"source": [
"param.reactive(2).rx.in_([1, 2, 3])"
"param.rx(2).rx.in_([1, 2, 3])"
]
},
{
Expand All @@ -665,7 +665,7 @@
"metadata": {},
"outputs": [],
"source": [
"param.reactive(None).rx.is_(None)"
"param.rx(None).rx.is_(None)"
]
},
{
Expand All @@ -685,7 +685,7 @@
"metadata": {},
"outputs": [],
"source": [
"param.reactive(None).rx.is_not(None)"
"param.rx(None).rx.is_not(None)"
]
},
{
Expand All @@ -705,7 +705,7 @@
"metadata": {},
"outputs": [],
"source": [
"param.reactive([1, 2, 3]).rx.len()"
"param.rx([1, 2, 3]).rx.len()"
]
},
{
Expand All @@ -725,7 +725,7 @@
"metadata": {},
"outputs": [],
"source": [
"param.reactive(1).rx.pipe(add, 2)"
"param.rx(1).rx.pipe(add, 2)"
]
},
{
Expand All @@ -735,7 +735,7 @@
"metadata": {},
"outputs": [],
"source": [
"param.reactive(8).rx.pipe(str)"
"param.rx(8).rx.pipe(str)"
]
},
{
Expand Down Expand Up @@ -855,7 +855,7 @@
"metadata": {},
"outputs": [],
"source": [
"condition = param.reactive(True)"
"condition = param.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 @@ -3223,4 +3223,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 @@ -25,7 +25,7 @@
import param

from param.depends import depends, register_display_accessor, 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 @@ -364,7 +364,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