param 2.3.0rc2__tar.gz → 2.3.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {param-2.3.0rc2 → param-2.3.1}/PKG-INFO +2 -2
- {param-2.3.0rc2 → param-2.3.1}/param/_version.py +2 -2
- {param-2.3.0rc2 → param-2.3.1}/param/parameterized.py +2 -1
- {param-2.3.0rc2 → param-2.3.1}/pyproject.toml +1 -1
- {param-2.3.0rc2 → param-2.3.1}/tests/testparameterizedobject.py +20 -0
- {param-2.3.0rc2 → param-2.3.1}/.gitignore +0 -0
- {param-2.3.0rc2 → param-2.3.1}/LICENSE.txt +0 -0
- {param-2.3.0rc2 → param-2.3.1}/README.md +0 -0
- {param-2.3.0rc2 → param-2.3.1}/numbergen/__init__.py +0 -0
- {param-2.3.0rc2 → param-2.3.1}/param/__init__.py +0 -0
- {param-2.3.0rc2 → param-2.3.1}/param/_utils.py +0 -0
- {param-2.3.0rc2 → param-2.3.1}/param/depends.py +0 -0
- {param-2.3.0rc2 → param-2.3.1}/param/display.py +0 -0
- {param-2.3.0rc2 → param-2.3.1}/param/ipython.py +0 -0
- {param-2.3.0rc2 → param-2.3.1}/param/parameters.py +0 -0
- {param-2.3.0rc2 → param-2.3.1}/param/reactive.py +0 -0
- {param-2.3.0rc2 → param-2.3.1}/param/serializer.py +0 -0
- {param-2.3.0rc2 → param-2.3.1}/param/version.py +0 -0
- {param-2.3.0rc2 → param-2.3.1}/tests/__init__.py +0 -0
- {param-2.3.0rc2 → param-2.3.1}/tests/conftest.py +0 -0
- {param-2.3.0rc2 → param-2.3.1}/tests/testaddparameter.py +0 -0
- {param-2.3.0rc2 → param-2.3.1}/tests/testbind.py +0 -0
- {param-2.3.0rc2 → param-2.3.1}/tests/testbooleanparam.py +0 -0
- {param-2.3.0rc2 → param-2.3.1}/tests/testbytesparam.py +0 -0
- {param-2.3.0rc2 → param-2.3.1}/tests/testcalendardateparam.py +0 -0
- {param-2.3.0rc2 → param-2.3.1}/tests/testcalendardaterangeparam.py +0 -0
- {param-2.3.0rc2 → param-2.3.1}/tests/testcallable.py +0 -0
- {param-2.3.0rc2 → param-2.3.1}/tests/testclassselector.py +0 -0
- {param-2.3.0rc2 → param-2.3.1}/tests/testcolorparameter.py +0 -0
- {param-2.3.0rc2 → param-2.3.1}/tests/testcomparator.py +0 -0
- {param-2.3.0rc2 → param-2.3.1}/tests/testcompositeparams.py +0 -0
- {param-2.3.0rc2 → param-2.3.1}/tests/testcustomparam.py +0 -0
- {param-2.3.0rc2 → param-2.3.1}/tests/testdateparam.py +0 -0
- {param-2.3.0rc2 → param-2.3.1}/tests/testdaterangeparam.py +0 -0
- {param-2.3.0rc2 → param-2.3.1}/tests/testdefaultfactory.py +0 -0
- {param-2.3.0rc2 → param-2.3.1}/tests/testdefaults.py +0 -0
- {param-2.3.0rc2 → param-2.3.1}/tests/testdeprecations.py +0 -0
- {param-2.3.0rc2 → param-2.3.1}/tests/testdynamicparams.py +0 -0
- {param-2.3.0rc2 → param-2.3.1}/tests/testfiledeserialization.py +0 -0
- {param-2.3.0rc2 → param-2.3.1}/tests/testfileselector.py +0 -0
- {param-2.3.0rc2 → param-2.3.1}/tests/testimports.py +0 -0
- {param-2.3.0rc2 → param-2.3.1}/tests/testipythonmagic.py +0 -0
- {param-2.3.0rc2 → param-2.3.1}/tests/testjsonserialization.py +0 -0
- {param-2.3.0rc2 → param-2.3.1}/tests/testlist.py +0 -0
- {param-2.3.0rc2 → param-2.3.1}/tests/testlistselector.py +0 -0
- {param-2.3.0rc2 → param-2.3.1}/tests/testmultifileselector.py +0 -0
- {param-2.3.0rc2 → param-2.3.1}/tests/testnumbergen.py +0 -0
- {param-2.3.0rc2 → param-2.3.1}/tests/testnumberparameter.py +0 -0
- {param-2.3.0rc2 → param-2.3.1}/tests/testnumpy.py +0 -0
- {param-2.3.0rc2 → param-2.3.1}/tests/testobjectselector.py +0 -0
- {param-2.3.0rc2 → param-2.3.1}/tests/testpandas.py +0 -0
- {param-2.3.0rc2 → param-2.3.1}/tests/testparamdepends.py +0 -0
- {param-2.3.0rc2 → param-2.3.1}/tests/testparameter.py +0 -0
- {param-2.3.0rc2 → param-2.3.1}/tests/testparameterizedrepr.py +0 -0
- {param-2.3.0rc2 → param-2.3.1}/tests/testparamoutput.py +0 -0
- {param-2.3.0rc2 → param-2.3.1}/tests/testparamunion.py +0 -0
- {param-2.3.0rc2 → param-2.3.1}/tests/testpathparam.py +0 -0
- {param-2.3.0rc2 → param-2.3.1}/tests/testpickle.py +0 -0
- {param-2.3.0rc2 → param-2.3.1}/tests/testrangeparameter.py +0 -0
- {param-2.3.0rc2 → param-2.3.1}/tests/testreactive.py +0 -0
- {param-2.3.0rc2 → param-2.3.1}/tests/testrefs.py +0 -0
- {param-2.3.0rc2 → param-2.3.1}/tests/testreprhtml.py +0 -0
- {param-2.3.0rc2 → param-2.3.1}/tests/testselector.py +0 -0
- {param-2.3.0rc2 → param-2.3.1}/tests/testsignatures.py +0 -0
- {param-2.3.0rc2 → param-2.3.1}/tests/teststringparam.py +0 -0
- {param-2.3.0rc2 → param-2.3.1}/tests/testtimedependent.py +0 -0
- {param-2.3.0rc2 → param-2.3.1}/tests/testtupleparam.py +0 -0
- {param-2.3.0rc2 → param-2.3.1}/tests/testutils.py +0 -0
- {param-2.3.0rc2 → param-2.3.1}/tests/testversion.py +0 -0
- {param-2.3.0rc2 → param-2.3.1}/tests/testwatch.py +0 -0
- {param-2.3.0rc2 → param-2.3.1}/tests/utils.py +0 -0
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: param
|
|
3
|
-
Version: 2.3.
|
|
4
|
-
Summary:
|
|
3
|
+
Version: 2.3.1
|
|
4
|
+
Summary: Declarative parameters for robust Python classes and a rich API for reactive programming
|
|
5
5
|
Project-URL: Homepage, https://param.holoviz.org/
|
|
6
6
|
Project-URL: Tracker, https://github.com/holoviz/param/issues
|
|
7
7
|
Project-URL: Releases, https://github.com/holoviz/param/releases
|
|
@@ -28,7 +28,7 @@ version_tuple: VERSION_TUPLE
|
|
|
28
28
|
commit_id: COMMIT_ID
|
|
29
29
|
__commit_id__: COMMIT_ID
|
|
30
30
|
|
|
31
|
-
__version__ = version = '2.3.
|
|
32
|
-
__version_tuple__ = version_tuple = (2, 3,
|
|
31
|
+
__version__ = version = '2.3.1'
|
|
32
|
+
__version_tuple__ = version_tuple = (2, 3, 1)
|
|
33
33
|
|
|
34
34
|
__commit_id__ = commit_id = None
|
|
@@ -428,6 +428,7 @@ def edit_constant(parameterized: 'Parameterized') -> Generator[None, None, None]
|
|
|
428
428
|
"""
|
|
429
429
|
kls_params = parameterized.param.objects(instance=False)
|
|
430
430
|
inst_params = parameterized._param__private.params
|
|
431
|
+
init_inst_params = list(inst_params)
|
|
431
432
|
updated = []
|
|
432
433
|
for pname, pobj in (kls_params | inst_params).items():
|
|
433
434
|
if pobj.constant:
|
|
@@ -439,7 +440,7 @@ def edit_constant(parameterized: 'Parameterized') -> Generator[None, None, None]
|
|
|
439
440
|
for pname in updated:
|
|
440
441
|
# Some operations trigger a parameter instantiation (copy),
|
|
441
442
|
# we ensure both the class and instance parameters are reset.
|
|
442
|
-
if pname in kls_params:
|
|
443
|
+
if pname in kls_params and pname not in init_inst_params:
|
|
443
444
|
type(parameterized).param[pname].constant=True
|
|
444
445
|
if pname in inst_params:
|
|
445
446
|
parameterized.param[pname].constant = True
|
|
@@ -5,7 +5,7 @@ build-backend = "hatchling.build"
|
|
|
5
5
|
[project]
|
|
6
6
|
name = "param"
|
|
7
7
|
dynamic = ["version"]
|
|
8
|
-
description = "
|
|
8
|
+
description = "Declarative parameters for robust Python classes and a rich API for reactive programming"
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
license = { text = "BSD-3-Clause" }
|
|
11
11
|
requires-python = ">=3.10"
|
|
@@ -329,6 +329,26 @@ class TestParameterized(unittest.TestCase):
|
|
|
329
329
|
assert TestPO.param['const'].constant
|
|
330
330
|
assert TestPO.param['const'].default not in (670, 891)
|
|
331
331
|
|
|
332
|
+
def test_edit_constant_does_not_mutate_cls_value_if_not_constant(self):
|
|
333
|
+
# Regression https://github.com/holoviz/param/issues/1100
|
|
334
|
+
class P(param.Parameterized):
|
|
335
|
+
a = param.Number()
|
|
336
|
+
|
|
337
|
+
|
|
338
|
+
p = P()
|
|
339
|
+
|
|
340
|
+
# Manually set p.param.a.constant to True
|
|
341
|
+
p.param.a.constant = True
|
|
342
|
+
|
|
343
|
+
assert p.param.a.constant is True
|
|
344
|
+
assert P.param.a.constant is False
|
|
345
|
+
|
|
346
|
+
with param.parameterized.edit_constant(p):
|
|
347
|
+
pass
|
|
348
|
+
|
|
349
|
+
assert p.param.a.constant is True
|
|
350
|
+
assert P.param.a.constant is False
|
|
351
|
+
|
|
332
352
|
def test_readonly_parameter(self):
|
|
333
353
|
"""Test that you can't set a read-only parameter on construction or as an attribute."""
|
|
334
354
|
testpo = TestPO()
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|