Releases: google/pyglove
PyGlove v0.4.4
This release contains refinements of object behaviors, including typing, formatting, serialization, hashing and etc. Besides, it introduces pg.io
as an abstracted interface for operating with different file systems.
New Sub-packages
Enhancements
-
Typing
-
Object Formatting:
- Introduce
__str_format_args__
and__repr_format_args__
attributes for customize str/repr behavior forpg.Formattable
. (7e0a98b) - Introduced
pg.str_format
andpg.repr_format
context manager to control repr/str formatting for symbolic objects. (0a2ea6) - Add argument
markdown
forpg.str_format
andpg.repr_format
to quote the formatted object. (fd6ea8d) - Added argument
use_inferred
forpg.Symbolic
formatting. (fdd3d3d) - Escape strings with
'
and\n
inpg.format
. (0489642) - Better formatting for field docstr of multiple lines. (900d677)
- Introduce
-
Object Serialization:
-
Object Behaviors:
Bug Fixes
PyGlove v0.4.3
This release contains major updates on pg.symbolic
and pg.typing
.
Enhancements
-
pg.symbolic
- (Major)
pg.to_json
/pg.from_json
: supported serialization of Python types, annotations, functions/methods and opaque objects (6529a3c, 7777e8f, 4911073) - (Major) Added
pg.Inferential
for symbolic value inference (5ef667c). - (Major) Added symbolic reference
pg.Ref
, which allows referencing symbolic values in a symbolic tree (b28dc68). pg.Functor
: supported functor creation through subclasssing (4950819).pg.Symbolic.rebind
: supportednotify_parents
flag (cd0029c).pg.symbolic.Origin
: addedroot
property andhistory
method (2686b29).pg.Symbolic.sym_*
: have consistent value fordefault
(90afe73).
- (Major)
-
pg.typing
- (Major)
pg.typing.ValueSpec
can be used as a drop-in replacement for standard Python annotations. E.g.pg.typing.List[int]
(ddbade7, c2eca16, 79ec73). - (Major)
pg.Schema
,pg.typing.Field
andpg.typing.KeySpec
andpg.typing.ValueSpec
are now serializable (7777e8f). - Added
pg.typing.Annotated
,pg.typing.Sequence
andpg.typing.Optional
(ddbade7). - Added
pg.typing.ValueSpec.transform
for transforming the user input values during apply (a83c2ee, 0a9b034). - Added
pg.typing.callable_eq
for comparing two callable objects (7777e8f). - Added implicit conversion from
int
tofloat
(caa3c93)
- (Major)
-
pg.object_utils
Bug Fixes
-
pg.symbolic
pg.Object.from_json
: propagateallow_partial
flag to child. (1cc5aab)
-
pg.typing
pg.typing.ForwardRef
: fixed issue during deep copying (ddbade7).
-
pg.ext.early_stopping
- Fix an issue in state recovery for
pg.early_stopping.StepWise
(808ca8e).
- Fix an issue in state recovery for
Deprecated/Renamed APIs
-
pg.symbolic
- Renamed
pg.Object.schema
topg.Object.__schema__
,pg.Object.type_name
topg.Object.__type_name__
,pg.Object.serialization_key
topg.JSONConvertible.__serialization_key__
(bdffd58) - Renamed
pg.Functor.signature
topg.Functor.__signature__
. - Removed
pg.ContextualValue
,pg.symbolic.GetAttributeContext
,pg.Symbolic.sym_contextual_getattr/hasattr
(5ef667c).
- Renamed
-
pg.typing
- Merged
pg.typing.get_first_applicable_converter
intopg.typing.get_converter
(dd1c253).
- Merged
PyGlove v0.4.2
Enhancements
pg.symbolic
- Overriding
pg.Object.__init__
now requires to apply a@pg.explicit_method_override
, which prevents users from accidentally override common Python methods that are managed PyGlove. (870ed11) pg.compound
now supports generic types as the base class .(4f659ab)pg.compound
also could use abstract class as the base class for Python 3.10 and above. (c206676)pg.compound
allow contextual attribute access from the decomposed object. (c206676)
- Overriding
PyGlove v0.4.1
This is a light release with a few enhancements/bug fixes for pg.typing
and pg.symbolic
.
Enhancements
-
pg.typing
-
pg.symbolic
- Introducing
pg.use_init_args
for reordering the init arguments for the subclasses ofpg.Object
. (627990e)
- Introducing
Bug Fixes:
-
pg.typing
Tuple[<elem_type>, ...]
now can be correctly recognized. (9e2a772)
-
pg.symbolic
PyGlove v0.4.0
New Features
-
pg.symbolic
-
pg.object_utils
- Introduce
pg.docstr
for DocStr inspection. ([29f02ad](https://github.com/google/pyglove/commit/
29f02ad))
- Introduce
-
pg.mutfun
Enhancements
-
pg.symbolic
-
Major: Introduce symbolic member declaration via field annotations, which replaces
pg.members
as the recommended way for symbolic field declaration (27a7392, 564cb1b) -
Major: Introduce
auto_typing
forpg.symbolize
andpg.functor
. (5b57191) -
Introduce context manager
pg.auto_call_functors
, which allows functor invocation right after init. This makes functors compatible with regular functions. (a00e787) -
Introduce
auto_doc
argument forpg.symbolze
. (e8b2520) -
Support
python_format
argument forpg.Symbolic.format
. (c3005c06) -
pg.Object
to allow member methods to work as the default value for callable symbolic attributes. (9b2bd3b) -
Add
pg.Object._begin_annotation_inference
andpg.Object._end_annotation_inference
as events for intercepting annotation inference during class creation. (af410fe)
-
-
pg.typing
- Major:
pg.typing.Object
to support forward declaration. (9235f55)
- Major:
-
pg.object_utils
Bug Fixes
-
pg.typing
-
pg.symbolic
-
pg.ext.evolution
- Fix
pg.evolution.mutators.Uniform
for misaligned subchoice DNASpec after sorting the subchoices. (c4ad652)
- Fix
-
pg.ext.early_stopping
- Fix gating index matching logic in
pg.early_stopping.StepWise
. (a5e0532)
- Fix gating index matching logic in
Code Improvement
pg.symbolic
Removed APIs
- Removed
pg.generators
namespace. (ac40ae5)
Examples
PyGlove v0.3.0
New Features
-
Introducing extension module
pg.mutfun
for evolving low-level functions. (c67a1e7, 3c6cd7f, ba937c0) -
Add
pg.registered_types
for accessing all registeredJSONConvertible
sub-classes. (c67a1e7)
Enhancements
pg.Symbolic
:
pg.sample
:
- Sampling of abstract search spaces (
pg.DNASpec
) is now supported (87707c2)
Module pg.typing
:
- PyType annotation could be used as value spec in
pg.members
/pg.symbolize
. (e95505d)
Module pg.object_utils
:
- Pushed up shared
JSONConvertible
features topg.object_utils
module. (55bc482)
API changes.
- Removed
pg.schema
(an alias forpg.members
). (e25dbd9)
PyGlove 0.2.1
PyGlove 0.2.0
Enhancements:
pg.symbolic
:- Introducing
pg.Symbolic.sym_has
andpg.Symbolic.sym_get
to test/get node in sub-tree by path. - Introducing
pg.Symbolic.sym_field
andpg.Symbolic.sym_attr_field
to access thepg.typing.Field
definition for current/child symbolic value. pg.Symbolic.sym_getattr
now supports default value.pg.Symbolic.rebind
now supportspg.KeyPath
objects as keys.
- Introducing
Bug fixes:
pg.tuning
: Fixpg.tuning.Feedback.should_stop_early
crash on in-memory tuning backend.
New features:
- (experimental) Introducing
pg.composing
to handle algorithmic symbolic mutations.
PyGlove 0.1.1
-
New Features
- Introduce
pg.logging
to allow pluggable PyGlove logging. - Introduce
pg.early_stopping
with initial step-wise policies.
- Introduce
-
Enhancements
-
pg.hyper
:- Support nested
pg.hyper.DynamicEvaluationContext
for supporting divide-and-conquer a search space. - Support scale type for
pg.floatv
. - Preserve numeric literal values when calling
pg.hyper.Choices.dna_spec
.
- Support nested
-
pg.tuning
:- Support using base error class and error regex in
pg.tuning.Feedback.skip_on_exceptions
. - Add
pg.tuning.Feedback.ignore_race_conditions
to better handle race conditions from multiple co-workers
- Support using base error class and error regex in
-
pg.evolution
:- Make
pg.evolution.Evolution
thread-safe duringpropose
/feedback
. - Make
pg.evolution.Evolution
better report population initialization errors.
- Make
-