Releases: holoviz/param
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
depends
andaccept_arguments
decorators (#962) - Stop directly importing numpy and add
gen_types
decorator (#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
, raiseRuntimeError
on 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._callback
resolves 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_ops
on 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.update
context manager restore refs (#915) - Avoid overeager root invalidation on
rx
leading to unnecessary evaluation (#919)
Deprecations
- Passing positional arguments to
Parameter
now 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
doc
folder in site-packages (#878) - Drop the
feather-format
test dependency (#879) - Add
tables
to thetests-deser
extra (#880) - Fix
_state_push
and_state_pop
(#884) version.py
: new process should not create a window on Windows (#882, #886)- Don't import
setuptools_scm
if the.git
folder 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
B
being a subclass ofA
, itself being a subclass ofparam.Parameterized
. IfA
definesx = Number(1, bounds=(0, 10))
andB
definesx = Number(2)
,B.param['x'].bounds
is now going to be inherited fromA
and equal to(0, 10)
as you would expect. Parameterized classes have always supported inheritance, but the previous mechanism was based on usingNone
to indicate which values should be inherited, which was highly problematic becauseNone
was also a valid value for many slots. All Parameter slot signatures now default to the newUndefined
sentinel, finally allowingNone
to be inherited where appropriate. (#605, #771, #791, #874) - The
objects
slot 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 aListProxy
wrapper aroundSelector.objects
(with forward and backward compatibility) to easily updateobjects
and watchobjects
updates (#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.param
in 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_refs
andnested_refs
attributes, bringing an exceptionally useful feature that was available in Panel since version 1.2 to Param. Declaring a Parameter withallow_refs=True
(False
by 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_refs
indicate whether references should be resolved even when they are nested inside a container (#843, #845, #849, #865, #862, #876) - Experimental new
rx
reactive 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.bind
andpn.depends
in Panel, and.interactive
in 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!rx
support 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__private
and_param__parameters
(#766, #790) - You can now use
.param.update
as a context manager for applying temporary updates (#779) - The
name
Parameter 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
Array
andDataFrame
(#482) Integer
now acceptsnumpy.integer
values (#735)Range
now does stricter validation of the slot values (#725, #824)Path
now hascheck_exists
attribute, leading it to raise an error ifpath
is not found on parameter instantiation (#800)- Add top-level
__all__
and move Parameter classes toparameters.py
(#853)
Bug fixes
- Allow type change for
DateRange
andDate
(#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
self
is present in the__init__
signature of a Parameterized class (#786) - No longer force
instantiate
to True whenconstant
is True (#776) - Instantiate default Parameter values based on all the Parameters available (#798)
Array
: fixparam.pprint
(#795)Array
: don't hard-codeallow_None
toTrue
(#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) ListSelector
restricted tolist
type objects (#531)- Fix
depends
async 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:
Version 1.12.3
The 1.12.3
release adds support for Python 3.11. Many thanks to @musicinmybrain (first contribution!) and @maximlt for contributing to this release.
Enhancements:
Version 1.12.2
The 1.12.2 release fixes a number of bugs and adds support again for Python 2.7, which was unfortunately no longer supported in the last release. Note however that Param 2.0 will still drop support of Python 2.7 as already announced. Many thanks to @hoxbro and the maintainers @jbednar, @jlstevens, @maximlt and @philippjfr for contributing to this release.
Bug fixes:
- Match against complete spec name when determining dynamic watchers (615)
- Ensure async functionality does not cause python2 syntax errors (624)
- Allow (de)serializing
CalendarRange
andDateRange
Parameters
(625) - Improve
DateRange
validation (627) - Fix regression in
@param.depends
execution ordering (628) - Ensure
named_objs
does not fail on unhashable objects (632) - Support comparing date-like objects (629)
- Fixed
BinaryPower
example in the docs to use the correct nameEvenInteger
(634)
Version 1.12.1
The 1.12.1 release fixes a number of bugs related to async callback handling when using param.depends
and .param.watch
and a number of documentation and error messages. Many thanks to @hoxbro and the maintainers @jbednar, @jlstevens, @maximlt and @philippjfr for contributing to this release.
Error handling and documentation:
- Fixed description of shared_parameters (#568)
- Improve the error messages of Date and DateRange (#579)
- Clarified step error messages and other docs and links (#604)
Bug fixes:
- Make iscoroutinefunction more robust (#572)
- Fix for handling misspelled parameter (#575)
- Handle None serialization for Date, CalendarDate, Tuple, Array, and DataFrame (#582)
- Support async coroutines in param.depends (#591)
- Handle async functions in depends with watch=True (#611)
- Avoid equality check on Watcher (#612)
Documentation: