1. 03 Aug, 2022 1 commit
    • Darijan Gudelj's avatar
      open_dict for tweaking · 5f069dbb
      Darijan Gudelj authored
      Summary: Made the config system call open_dict when it calls the tweak function.
      
      Reviewed By: shapovalov
      
      Differential Revision: D38315334
      
      fbshipit-source-id: 5924a92d8d0bf399bbf3788247f81fc990e265e7
      5f069dbb
  2. 28 Jul, 2022 1 commit
    • Jeremy Reizenstein's avatar
      redefinition -> defaults kept in config · 6b481595
      Jeremy Reizenstein authored
      Summary:
      This is an internal change in the config systen. It allows redefining a pluggable implementation with new default values. This is useful in notebooks / interactive use. For example, this now works.
      
              class A(ReplaceableBase):
                  pass
      
              registry.register
              class B(A):
                  i: int = 4
      
              class C(Configurable):
                  a: A
                  a_class_type: str = "B"
      
                  def __post_init__(self):
                      run_auto_creation(self)
      
              expand_args_fields(C)
      
              registry.register
              class B(A):
                  i: int = 5
      
              c = C()
      
              assert c.a.i == 5
      
      Reviewed By: shapovalov
      
      Differential Revision: D38219371
      
      fbshipit-source-id: 72911a9bd3426d3359cf8802cc016fc7f6d7713b
      6b481595
  3. 24 Jun, 2022 1 commit
    • Jeremy Reizenstein's avatar
      omegaconf 2.2.2 compatibility · 879495d3
      Jeremy Reizenstein authored
      Summary: OmegaConf 2.2.2 doesn't like heterogenous tuples or Sequence or Set members. Workaround this.
      
      Reviewed By: shapovalov
      
      Differential Revision: D37278736
      
      fbshipit-source-id: 123e6657947f5b27514910e4074c92086a457a2a
      879495d3
  4. 10 Jun, 2022 1 commit
    • Jeremy Reizenstein's avatar
      hooks and allow registering base class · 8bc0a04e
      Jeremy Reizenstein authored
      Summary: Allow a class to modify its subparts in get_default_args by defining the special function provide_config_hook.
      
      Reviewed By: davnov134
      
      Differential Revision: D36671081
      
      fbshipit-source-id: 3e5b73880cb846c494a209c4479835f6352f45cf
      8bc0a04e
  5. 17 May, 2022 1 commit
    • Jeremy Reizenstein's avatar
      allow Optional[Dict]=None in config · f36b11fe
      Jeremy Reizenstein authored
      Summary: Fix recently observed case where enable_get_default_args was missing things declared as Optional[something mutable]=None.
      
      Reviewed By: davnov134
      
      Differential Revision: D36440492
      
      fbshipit-source-id: 192ec07564c325b3b24ccc49b003788f67c63a3d
      f36b11fe
  6. 16 May, 2022 1 commit
    • Jeremy Reizenstein's avatar
      create_x_impl · 899a3192
      Jeremy Reizenstein authored
      Summary: Make create_x delegate to create_x_impl so that users can rely on create_x_impl in their overrides of create_x.
      
      Reviewed By: shapovalov, davnov134
      
      Differential Revision: D35929810
      
      fbshipit-source-id: 80595894ee93346b881729995775876b016fc08e
      899a3192
  7. 13 Apr, 2022 1 commit
    • Tim Hatch's avatar
      apply import merging for fbcode/vision/fair (2 of 2) · 34bbb3ad
      Tim Hatch authored
      Summary:
      Applies new import merging and sorting from µsort v1.0.
      
      When merging imports, µsort will make a best-effort to move associated
      comments to match merged elements, but there are known limitations due to
      the diynamic nature of Python and developer tooling. These changes should
      not produce any dangerous runtime changes, but may require touch-ups to
      satisfy linters and other tooling.
      
      Note that µsort uses case-insensitive, lexicographical sorting, which
      results in a different ordering compared to isort. This provides a more
      consistent sorting order, matching the case-insensitive order used when
      sorting import statements by module name, and ensures that "frog", "FROG",
      and "Frog" always sort next to each other.
      
      For details on µsort's sorting and merging semantics, see the user guide:
      https://usort.readthedocs.io/en/stable/guide.html#sorting
      
      Reviewed By: bottler
      
      Differential Revision: D35553814
      
      fbshipit-source-id: be49bdb6a4c25264ff8d4db3a601f18736d17be1
      34bbb3ad
  8. 06 Apr, 2022 2 commits
  9. 04 Apr, 2022 2 commits
    • Jeremy Reizenstein's avatar
      store original declared types in Configurable · 3b8a33e9
      Jeremy Reizenstein authored
      Summary: Aid reflection by adding the original declared types of replaced members of a configurable as values in _processed_members.
      
      Reviewed By: davnov134
      
      Differential Revision: D35358422
      
      fbshipit-source-id: 80ef3266144c51c1c2105f349e0dd3464e230429
      3b8a33e9
    • Jeremy Reizenstein's avatar
      fix Optional[List] in Configurable · 2802fd93
      Jeremy Reizenstein authored
      Summary: Optional[not_a_type] was causing errors.
      
      Reviewed By: davnov134
      
      Differential Revision: D35355530
      
      fbshipit-source-id: e9b52cfd6347ffae0fe688ef30523a4092ccf9fd
      2802fd93
  10. 31 Mar, 2022 1 commit
  11. 29 Mar, 2022 2 commits
  12. 25 Mar, 2022 1 commit
    • Roman Shapovalov's avatar
      Return a typed structured config from default_args for callables · 645a47d0
      Roman Shapovalov authored
      Summary:
      Before the fix, running get_default_args(C: Callable) returns an unstructured DictConfig which causes Enums to be handled incorrectly. This is a fix.
      
      WIP update: Currently tests still fail whenever a function signature contains an untyped argument: This needs to be somehow fixed.
      
      Reviewed By: bottler
      
      Differential Revision: D34932124
      
      fbshipit-source-id: ecdc45c738633cfea5caa7480ba4f790ece931e8
      645a47d0
  13. 21 Mar, 2022 1 commit