Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
MarcSkovMadsen committed Nov 13, 2024
1 parent 25733d2 commit 65ae984
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 6 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,3 @@ benchmarks/param
# pixi
.pixi
pixi.lock
script.*
3 changes: 2 additions & 1 deletion param/parameterized.py
Original file line number Diff line number Diff line change
Expand Up @@ -1320,7 +1320,8 @@ def schema(self, safe=False, subset=None, mode='json'):

@property
def rx(self):
"""The reactive namespace.
"""
The reactive namespace.
Provides reactive versions of the operations that cannot be made reactive through overloading, such as
`.rx.and_` and `.rx.bool`. Call it (`()`) to obtain a reactive expression.
Expand Down
6 changes: 4 additions & 2 deletions param/reactive.py
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,8 @@ class NestedResolver(Resolver):


class reactive_ops:
"""The reactive namespace.
"""
The reactive namespace.
Provides reactive versions of the operations that cannot be made reactive through overloading, such as
`.rx.and_` and `.rx.bool`. Call it (`()`) to obtain a reactive expression.
Expand Down Expand Up @@ -794,7 +795,8 @@ def __init__(

@property
def rx(self) -> reactive_ops:
"""The reactive namespace.
"""
The reactive namespace.
Provides reactive versions of the operations that cannot be made reactive through overloading, such as
`.rx.and_` and `.rx.bool`. Call it (`()`) to obtain a reactive expression.
Expand Down
9 changes: 7 additions & 2 deletions tests/testreactive.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import os
import unittest
import time
from textwrap import dedent

try:
import numpy as np
Expand All @@ -24,8 +25,8 @@
import param
import pytest

from param.parameterized import Skip
from param.reactive import bind, rx
from param.parameterized import Skip, Parameter
from param.reactive import bind, rx, reactive_ops

from .utils import async_wait_until

Expand Down Expand Up @@ -767,3 +768,7 @@ def test_reactive_callback_resolve_accessor():
dfx = rx(df)
out = dfx["name"].str._callback()
assert out is df["name"].str

def test_docstrings_in_sync():
assert dedent(reactive_ops.__doc__) == dedent(Parameter.rx.__doc__)
assert dedent(reactive_ops.__doc__) == dedent(rx.rx.__doc__)

0 comments on commit 65ae984

Please sign in to comment.