Skip to content

Commit

Permalink
updated todos.
Browse files Browse the repository at this point in the history
  • Loading branch information
omry committed Jan 1, 2021
1 parent f86a90e commit cbd055f
Show file tree
Hide file tree
Showing 8 changed files with 7 additions and 101 deletions.
1 change: 1 addition & 0 deletions hydra/_internal/defaults_list.py
Expand Up @@ -381,6 +381,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/defaults_list_override"
msg = dedent(
Expand Down
1 change: 1 addition & 0 deletions hydra/_internal/hydra.py
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
Expand Up @@ -487,6 +487,7 @@ def is_interpolation(self) -> bool:
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
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
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
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
100 changes: 0 additions & 100 deletions tests/defaults_list/test_defaults_list.py
Expand Up @@ -24,106 +24,6 @@
Plugins.instance()


# TODO: (Y) Test with simple config group overrides
# TODO: (Y) Test computed package when there are no package overrides in package header
# TODO: (Y) test with config group overrides overriding config groups @pkg
# TODO: (Y) test overriding config group choices with non-default packages
# packages to test:
# (Y) _global_
# (Y) _global_.foo
# (Y) _name_
# TODO: (Y) test with config header package override
# TODO: (Y) test with both config header and defaults list pkg override
# TODO: Support overriding config group values from the defaults list
# - (Y) reconsider support for overriding as before, DECISION: Not happening.
# - (Y) Support marked overrides in primary config only
# - (Y) Support marked override in all configs
# - (Y) Test overriding of config groups with a specified package (@pkg)
# - (Y) Overriding of config groups with a specified package (@pkg) when there are multiple choices from same group
# - (Y) Handle hydra overrides
# TODO: Experiment use case: test the following from a config in an experiment group
# - (Y) Override user config group with and without an external override of the same config group
# - (Y) Experiment specified in primary defaults
# - (Y) Append experiment file from external overrides
# - (Y) Override hydra config group from experiment [+ external override]
# - (Y) Include config with an absolute path
# - (Y) Test final defaults list with an experiment file
# - (Y) Test experiment config as a primary (must have @package _global_ and absolute addressing of config groups)
# TODO: (Y) package header:
# - (Y) Consider making relative. Decision: package header will remain absolute.
# - (Y) Consider deprecating completely. Decision: package will not be deprecated for now
# TODO: (Y) Test use cases for config extension:
# - (Y) Extension from the same config group
# - (Y) Extension from absolute config group
# - (Y) Extension from a nested config group
# TODO: (Y) Test missing ('???') in Defaults List
# TODO: (Y) Support placeholder element
# TODO: Interpolation support
# - (Y) Simple + override
# - (Y) Forward + override
# - (Y) Interpolate with nested groups
# - (Y) Interpolate with group@pkg1
# - (Y) Test interpolated config with a defaults list
# - (Y) Error if interpolated config defaults list has an overrides
# - (Y) Support and deprecate legacy defaults list interpolation style
# TODO: delete support from overrides
# - (Y) override to null from defaults list
# - (Y) Support delete by group
# - (Y) Support delete by group=value
# - (Y) Test deletion with a specific package
# - (Y) Deletion test with final defaults list
# TODO: Error handling:
# - (Y) Error handling for overrides that did not match any config group in the defaults list
# - (Y) Error if delete override did not delete anything
# - (Y) Duplicate _self_ error
# - (Y) test handling missing configs mentioned in defaults list
# - (Y) Ambiguous overrides should provide valid override keys for group
# - (Y) Test deprecation message when attempting to override hydra configs without override
# - (Y) duplicate entries in final defaults list raises an error
# TODO: Integration
# - (Y) replace old defaults list computation
# - (Y) enable --info=defaults output
# - (Y) ensure all tests are passing
# - (Y) implement --info=defaults-tree output

# TODO: Followup items
# - (Y) 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
# - (Y) Consider override style of: - override hydra/launcher: submitit
# - (Y) Profile and optimize default tree composition: speed in line with 1.0
# - (Y) Fix error message when overriding a non-existing config group from the command line to not say "append with +"
# - (Y) Profile and optimize default tree composition: speed in line with 1.0
# - (Y) Test cases when config group name matches a keyword (optional, override)
# - (Y) Clean up sporadic TODOs in the code

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


# 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


# 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 automatic schema support in favor of extending a config via recursive defaults
# - Document --info defaults and --info defaults-tree
# - Document hydra.choices
# - Add news fragments for user facing features


# TODO: Followup items to explore
# - Consider deprecating automatic schema support in favor of extending a config via recursive defaults
>>>>>>> e19da87be... added hydra.choices node


@mark.parametrize( # type: ignore
"config_path,expected_list",
[
Expand Down
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 cbd055f

Please sign in to comment.