Releases: holoviz/param
Version 2.3.1
This patch release fixes a regression introduced in the param.parameterized.edit_constant context manager.
Fixes:
- Fix
edit_constantto prevent class value mutation when not constant
Version 2.3.0
This minor release brings a number of new features, enhancements, bug fixes, and documentation improvements. Notably, it introduces the new Parameter attributes default_factory and metadata, and the ParameterizedABC class to declare Parameterized abstract base classes. All the docstrings have been improved thanks to a massive effort from @MarcSkovMadsen. Several deprecated APIs have now been removed, and the minimum supported Python version has been bumped to 3.10. Many thanks to our new contributors @Azaya89, @Coderambling, and @ypsah, as well as to @MarcSkovMadsen, @hoxbro, @maximlt, @philippjfr, and all others for their continued maintenance and development efforts.
Features:
- Add a
default_factoryattribute to the base Parameter (#1092) - Add a
metadataattribute to the base Parameter (#1094) - Allow declaring Parameterized abstract base classes by inheriting from
ParameterizedABC=> This approach should be favored over__abstract = True(#1031) - Add
.rx.set()method (#957)
Enhancements:
- Add missing docstrings and enhance existing ones (#992, #994, #997, #998)
- Better error when calling
len()on a reactive expression (#1033) - Raise
AttributeErrorwhen attempting to set thevalueattribute of a reactive expression (#1022) - Add an
is_instanceattribute to theListParameter (#1023) - Allow
depends(..., on_init=True)to be applied to async method (#1067) - Add
concretekeyword to thedescendentsfunction => Preferconcrete(<cls>, descendents=True)overconcrete_descendents(<cls>)(#1027)
Performance Enhancements:
- Improve import time by lazy importing "slow" modules (#1037)
- Only update Parameter signatures when needed (#1038)
Bug Fixes:
- Fix calling
descendentson anobject()instance (#1024) - Ensure
edit_constantresets class and instance level parameters (#1015) - Ensure
constantattribute is inherited (#1017) - Ensure type checkers skip
ParameterizedFunction.__init__(#1039) - Fix
.values()/get_value_generator()dealing with Dynamic params and an updated default value (#1058) - Do not remove
nested_refswhen updating another ref (#1061) - Fix error message of
ReactiveESMMetaClass(#1064) - Fix
reactive_ops.__call__(#1069) unwatchno longer logs a warning and idempotent behavior clarified (#1018)- Remove bad abstract declaration on
SelectorBase(#1086) - Do not override refs when parameter is triggered (#1089)
Documentation:
- Add a new page that lists deprecated and removed APIs (#1016)
- Add a version switcher (#1079)
- Small refactor and fixes to the API reference (#1082)
- README and landing page updates (#1095)
- Various minor fixes and improvements (#1006, #1034, #1036, #1049, #1052, #1054)
Breaking changes:
- Direct removal of the undocumented and broken
print_all_param_defaultsfunction (#1029) - API removals that emitted a deprecation warning since 2.0.0, all included in the table below (#1085)
| Warning | Description |
|---|---|
ParamFutureWarning since 2.2.0, ParamDeprecationWarning since 2.0.0 |
Parameter slots / List._class: use instead item_type |
ParamFutureWarning since 2.2.0, ParamDeprecationWarning since 2.0.0 |
Parameter slots / Number.set_hook: no replacement |
ParamFutureWarning since 2.2.0, ParamDeprecationWarning since 2.0.0 |
param.__init__ module / param.produce_value: no replacement |
ParamFutureWarning since 2.2.0, ParamDeprecationWarning since 2.0.0 |
param.__init__ module / param.as_unicode: no replacement |
ParamFutureWarning since 2.2.0, ParamDeprecationWarning since 2.0.0 |
param.__init__ module / param.is_ordered_dict: no replacement |
ParamFutureWarning since 2.2.0, ParamDeprecationWarning since 2.0.0 |
param.__init__ module / param.hashable: no replacement |
ParamFutureWarning since 2.2.0, ParamDeprecationWarning since 2.0.0 |
param.__init__ module / param.named_objs: no replacement |
ParamFutureWarning since 2.2.0, ParamDeprecationWarning since 2.0.0 |
param.__init__ module / param.normalize_path: no replacement |
ParamFutureWarning since 2.2.0, ParamDeprecationWarning since 2.0.0 |
param.__init__ module / param.abbreviate_paths: no replacement |
ParamFutureWarning since 2.2.0, ParamDeprecationWarning since 2.0.0 |
param.parameterized module / param.parameterized.all_equal: no replacement |
ParamFutureWarning since 2.2.0, ParamDeprecationWarning since 2.0.0 |
param.parameterized module / param.parameterized.add_metaclass: no replacement |
ParamFutureWarning since 2.2.0, ParamDeprecationWarning since 2.0.0 |
param.parameterized module / param.parameterized.batch_watch: use instead batch_call_watchers |
ParamFutureWarning since 2.2.0, ParamDeprecationWarning since 2.0.0 |
param.parameterized module / param.parameterized.recursive_repr: no replacement |
ParamFutureWarning since 2.2.0, ParamDeprecationWarning since 2.0.0 |
param.parameterized module / param.parameterized.overridable_property: no replacement |
ParamFutureWarning since 2.2.0, ParamDeprecationWarning since 2.0.0, soft-deprecated since 1.12.0 |
Parameterized .param namespace / .param.set_default: use instead for k,v in p.param.objects().items(): print(f"{p.__class__.name}.{k}={repr(v.default)} |
ParamFutureWarning since 2.2.0, ParamDeprecationWarning since 2.0.0, soft-deprecated since 1.12.0 |
Parameterized .param namespace / .param._add_parameter: use instead .param.add_parameter |
ParamFutureWarning since 2.2.0, ParamDeprecationWarning since 2.0.0, soft-deprecated since 1.12.0 |
Parameterized .param namespace / .param.params: use instead .param.values() or .param['param'] |
ParamFutureWarning since 2.2.0, ParamDeprecationWarning since 2.0.0, soft-deprecated since 1.12.0 |
Parameterized .param namespace / .param.set_param: use instead .param.update |
ParamFutureWarning since 2.2.0, ParamDeprecationWarning since 2.0.0, soft-deprecated since 1.12.0 |
Parameterized .param namespace / .param.get_param_values: use instead .param.values().items() (or .param.values() for the common case of dict(....param.get_param_values())) |
ParamFutureWarning since 2.2.0, ParamDeprecationWarning since 2.0.0, soft-deprecated since 1.12.0 |
Parameterized .param namespace / .param.params_depended_on: use instead .param.method_dependencies |
ParamFutureWarning since 2.2.0, ParamDeprecationWarning since 2.0.0, soft-deprecated since 1.12.0 |
Parameterized .param namespace / .param.defaults: use instead {k:v.default for k,v in p.param.objects().items()} |
ParamFutureWarning since 2.2.0, ParamDeprecationWarning since 2.0.0, soft-deprecated since 1.12.0 |
Parameterized .param namespace / .param.print_param_defaults: use instead for k,v in p.param.objects().items(): print(f"{p.__class__.name}.{k}={repr(v.default)}") |
ParamFutureWarning since 2.2.0, ParamDeprecationWarning since 2.0.0, soft-deprecated since 1.12.0 |
Parameterized .param namespace / .param.print_param_values: use instead for k,v in p.param.objects().items(): print(f"{p.__class__.name}.{k}={repr(v.default)}") |
ParamFutureWarning since 2.2.0, ParamDeprecationWarning since 2.0.0, soft-deprecated since 1.12.0 |
Parameterized .param namespace / .param.message: use instead .param.log(param.MESSAGE, ...) |
ParamFutureWarning since 2.2.0, ParamDeprecationWarning since 2.0.0, soft-deprecated since 1.12.0 |
Parameterized .param namespace / .param.verbose: use instead .param.log(param.VERBOSE, ...) |
ParamFutureWarning since 2.2.0, ParamDeprecationWarning since 2.0.0, soft-deprecated since 1.12.0 |
Parameterized .param namespace / .param.debug: use instead .param.log(param.DEBUG, ...) |
ParamFutureWarning since 2.2.0, ParamDeprecationWarning since 2.1.0, ParamPendingDeprecationWarning since 2.0.0 |
Instantiating most parameters with positional arguments beyond default is deprecated |
| `... |
Version 2.2.1
This patch release contains a bug fix for nested references. Thanks to @philippjfr for their contribution.
Bug Fixes:
- Do not remove nested_refs when updating another ref (#1061)
Version 2.2.0
This minor release brings a few enhancements and bugfixes. Importantly, it includes some breaking changes, removing deprecated APIs or raising errors during unsafe operations which would previously only emit warnings. Many thanks to @gandhis1 and @JRRudy1 for their first contributions, and to @hoxbro, @maximlt,and @MarcSkovMadsen for their continued maintenance and development efforts.
Enhancements:
- Annotate
dependsandaccept_argumentsdecorators (#962) - Stop directly importing numpy and add
gen_typesdecorator (#966)
Bug Fixes:
- Added missing
super().__init_subclass__call in_ParameterBase.__init_subclass__(#969) - Remove
_dict_update(#980)
Documentation:
Breaking changes / Deprecations:
- Remove
_param_watchers, raiseRuntimeErroron unsafe ops during init, and failed validation of a parameter default after inheritance (#973) - Promote many deprecation warnings to future warnings (#974)
Compatibility:
Infrastructure / Tests:
Version 2.1.1
This minor release contains bug fixes for reactive expressions and a few minor documentation improvements. Thanks to @jrycw for their first contribution! And to @ahuang11, @maximlt, and @philippjfr for their continued maintenance and development efforts.
Bug fixes:
- Ensure
rx._callbackresolves accessors (#949) - Ensure refs can be updated by watcher of the same parameter (#929)
- Recursively resolve references on args and kwargs passed to a reactive operation (#944)
- Only override the name of a Parameterized instance on Parameter instantiation when
instantiate=True(#938)
Documentation:
Maintenance:
- Fix
test_reactive_logic_unary_opson Python 3.12 (#946)
Version 2.1.0
This minor release focuses on improving reactive expressions and support for asynchronous (and synchronous) generators. Many thanks to @maximlt, @hoxbro and @philippjfr for their continued maintenance and development efforts.
Enhancements
- Improvements for synchronous and asychronous generators (#908)
- Additions to the .rx namespace including
and_,bool,map,not_,or_andupdating(#906) - Add support for adding asynchronous watcher to
rx(#917) - Make it possible to resolve reactive expressions recursively with
.rx.resolve(#918) - Add support for async and generator functions in
.rx.pipe(#924)
Bug fixes
- Ensure that
.param.updatecontext manager restore refs (#915) - Avoid overeager root invalidation on
rxleading to unnecessary evaluation (#919)
Deprecations
- Passing positional arguments to
Parameternow raises aParamDeprecationWarning(#921)
Version 2.0.2
This patch release fixes a few bugs and introduces a performance enhancement. Many thanks to @alfredocarella for their first contribution, and to the maintainers @maximlt and @philippjfr for contributing to this release.
Optimization:
- Minor optimizations in hot codepaths accessing class parameters (#893)
Bug fixes:
- Unpack partial callables in
iscoroutinefunction(#894) - Fix building Param with
setuptools-scm<7(#903)
Documentation:
Version 2.0.1
This minor release fixes a number of bugs, including a regression introduced by the replacement of the build backend (setuptools for hatchling) which led to the doc folder being wrongly packaged. Many thanks to @SultanOrazbayev for their first contribution, to @musicinmybrain for spotting the regression and submitting fixes, and to the maintainers @hoxbro, @jbednar and @maximlt for contributing to this release.
Bug fixes:
- Do not install
docfolder in site-packages (#878) - Drop the
feather-formattest dependency (#879) - Add
tablesto thetests-deserextra (#880) - Fix
_state_pushand_state_pop(#884) version.py: new process should not create a window on Windows (#882, #886)- Don't import
setuptools_scmif the.gitfolder doesn't exist (#885)
Documentation:
Version 2.0.0
20 years after its creation, Param has reached version 2.0! Can you guess when Param 3.0 will be released?
Param 2.0 is a major new release available for Python 3.8 and above, significantly streamlining, simplifying, and improving the Param API. Many long-supported but also long-obsolete functions, methods, and usages will now warn loudly so that you can make sure your code is only using the fully supported and safe current approaches. Because upgrading to Param 2 is likely to reveal compatibility issues with older codebases, new releases in the 1.x series are expected to continue for some time, focused on compatibility with the ecosystem rather than adding new features. Thus you can keep using Param 1.x with your older code, but Param 2 is the future!
We would like to thank @minimav for their first contribution, and @droumis, @hoxbro, @jbednar, @maximlt, @philippjfr and @sdrobert for their contributions. We would also like to thank @ceball, who made the first plans for Param 2.0 quite a few years ago, and we are glad to be delivering on them at last!
Major enhancements and features
- Parameter slot values are now all inherited correctly across a hierarchy of Parameterized classes, making their behavior much clearer and more consistent. Let's say we have class
Bbeing a subclass ofA, itself being a subclass ofparam.Parameterized. IfAdefinesx = Number(1, bounds=(0, 10))andBdefinesx = Number(2),B.param['x'].boundsis now going to be inherited fromAand equal to(0, 10)as you would expect. Parameterized classes have always supported inheritance, but the previous mechanism was based on usingNoneto indicate which values should be inherited, which was highly problematic becauseNonewas also a valid value for many slots. All Parameter slot signatures now default to the newUndefinedsentinel, finally allowingNoneto be inherited where appropriate. (#605, #771, #791, #874) - The
objectsslot of a Selector was previously highly confusing, because it accepted either a dictionary or a list for initialization but then was accessible only as a list, making it difficult to watch or update the objects. There is now aListProxywrapper aroundSelector.objects(with forward and backward compatibility) to easily updateobjectsand watchobjectsupdates (#598, #825) - Parameterized classes and instances now have a rich HTML representation that is displayed automatically in a Jupyter/IPython notebook. For a class or instance
p, just returnp.paramin a notebook cell to see a table of all the Parameters of the class/instance, their state, type, and range, plus the docstring on hover. It is likely we will improve the content and design of this repr based on feedback, so please let us know what you think! (#425, #781, #821, #831) - Parameters have all gained the
allow_refsandnested_refsattributes, bringing an exceptionally useful feature that was available in Panel since version 1.2 to Param. Declaring a Parameter withallow_refs=True(Falseby default) allows setting this Parameter value with a reference to automatically mirror the value of the reference. Supported references include class/instance Parameter objects, functions/methods decorated withparam.depends, reactive functions and expressions, asynchronous generators and custom objects transformed into a valid reference with a hook registered withparam.parameterized.register_reference_transform.nested_refsindicate whether references should be resolved even when they are nested inside a container (#843, #845, #849, #865, #862, #876) - Experimental new
rxreactive expressions: Param is widely used for building web apps in the HoloViz ecosystem, where packages have added various mechanisms for dynamic updates (e.g.pn.bindandpn.dependsin Panel, and.interactivein hvPlot). These mechanisms were already built on Param and can be used far more widely than just in those packages, so that functionality has now been generalized, streamlined, and moved into Param. Nearly any Python expression can now be made reactive withparam.rx(), at which point it will collect and be able to replay any operations (e.g. method calls) performed on them. This reactive programming approach lets you take just about any existing Python workflow and replace attributes with widgets or other reactive values, creating an app with fine-grained user control without having to design callbacks, event handlers, or any other complex logic!rxsupport is still experimental while we get feedback about the API, packaging, and documentation, but it's fully ready to try out and give us suggestions!
(#460, #842, #841, #844, #846, #847, #850, #851, #856, #860, #854, #859, #858, #873)
Enhancements
- Parameter slot values that are set to mutable containers (e.g.
Selector(objects=a_list)) will now be shallow-copied on instantiation, so that the container is no longer confusingly shared between the class and its subclasses and instances (#826) - To further clean up the Parameterized namespace (first started in version 1.7.0), the remaining private attributes haven been collected under two private namespaces
_param__privateand_param__parameters(#766, #790) - You can now use
.param.updateas a context manager for applying temporary updates (#779) - The
nameParameter has always had special behavior dating to its use in labeling objects in a GUI context, but this behavior is now able to be overriden at the class and instance level (#740) - Improved Parameter signatures for static and dynamic code analysis (#742)
- Removed inferred Parameterized docstring signature and add basic
__signature__support (#802) - For speed, only generate the Parameter docstring in an IPython context (#774)
- Improve Parameter validation error messages (#808)
- Support for deserialization of file types into
ArrayandDataFrame(#482) Integernow acceptsnumpy.integervalues (#735)Rangenow does stricter validation of the slot values (#725, #824)Pathnow hascheck_existsattribute, leading it to raise an error ifpathis not found on parameter instantiation (#800)- Add top-level
__all__and move Parameter classes toparameters.py(#853)
Bug fixes
- Allow type change for
DateRangeandDate(#733) - Ensure class watchers are not inherited by instance parameter (#833)
- Fix multi-level indirection in Parameters access (#840)
- Ensure non-function types are not resolved as empty function declarations (#753)
- Fix watchers support when the Parameterized instance is falsy (#769)
- Fix depending on the method of a sub-parameter object (#765)
- Raise an error on bad non-watched references (#777)
- Ensure that the root dependency can be resolved, and error otherwise (#813)
- Fix basic pickling (#783, #792)
- Validate that
selfis present in the__init__signature of a Parameterized class (#786) - No longer force
instantiateto True whenconstantis True (#776) - Instantiate default Parameter values based on all the Parameters available (#798)
Array: fixparam.pprint(#795)Array: don't hard-codeallow_NonetoTrue(#726)Boolean: validate the default type ([#722](https://git...
Version 1.13.0
The 1.13.0 is the last release of Param before the 2.0 release. However, Param 1.13 is meant to receive long-term support; security patches and fixes to critical bugs are planned to be backported to the 1.13.x series.
This release includes a new Bytes Parameter and a few important bug fixes. This release is also marked by the adoption of a formal project governance, ensuring Param's future as a healthy open-source project. Many thanks to @ovidner and @droumis for their first contributions! And to @maximlt, @hoxbro, @jlstevens, @philippjfr and @jbednar for their continuing support to fixing and improving Param.
Bug fixes:
- Fix copying when having watchers on e.g. bounds on inherited Parameter types (#675)
- Allow JSON serialization to work with
json.dumps(#655) ListSelectorrestricted tolisttype objects (#531)- Fix
dependsasync wrapper (#684) - Allow named colors to be any case (#711)
New features:
- Add Bytes parameter (#542)
Documentation:
- Fix param module link (#682)
Project governance:
- Create initial project governance docs (#674)
Maintenance: