Skip to content

Commit

Permalink
updated todos
Browse files Browse the repository at this point in the history
  • Loading branch information
omry committed Dec 15, 2020
1 parent d3a3559 commit a7318cf
Show file tree
Hide file tree
Showing 8 changed files with 24 additions and 16 deletions.
1 change: 1 addition & 0 deletions hydra/_internal/defaults_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -359,6 +359,7 @@ def _update_overrides(
assert d.group is not None
legacy_hydra_override = not d.is_override() and d.group.startswith("hydra/")
if legacy_hydra_override:
# DEPRECATED: remove in 1.2
d.override = True
url = "https://hydra.cc/docs/next/upgrades/1.0_to_1.1/default_list_override"
msg = dedent(
Expand Down
1 change: 1 addition & 0 deletions hydra/_internal/hydra.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ def create_main_hydra2(
if strict is None:
strict = True
else:
# DEPRECATED: remove in 1.1
msg = (
"\n@hydra.main(strict) flag is deprecated and will removed in the next version."
"\nSee https://hydra.cc/docs/next/upgrades/0.11_to_1.0/strict_mode_flag_deprecated"
Expand Down
1 change: 1 addition & 0 deletions hydra/core/default_element.py
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,7 @@ def _get_flags(self) -> List[str]:
def resolve_interpolation(self, known_choices: DictConfig) -> None:
name = self.get_name()
if name is not None:
# DEPRECATED: remove in 1.2
if re.match(_legacy_interpolation_pattern, name) is not None:
msg = dedent(
f"""
Expand Down
1 change: 1 addition & 0 deletions hydra/core/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -198,6 +198,7 @@ def split_config_path(
# assuming dir/config.yaml form
config_file: Optional[str] = basename(config_path)
config_dir: Optional[str] = dirname(config_path)
# DEPRECATED: remove in 1.1
msg = (
"\nUsing config_path to specify the config name is deprecated, specify the config name via config_name"
"\nSee https://hydra.cc/docs/next/upgrades/0.11_to_1.0/config_path_changes"
Expand Down
1 change: 1 addition & 0 deletions hydra/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from .types import TaskFunction


# TODO: remove strict flag (deprecated since Hydra 1.0)
def main(
config_path: Optional[str] = None,
config_name: Optional[str] = None,
Expand Down
1 change: 1 addition & 0 deletions hydra/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ class TargetConf:
_target_: str = MISSING

def __post_init__(self) -> None:
# DEPRECATED: remove in 1.2
msg = "\nTargetConf is deprecated since Hydra 1.1 and will be removed in Hydra 1.2."
warnings.warn(message=msg, category=UserWarning)

Expand Down
32 changes: 17 additions & 15 deletions tests/defaults_list/test_defaults_list.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,34 +86,36 @@
# - (Y) ensure all tests are passing
# - (Y) implement --info=defaults-tree output

# TODO: Followup items
# - Consider retaining the final choices in the hydra config node to allow interpolation with their values.
# - (Y) Enforce that overrides are at the end of the defaults list
# (with the exception of _self_ that can be after them)
# - Consider override style of: - override hydra/launcher: submitit
# - Fix error message when overriding a non-existing config group from the command line to not say "append with +"
# - Improve --info defaults-tree output
# - (Y) Profile and optimize default tree composition: speed in line with 1.0
# - Test cases when config group name matches a keyword (optional, override)

# TODO: (Y) rename support:
# - (Y) Remove rename support form 1.1
# - Deprecate rename support in 1.0

# - (Y) Deprecate rename support in 1.0 : task filed

# TODO: cleanup
# - (Y) Remove previous implementation of recursive defaults list and rename new_defaults_list to defaults_list etc.
# - (Y) Delete tests and test data of old defaults list impl
# - Clean up package logic from config sources
# - Clean up Hydra 1.0 warnings related to package header
# - (Y) Clean up package logic from config sources
# - (Y) Clean up Hydra 1.0 warnings related to package header

# TODO: Followup items
# - Consider retaining the final choices in the hydra config node to allow interpolation with their values.
# - (Y) Enforce that overrides are at the end of the defaults list
# (with the exception of _self_ that can be after them)
# - (Y) Consider override style of: - override hydra/launcher: submitit
# - (Y) Profile and optimize default tree composition: speed in line with 1.0
# - Fix error message when overriding a non-existing config group from the command line to not say "append with +"
# - Improve --info defaults-tree output
# - Test cases when config group name matches a keyword (optional, override)

# TODO Documentation
# - Update defaults list documentation
# - Create a page describing configuring experiments with Hydra (experiment use case)
# - Create https://hydra.cc/docs/next/upgrades/1.0_to_1.1/default_list_override
# - Update Structured Configs tutorial to utilize recursive defaults as an alternative to automatic schema
# - Consider deprecating automtic schema support in favor of extending a config via recursive defaults
# - Document --info defaults and --info defaults-tree


# TODO: Followup items to explore
# - Consider deprecating automatic schema support in favor of extending a config via recursive defaults


@mark.parametrize( # type: ignore
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ The strict mode is a flag added to `@hydra.main()` to enable two features:
- Command line error detection (overriding a field not in the config)
- Runtime config access error detection (accessing/setting a field not in the config)

This flag is now deprecated and the ability to turn it off will be removed in Hydra 1.1.
This flag is now deprecated, and the ability to turn it off will be removed in Hydra 1.1.

## Alternatives to `strict=False`
Below are a few common reasons for people disabling strict mode along with recommended alternatives.
Expand Down

0 comments on commit a7318cf

Please sign in to comment.