Skip to content

PyGlove v0.4.0

Choose a tag to compare

@daiyip daiyip released this 13 Jul 17:09
· 203 commits to main since this release

New Features

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 for pg.symbolize and pg.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 for pg.symbolze. (e8b2520)

    • Support python_format argument for pg.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 and pg.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)
  • pg.object_utils

    • Introduce pg.object_utils.thread_local_xxx APIs for thread local state managements. (4ee6572, e6a9066)

Bug Fixes

  • pg.typing

    • Fill pg.typing.Signature.return_value when the return annotation is not present. (3fe60e0)
    • Fix pg.ValueSpec.from_annotation on union type. (27a7392)
  • pg.symbolic

    • Improve init_arg_list inference: subclasses with new fields should not inherit base class' init_arg_list. (25e4c23)
    • Fix sym_parent None check. (48f23c8)
  • pg.ext.evolution

    • Fix pg.evolution.mutators.Uniform for misaligned subchoice DNASpec after sorting the subchoices. (c4ad652)
  • pg.ext.early_stopping

    • Fix gating index matching logic in pg.early_stopping.StepWise. (a5e0532)

Code Improvement

  • pg.symbolic
    • Revise pg.Object symbolic fields default value setting logic. (e64d516)
    • Revise schema and signature inference for pg.Object, pg.Functor and pg.ClassWrapper. (8141116)

Removed APIs

  • Removed pg.generators namespace. (ac40ae5)

Examples