hydra-core 1.3.3__tar.gz → 1.4.0.dev3__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {hydra_core-1.3.3/hydra_core.egg-info → hydra_core-1.4.0.dev3}/PKG-INFO +37 -47
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/README.md +30 -40
- hydra_core-1.4.0.dev3/build_helpers/bin/antlr-4.11.1-complete.jar +0 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/build_helpers/build_helpers.py +36 -3
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/build_helpers/test_helpers.py +2 -2
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/__init__.py +1 -1
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/_internal/callbacks.py +46 -2
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/_internal/config_loader_impl.py +31 -24
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/_internal/config_repository.py +10 -19
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/_internal/core_plugins/basic_sweeper.py +4 -2
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/_internal/core_plugins/importlib_resources_config_source.py +10 -16
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/_internal/core_plugins/structured_config_source.py +4 -6
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/_internal/core_plugins/zsh_completion.py +1 -1
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/_internal/defaults_list.py +14 -30
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/_internal/grammar/grammar_functions.py +47 -1
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/_internal/hydra.py +69 -11
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/_internal/instantiate/_instantiate2.py +114 -12
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/_internal/utils.py +30 -7
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/compose.py +2 -6
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/core/config_loader.py +7 -14
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/core/config_search_path.py +1 -2
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/core/config_store.py +3 -4
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/core/default_element.py +7 -6
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/core/override_parser/overrides_parser.py +9 -3
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/core/override_parser/overrides_visitor.py +43 -25
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/core/override_parser/types.py +29 -13
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/core/plugins.py +2 -1
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/core/singleton.py +1 -1
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/core/utils.py +4 -8
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/errors.py +8 -14
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/experimental/callback.py +13 -1
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/experimental/callbacks.py +47 -2
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/experimental/initialize.py +7 -2
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/extra/pytest_plugin.py +24 -28
- hydra_core-1.4.0.dev3/hydra/grammar/gen/OverrideLexer.interp +102 -0
- hydra_core-1.4.0.dev3/hydra/grammar/gen/OverrideLexer.py +228 -0
- hydra_core-1.4.0.dev3/hydra/grammar/gen/OverrideParser.interp +75 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/grammar/gen/OverrideParser.py +87 -94
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/grammar/gen/OverrideParserListener.py +2 -2
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/grammar/gen/OverrideParserVisitor.py +2 -2
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/initialize.py +5 -10
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/main.py +2 -4
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/plugins/completion_plugin.py +10 -11
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/plugins/config_source.py +3 -6
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/plugins/launcher.py +1 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/plugins/plugin.py +1 -2
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/plugins/search_path_plugin.py +1 -2
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/plugins/sweeper.py +1 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/test_utils/launcher_common_tests.py +4 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/test_utils/test_utils.py +9 -17
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/utils.py +31 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/version.py +7 -5
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3/hydra_core.egg-info}/PKG-INFO +37 -47
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra_core.egg-info/SOURCES.txt +1 -1
- hydra_core-1.4.0.dev3/hydra_core.egg-info/requires.txt +2 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/pyproject.toml +34 -2
- hydra_core-1.4.0.dev3/requirements/requirements.txt +2 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/setup.py +5 -4
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/tests/test_basic_launcher.py +1 -2
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/tests/test_basic_sweeper.py +5 -11
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/tests/test_callbacks.py +32 -19
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/tests/test_completion.py +10 -4
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/tests/test_compose.py +68 -13
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/tests/test_config_loader.py +23 -21
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/tests/test_config_repository.py +1 -6
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/tests/test_core_utils.py +4 -4
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/tests/test_env_defaults.py +1 -1
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/tests/test_hydra.py +129 -152
- hydra_core-1.4.0.dev3/tests/test_hydra_cli_errors.py +116 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/tests/test_hydra_context_warnings.py +3 -5
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/tests/test_overrides_parser.py +166 -14
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/tests/test_plugin_interface.py +2 -4
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/tests/test_utils.py +43 -24
- hydra_core-1.3.3/build_helpers/bin/antlr-4.9.3-complete.jar +0 -0
- hydra_core-1.3.3/hydra/grammar/gen/OverrideLexer.interp +0 -102
- hydra_core-1.3.3/hydra/grammar/gen/OverrideLexer.py +0 -266
- hydra_core-1.3.3/hydra/grammar/gen/OverrideParser.interp +0 -75
- hydra_core-1.3.3/hydra_core.egg-info/requires.txt +0 -6
- hydra_core-1.3.3/requirements/requirements.txt +0 -4
- hydra_core-1.3.3/tests/test_hydra_cli_errors.py +0 -81
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/LICENSE +0 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/MANIFEST.in +0 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/build_helpers/__init__.py +0 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/build_helpers/bin/__init__.py +0 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/_internal/__init__.py +0 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/_internal/config_search_path_impl.py +0 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/_internal/core_plugins/__init__.py +0 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/_internal/core_plugins/bash_completion.py +0 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/_internal/core_plugins/basic_launcher.py +0 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/_internal/core_plugins/file_config_source.py +0 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/_internal/core_plugins/fish_completion.py +0 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/_internal/deprecation_warning.py +0 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/_internal/grammar/__init__.py +0 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/_internal/grammar/functions.py +0 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/_internal/grammar/utils.py +0 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/_internal/instantiate/__init__.py +0 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/_internal/sources_registry.py +0 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/conf/__init__.py +0 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/conf/hydra/env/default.yaml +0 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/conf/hydra/help/default.yaml +0 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/conf/hydra/hydra_help/default.yaml +0 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/conf/hydra/hydra_logging/default.yaml +0 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/conf/hydra/hydra_logging/disabled.yaml +0 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/conf/hydra/hydra_logging/hydra_debug.yaml +0 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/conf/hydra/hydra_logging/none.yaml +0 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/conf/hydra/job_logging/default.yaml +0 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/conf/hydra/job_logging/disabled.yaml +0 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/conf/hydra/job_logging/none.yaml +0 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/conf/hydra/job_logging/stdout.yaml +0 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/conf/hydra/output/default.yaml +0 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/core/__init__.py +0 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/core/global_hydra.py +0 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/core/hydra_config.py +0 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/core/object_type.py +0 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/core/override_parser/__init__.py +0 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/experimental/__init__.py +0 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/experimental/compose.py +0 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/grammar/.gitignore +0 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/grammar/OverrideLexer.g4 +0 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/grammar/OverrideParser.g4 +0 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/grammar/__init__.py +0 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/grammar/gen/.gitignore +0 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/grammar/gen/OverrideLexer.tokens +0 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/grammar/gen/OverrideParser.tokens +0 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/plugins/__init__.py +0 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/py.typed +0 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/test_utils/__init__.py +0 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/test_utils/a_module.py +0 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/test_utils/completion.py +0 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/test_utils/config_source_common_tests.py +0 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/test_utils/configs/__init__.py +0 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/test_utils/configs/accessing_hydra_config.yaml +0 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/test_utils/configs/completion_test/additional_searchpath.yaml +0 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/test_utils/configs/completion_test/config.yaml +0 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/test_utils/configs/completion_test/group/dict.yaml +0 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/test_utils/configs/completion_test/group/list.yaml +0 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/test_utils/configs/completion_test/hydra/launcher/fairtask.yaml +0 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/test_utils/configs/completion_test/missing_default.yaml +0 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/test_utils/configs/completion_test/test_hydra/launcher/fairtask.yaml +0 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/test_utils/configs/completion_test_additional_file/additional_group/file_opt_additional.yaml +0 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/test_utils/configs/completion_test_additional_file/group/file_opt.yaml +0 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/test_utils/configs/completion_test_additional_package/__init__.py +0 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/test_utils/configs/completion_test_additional_package/additional_group/pkg_opt_additional.yaml +0 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/test_utils/configs/completion_test_additional_package/group/pkg_opt.yaml +0 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/test_utils/configs/compose.yaml +0 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/test_utils/configs/conf.zip +0 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/test_utils/configs/config.yaml +0 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/test_utils/configs/config.yml +0 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/test_utils/configs/custom_resolver.yaml +0 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/test_utils/configs/db/mysql.yaml +0 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/test_utils/configs/db/postgresql.yaml +0 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/test_utils/configs/db/validated_mysql.yaml +0 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/test_utils/configs/db/validated_postgresql.yaml +0 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/test_utils/configs/db_conf.yaml +0 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/test_utils/configs/defaults_not_list.yaml +0 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/test_utils/configs/group1/abc.cde.yaml +0 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/test_utils/configs/group1/file1.yaml +0 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/test_utils/configs/group1/file2.yaml +0 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/test_utils/configs/group2/file1.yaml +0 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/test_utils/configs/group2/file2.yaml +0 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/test_utils/configs/missing-default.yaml +0 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/test_utils/configs/missing-optional-default.yaml +0 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/test_utils/configs/missing_init_py/.gitignore +0 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/test_utils/configs/missing_init_py/test.yaml +0 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/test_utils/configs/optional-default.yaml +0 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/test_utils/configs/overriding_output_dir.yaml +0 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/test_utils/configs/overriding_run_dir.yaml +0 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/test_utils/configs/package_tests/__init__.py +0 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/test_utils/configs/package_tests/group1/option1.yaml +0 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/test_utils/configs/package_tests/group1/option2.yaml +0 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/test_utils/configs/package_tests/group2/option1.yaml +0 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/test_utils/configs/package_tests/group2/option2.yaml +0 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/test_utils/configs/package_tests/pkg_override.yaml +0 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/test_utils/configs/package_tests/two_packages_one_group.yaml +0 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/test_utils/configs/schema_key_error.yaml +0 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/test_utils/configs/schema_validation_error.yaml +0 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/test_utils/configs/some_config.yaml +0 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/test_utils/configs/top_level_list/file1.yaml +0 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/test_utils/configs/unspecified_mandatory_default.yaml +0 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/test_utils/example_app.py +0 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra/types.py +0 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra_core.egg-info/dependency_links.txt +0 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra_core.egg-info/entry_points.txt +0 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/hydra_core.egg-info/top_level.txt +0 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/setup.cfg +0 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/tests/test_config_search_path.py +0 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/tests/test_errors.py +0 -0
- {hydra_core-1.3.3 → hydra_core-1.4.0.dev3}/tests/test_internal_utils.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: hydra-core
|
|
3
|
-
Version: 1.
|
|
3
|
+
Version: 1.4.0.dev3
|
|
4
4
|
Summary: A framework for elegantly configuring complex applications
|
|
5
5
|
Home-page: https://github.com/facebookresearch/hydra
|
|
6
6
|
Author: Omry Yadan
|
|
@@ -9,19 +9,18 @@ License: MIT
|
|
|
9
9
|
Keywords: command-line configuration yaml tab-completion
|
|
10
10
|
Classifier: License :: OSI Approved :: MIT License
|
|
11
11
|
Classifier: Development Status :: 4 - Beta
|
|
12
|
-
Classifier: Programming Language :: Python :: 3.7
|
|
13
|
-
Classifier: Programming Language :: Python :: 3.8
|
|
14
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
15
12
|
Classifier: Programming Language :: Python :: 3.10
|
|
16
13
|
Classifier: Programming Language :: Python :: 3.11
|
|
14
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
15
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
17
17
|
Classifier: Operating System :: POSIX :: Linux
|
|
18
18
|
Classifier: Operating System :: MacOS
|
|
19
19
|
Classifier: Operating System :: Microsoft :: Windows
|
|
20
|
+
Requires-Python: >=3.10
|
|
20
21
|
Description-Content-Type: text/markdown
|
|
21
22
|
License-File: LICENSE
|
|
22
|
-
Requires-Dist: omegaconf
|
|
23
|
-
Requires-Dist: antlr4-python3-runtime==4.9.*
|
|
24
|
-
Requires-Dist: importlib-resources; python_version < "3.9"
|
|
23
|
+
Requires-Dist: omegaconf>=2.4.0.dev11
|
|
25
24
|
Requires-Dist: packaging
|
|
26
25
|
Dynamic: author
|
|
27
26
|
Dynamic: author-email
|
|
@@ -33,54 +32,46 @@ Dynamic: keywords
|
|
|
33
32
|
Dynamic: license
|
|
34
33
|
Dynamic: license-file
|
|
35
34
|
Dynamic: requires-dist
|
|
35
|
+
Dynamic: requires-python
|
|
36
36
|
Dynamic: summary
|
|
37
37
|
|
|
38
|
-
<p align="center"><img src="https://raw.githubusercontent.com/facebookresearch/hydra/
|
|
38
|
+
<p align="center"><img src="https://raw.githubusercontent.com/facebookresearch/hydra/main/website/static/img/Hydra-Readme-logo2.svg" alt="logo" width="70%" /></p>
|
|
39
39
|
|
|
40
40
|
<p align="center">
|
|
41
|
-
<a href="https://pypi.org/project/hydra-core/">
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
<a href="https://
|
|
45
|
-
<img src="https://img.shields.io/circleci/build/github/facebookresearch/hydra?token=af199cd2deca9e70e53776f9ded96284b10687e9" alt="CircleCI" />
|
|
46
|
-
</a>
|
|
47
|
-
<a href="#">
|
|
48
|
-
<img src="https://img.shields.io/pypi/l/hydra-core" alt="PyPI - License" />
|
|
49
|
-
</a>
|
|
50
|
-
<a href="#">
|
|
51
|
-
<img src="https://img.shields.io/pypi/pyversions/hydra-core" alt="PyPI - Python Version" />
|
|
52
|
-
</a>
|
|
53
|
-
<a href="https://pepy.tech/project/hydra-core?versions=0.11.*&versions=1.0.*&versions=1.1.*">
|
|
54
|
-
<img src="https://pepy.tech/badge/hydra-core/month" alt="Downloads" />
|
|
55
|
-
</a>
|
|
56
|
-
<a href="https://github.com/psf/black">
|
|
57
|
-
<img src="https://img.shields.io/badge/code%20style-black-000000.svg" alt="Code style: black" />
|
|
58
|
-
</a>
|
|
59
|
-
<a href="https://lgtm.com/projects/g/facebookresearch/hydra/alerts/">
|
|
60
|
-
<img src="https://img.shields.io/lgtm/alerts/g/facebookresearch/hydra.svg?logo=lgtm&logoWidth=18" alt="Total alerts" />
|
|
61
|
-
</a>
|
|
62
|
-
<a href="https://lgtm.com/projects/g/facebookresearch/hydra/context:python">
|
|
63
|
-
<img src="https://img.shields.io/lgtm/grade/python/g/facebookresearch/hydra.svg?logo=lgtm&logoWidth=18" alt="Language grade: Python" />
|
|
64
|
-
</a>
|
|
65
|
-
<p align="center">
|
|
66
|
-
<i>A framework for elegantly configuring complex applications.</i>
|
|
67
|
-
</p>
|
|
68
|
-
<p align="center">
|
|
69
|
-
<i>Check the <a href="https://hydra.cc/">website</a> for more information,<br>
|
|
70
|
-
or click the thumbnail below for a one-minute video introduction to Hydra.</i>
|
|
71
|
-
</p>
|
|
72
|
-
<p align="center">
|
|
73
|
-
<a href="http://www.youtube.com/watch?feature=player_embedded&v=Slc3gRQpnBI" target="_blank">
|
|
74
|
-
<img src="http://img.youtube.com/vi/Slc3gRQpnBI/hqdefault.jpg" alt="1 minute overview" width="240" height="180" border="10" />
|
|
75
|
-
</a>
|
|
76
|
-
</p>
|
|
41
|
+
<a href="https://pypi.org/project/hydra-core/"><img src="https://img.shields.io/pypi/v/hydra-core" alt="PyPI" /></a>
|
|
42
|
+
<a href="#"><img src="https://img.shields.io/pypi/pyversions/hydra-core" alt="PyPI - Python Version" /></a>
|
|
43
|
+
<a href="https://github.com/facebookresearch/hydra/actions/workflows/core_tests.yml"><img src="https://github.com/facebookresearch/hydra/actions/workflows/core_tests.yml/badge.svg?branch=main" alt="GitHub Actions build" /></a>
|
|
44
|
+
<a href="https://www.pepy.tech/projects/hydra-core?versions=0.11.*&versions=1.0.*&versions=1.1.*&versions=1.2.*&versions=1.3.*&versions=1.4.*"><img src="https://pepy.tech/badge/hydra-core/month" alt="Downloads" /></a>
|
|
77
45
|
</p>
|
|
78
46
|
|
|
79
|
-
|
|
47
|
+
<p align="center">
|
|
48
|
+
<a href="https://github.com/facebookresearch/hydra/blob/main/LICENSE"><img src="https://img.shields.io/pypi/l/hydra-core" alt="PyPI - License" /></a>
|
|
49
|
+
<a href="https://hydra-framework.zulipchat.com/"><img src="https://img.shields.io/badge/zulip-join_chat-brightgreen.svg" alt="Zulip chat" /></a>
|
|
50
|
+
<a href="https://github.com/psf/black"><img src="https://img.shields.io/badge/code%20style-black-000000.svg" alt="Code style: black" /></a>
|
|
51
|
+
</p>
|
|
52
|
+
|
|
53
|
+
<p align="center">
|
|
54
|
+
<i>A framework for elegantly configuring complex applications.</i>
|
|
55
|
+
</p>
|
|
56
|
+
<p align="center">
|
|
57
|
+
<i>Check the <a href="https://hydra.cc/">website</a> for more information,<br>
|
|
58
|
+
or click the thumbnail below for a one-minute video introduction to Hydra.</i>
|
|
59
|
+
</p>
|
|
60
|
+
<p align="center">
|
|
61
|
+
<a href="https://www.youtube.com/watch?v=Slc3gRQpnBI" target="_blank"><img src="https://raw.githubusercontent.com/facebookresearch/hydra/main/website/static/img/Hydra-Readme-video-thumbnail.jpg" alt="1 minute overview" width="240" height="180" border="10" /></a>
|
|
62
|
+
</p>
|
|
80
63
|
|
|
64
|
+
----------------------
|
|
81
65
|
|
|
82
66
|
### Releases
|
|
83
67
|
|
|
68
|
+
#### Development
|
|
69
|
+
|
|
70
|
+
**Hydra 1.4** is the current development version of Hydra.
|
|
71
|
+
- [Documentation](https://hydra.cc/docs/intro/)
|
|
72
|
+
- Installation from source : `pip install git+https://github.com/facebookresearch/hydra.git`
|
|
73
|
+
- Supported Python versions: 3.10 through 3.14.
|
|
74
|
+
|
|
84
75
|
#### Stable
|
|
85
76
|
|
|
86
77
|
**Hydra 1.3** is the stable version of Hydra.
|
|
@@ -103,7 +94,7 @@ Hydra is licensed under [MIT License](LICENSE).
|
|
|
103
94
|
#### Ask questions in Github Discussions or StackOverflow (Use the tag #fb-hydra or #omegaconf):
|
|
104
95
|
* [Github Discussions](https://github.com/facebookresearch/hydra/discussions)
|
|
105
96
|
* [StackOverflow](https://stackexchange.com/filters/391828/hydra-questions)
|
|
106
|
-
* [
|
|
97
|
+
* [X](https://twitter.com/Hydra_Framework)
|
|
107
98
|
|
|
108
99
|
Check out the Meta AI [blog post](https://ai.facebook.com/blog/reengineering-facebook-ais-deep-learning-platforms-for-interoperability/) to learn about how Hydra fits into Meta's efforts to reengineer deep learning platforms for interoperability.
|
|
109
100
|
|
|
@@ -118,4 +109,3 @@ If you use Hydra in your research please use the following BibTeX entry:
|
|
|
118
109
|
url = {https://github.com/facebookresearch/hydra}
|
|
119
110
|
}
|
|
120
111
|
```
|
|
121
|
-
|
|
@@ -1,49 +1,40 @@
|
|
|
1
|
-
<p align="center"><img src="https://raw.githubusercontent.com/facebookresearch/hydra/
|
|
1
|
+
<p align="center"><img src="https://raw.githubusercontent.com/facebookresearch/hydra/main/website/static/img/Hydra-Readme-logo2.svg" alt="logo" width="70%" /></p>
|
|
2
2
|
|
|
3
3
|
<p align="center">
|
|
4
|
-
<a href="https://pypi.org/project/hydra-core/">
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
<a href="https://
|
|
8
|
-
<img src="https://img.shields.io/circleci/build/github/facebookresearch/hydra?token=af199cd2deca9e70e53776f9ded96284b10687e9" alt="CircleCI" />
|
|
9
|
-
</a>
|
|
10
|
-
<a href="#">
|
|
11
|
-
<img src="https://img.shields.io/pypi/l/hydra-core" alt="PyPI - License" />
|
|
12
|
-
</a>
|
|
13
|
-
<a href="#">
|
|
14
|
-
<img src="https://img.shields.io/pypi/pyversions/hydra-core" alt="PyPI - Python Version" />
|
|
15
|
-
</a>
|
|
16
|
-
<a href="https://pepy.tech/project/hydra-core?versions=0.11.*&versions=1.0.*&versions=1.1.*">
|
|
17
|
-
<img src="https://pepy.tech/badge/hydra-core/month" alt="Downloads" />
|
|
18
|
-
</a>
|
|
19
|
-
<a href="https://github.com/psf/black">
|
|
20
|
-
<img src="https://img.shields.io/badge/code%20style-black-000000.svg" alt="Code style: black" />
|
|
21
|
-
</a>
|
|
22
|
-
<a href="https://lgtm.com/projects/g/facebookresearch/hydra/alerts/">
|
|
23
|
-
<img src="https://img.shields.io/lgtm/alerts/g/facebookresearch/hydra.svg?logo=lgtm&logoWidth=18" alt="Total alerts" />
|
|
24
|
-
</a>
|
|
25
|
-
<a href="https://lgtm.com/projects/g/facebookresearch/hydra/context:python">
|
|
26
|
-
<img src="https://img.shields.io/lgtm/grade/python/g/facebookresearch/hydra.svg?logo=lgtm&logoWidth=18" alt="Language grade: Python" />
|
|
27
|
-
</a>
|
|
28
|
-
<p align="center">
|
|
29
|
-
<i>A framework for elegantly configuring complex applications.</i>
|
|
30
|
-
</p>
|
|
31
|
-
<p align="center">
|
|
32
|
-
<i>Check the <a href="https://hydra.cc/">website</a> for more information,<br>
|
|
33
|
-
or click the thumbnail below for a one-minute video introduction to Hydra.</i>
|
|
34
|
-
</p>
|
|
35
|
-
<p align="center">
|
|
36
|
-
<a href="http://www.youtube.com/watch?feature=player_embedded&v=Slc3gRQpnBI" target="_blank">
|
|
37
|
-
<img src="http://img.youtube.com/vi/Slc3gRQpnBI/hqdefault.jpg" alt="1 minute overview" width="240" height="180" border="10" />
|
|
38
|
-
</a>
|
|
39
|
-
</p>
|
|
4
|
+
<a href="https://pypi.org/project/hydra-core/"><img src="https://img.shields.io/pypi/v/hydra-core" alt="PyPI" /></a>
|
|
5
|
+
<a href="#"><img src="https://img.shields.io/pypi/pyversions/hydra-core" alt="PyPI - Python Version" /></a>
|
|
6
|
+
<a href="https://github.com/facebookresearch/hydra/actions/workflows/core_tests.yml"><img src="https://github.com/facebookresearch/hydra/actions/workflows/core_tests.yml/badge.svg?branch=main" alt="GitHub Actions build" /></a>
|
|
7
|
+
<a href="https://www.pepy.tech/projects/hydra-core?versions=0.11.*&versions=1.0.*&versions=1.1.*&versions=1.2.*&versions=1.3.*&versions=1.4.*"><img src="https://pepy.tech/badge/hydra-core/month" alt="Downloads" /></a>
|
|
40
8
|
</p>
|
|
41
9
|
|
|
42
|
-
|
|
10
|
+
<p align="center">
|
|
11
|
+
<a href="https://github.com/facebookresearch/hydra/blob/main/LICENSE"><img src="https://img.shields.io/pypi/l/hydra-core" alt="PyPI - License" /></a>
|
|
12
|
+
<a href="https://hydra-framework.zulipchat.com/"><img src="https://img.shields.io/badge/zulip-join_chat-brightgreen.svg" alt="Zulip chat" /></a>
|
|
13
|
+
<a href="https://github.com/psf/black"><img src="https://img.shields.io/badge/code%20style-black-000000.svg" alt="Code style: black" /></a>
|
|
14
|
+
</p>
|
|
15
|
+
|
|
16
|
+
<p align="center">
|
|
17
|
+
<i>A framework for elegantly configuring complex applications.</i>
|
|
18
|
+
</p>
|
|
19
|
+
<p align="center">
|
|
20
|
+
<i>Check the <a href="https://hydra.cc/">website</a> for more information,<br>
|
|
21
|
+
or click the thumbnail below for a one-minute video introduction to Hydra.</i>
|
|
22
|
+
</p>
|
|
23
|
+
<p align="center">
|
|
24
|
+
<a href="https://www.youtube.com/watch?v=Slc3gRQpnBI" target="_blank"><img src="https://raw.githubusercontent.com/facebookresearch/hydra/main/website/static/img/Hydra-Readme-video-thumbnail.jpg" alt="1 minute overview" width="240" height="180" border="10" /></a>
|
|
25
|
+
</p>
|
|
43
26
|
|
|
27
|
+
----------------------
|
|
44
28
|
|
|
45
29
|
### Releases
|
|
46
30
|
|
|
31
|
+
#### Development
|
|
32
|
+
|
|
33
|
+
**Hydra 1.4** is the current development version of Hydra.
|
|
34
|
+
- [Documentation](https://hydra.cc/docs/intro/)
|
|
35
|
+
- Installation from source : `pip install git+https://github.com/facebookresearch/hydra.git`
|
|
36
|
+
- Supported Python versions: 3.10 through 3.14.
|
|
37
|
+
|
|
47
38
|
#### Stable
|
|
48
39
|
|
|
49
40
|
**Hydra 1.3** is the stable version of Hydra.
|
|
@@ -66,7 +57,7 @@ Hydra is licensed under [MIT License](LICENSE).
|
|
|
66
57
|
#### Ask questions in Github Discussions or StackOverflow (Use the tag #fb-hydra or #omegaconf):
|
|
67
58
|
* [Github Discussions](https://github.com/facebookresearch/hydra/discussions)
|
|
68
59
|
* [StackOverflow](https://stackexchange.com/filters/391828/hydra-questions)
|
|
69
|
-
* [
|
|
60
|
+
* [X](https://twitter.com/Hydra_Framework)
|
|
70
61
|
|
|
71
62
|
Check out the Meta AI [blog post](https://ai.facebook.com/blog/reengineering-facebook-ais-deep-learning-platforms-for-interoperability/) to learn about how Hydra fits into Meta's efforts to reengineer deep learning platforms for interoperability.
|
|
72
63
|
|
|
@@ -81,4 +72,3 @@ If you use Hydra in your research please use the following BibTeX entry:
|
|
|
81
72
|
url = {https://github.com/facebookresearch/hydra}
|
|
82
73
|
}
|
|
83
74
|
```
|
|
84
|
-
|
|
Binary file
|
|
@@ -6,7 +6,9 @@ import os
|
|
|
6
6
|
import re
|
|
7
7
|
import shutil
|
|
8
8
|
import subprocess
|
|
9
|
+
from functools import partial
|
|
9
10
|
from os.path import abspath, basename, dirname, exists, isdir, join
|
|
11
|
+
from pathlib import Path
|
|
10
12
|
from typing import List, Optional
|
|
11
13
|
|
|
12
14
|
from setuptools import Command
|
|
@@ -154,15 +156,17 @@ class BuildPyCommand(build_py.build_py):
|
|
|
154
156
|
|
|
155
157
|
|
|
156
158
|
class Develop(develop.develop):
|
|
157
|
-
def run(self) -> None:
|
|
159
|
+
def run(self) -> None:
|
|
158
160
|
if not self.dry_run:
|
|
159
161
|
run_antlr(self)
|
|
160
162
|
develop.develop.run(self)
|
|
161
163
|
|
|
162
164
|
|
|
163
165
|
class SDistCommand(sdist.sdist):
|
|
166
|
+
dry_run: bool
|
|
167
|
+
|
|
164
168
|
def run(self) -> None:
|
|
165
|
-
if not self.dry_run:
|
|
169
|
+
if not self.dry_run:
|
|
166
170
|
self.run_command("clean")
|
|
167
171
|
run_antlr(self)
|
|
168
172
|
sdist.sdist.run(self)
|
|
@@ -185,7 +189,7 @@ class ANTLRCommand(Command): # type: ignore
|
|
|
185
189
|
command = [
|
|
186
190
|
"java",
|
|
187
191
|
"-jar",
|
|
188
|
-
join(root_dir, "bin/antlr-4.
|
|
192
|
+
join(root_dir, "bin/antlr-4.11.1-complete.jar"),
|
|
189
193
|
"-Dlanguage=Python3",
|
|
190
194
|
"-o",
|
|
191
195
|
join(project_root, "hydra/grammar/gen/"),
|
|
@@ -198,8 +202,37 @@ class ANTLRCommand(Command): # type: ignore
|
|
|
198
202
|
|
|
199
203
|
subprocess.check_call(command)
|
|
200
204
|
|
|
205
|
+
log.info("Replacing imports of antlr4 in generated parsers")
|
|
206
|
+
self._fix_imports()
|
|
207
|
+
|
|
201
208
|
def initialize_options(self) -> None:
|
|
202
209
|
pass
|
|
203
210
|
|
|
204
211
|
def finalize_options(self) -> None:
|
|
205
212
|
pass
|
|
213
|
+
|
|
214
|
+
def _fix_imports(self) -> None:
|
|
215
|
+
"""Fix imports from the generated parsers to use the vendored antlr4 instead"""
|
|
216
|
+
build_dir = Path(__file__).parent.absolute()
|
|
217
|
+
project_root = build_dir.parent
|
|
218
|
+
lib = "antlr4"
|
|
219
|
+
pkgname = "omegaconf.vendor"
|
|
220
|
+
|
|
221
|
+
replacements = [
|
|
222
|
+
partial( # import antlr4 -> import omegaconf.vendor.antlr4
|
|
223
|
+
re.compile(r"(^\s*)import {}\n".format(lib), flags=re.M).sub,
|
|
224
|
+
r"\1from {} import {}\n".format(pkgname, lib),
|
|
225
|
+
),
|
|
226
|
+
partial( # from antlr4 -> from fomegaconf.vendor.antlr4
|
|
227
|
+
re.compile(r"(^\s*)from {}(\.|\s+)".format(lib), flags=re.M).sub,
|
|
228
|
+
r"\1from {}.{}\2".format(pkgname, lib),
|
|
229
|
+
),
|
|
230
|
+
]
|
|
231
|
+
|
|
232
|
+
path = project_root / "hydra" / "grammar" / "gen"
|
|
233
|
+
for item in path.iterdir():
|
|
234
|
+
if item.is_file() and item.name.endswith(".py"):
|
|
235
|
+
text = item.read_text("utf8")
|
|
236
|
+
for replacement in replacements:
|
|
237
|
+
text = replacement(text)
|
|
238
|
+
item.write_text(text, "utf8")
|
|
@@ -112,8 +112,8 @@ def test_find(
|
|
|
112
112
|
scan_exclude=scan_exclude,
|
|
113
113
|
)
|
|
114
114
|
|
|
115
|
-
ret_set =
|
|
116
|
-
expected_set =
|
|
115
|
+
ret_set = {str(Path(x)) for x in ret}
|
|
116
|
+
expected_set = {str(Path(x)) for x in expected}
|
|
117
117
|
assert ret_set == expected_set
|
|
118
118
|
|
|
119
119
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
|
|
2
2
|
|
|
3
3
|
# Source of truth for Hydra's version
|
|
4
|
-
__version__ = "1.
|
|
4
|
+
__version__ = "1.4.0.dev3"
|
|
5
5
|
from hydra import utils
|
|
6
6
|
from hydra.errors import MissingConfigException
|
|
7
7
|
from hydra.main import main
|
|
@@ -1,23 +1,54 @@
|
|
|
1
1
|
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
|
|
2
2
|
import warnings
|
|
3
|
-
from typing import TYPE_CHECKING, Any, Optional
|
|
3
|
+
from typing import TYPE_CHECKING, Any, Dict, List, Optional
|
|
4
4
|
|
|
5
5
|
from omegaconf import DictConfig, OmegaConf
|
|
6
6
|
|
|
7
|
+
from hydra.core.singleton import Singleton
|
|
7
8
|
from hydra.types import TaskFunction
|
|
8
9
|
|
|
9
10
|
if TYPE_CHECKING:
|
|
10
11
|
from hydra.core.utils import JobReturn
|
|
11
12
|
|
|
12
13
|
|
|
14
|
+
class CallbacksCache(metaclass=Singleton):
|
|
15
|
+
"""
|
|
16
|
+
A singleton class to cache callbacks so they are not reinstantiated during
|
|
17
|
+
compose config and start run.
|
|
18
|
+
"""
|
|
19
|
+
|
|
20
|
+
@staticmethod
|
|
21
|
+
def instance() -> "CallbacksCache":
|
|
22
|
+
return Singleton.instance(CallbacksCache) # type: ignore
|
|
23
|
+
|
|
24
|
+
cache: Dict[int, "Callbacks"]
|
|
25
|
+
|
|
26
|
+
def __init__(self) -> None:
|
|
27
|
+
self.cache = {}
|
|
28
|
+
|
|
29
|
+
|
|
13
30
|
class Callbacks:
|
|
14
|
-
|
|
31
|
+
callbacks: List[Any]
|
|
32
|
+
|
|
33
|
+
def __init__(
|
|
34
|
+
self, config: Optional[DictConfig] = None, check_cache: bool = True
|
|
35
|
+
) -> None:
|
|
36
|
+
if config is None:
|
|
37
|
+
return
|
|
38
|
+
cache = CallbacksCache.instance().cache
|
|
39
|
+
if check_cache:
|
|
40
|
+
cached_callback = cache.get(id(config))
|
|
41
|
+
if cached_callback is not None:
|
|
42
|
+
self.callbacks = cached_callback.callbacks
|
|
43
|
+
return
|
|
44
|
+
|
|
15
45
|
self.callbacks = []
|
|
16
46
|
from hydra.utils import instantiate
|
|
17
47
|
|
|
18
48
|
if config is not None and OmegaConf.select(config, "hydra.callbacks"):
|
|
19
49
|
for params in config.hydra.callbacks.values():
|
|
20
50
|
self.callbacks.append(instantiate(params))
|
|
51
|
+
cache[id(config)] = self
|
|
21
52
|
|
|
22
53
|
def _notify(self, function_name: str, reverse: bool = False, **kwargs: Any) -> None:
|
|
23
54
|
callbacks = reversed(self.callbacks) if reverse else self.callbacks
|
|
@@ -63,3 +94,16 @@ class Callbacks:
|
|
|
63
94
|
reverse=True,
|
|
64
95
|
**kwargs,
|
|
65
96
|
)
|
|
97
|
+
|
|
98
|
+
def on_compose_config(
|
|
99
|
+
self,
|
|
100
|
+
config: DictConfig,
|
|
101
|
+
config_name: Optional[str],
|
|
102
|
+
overrides: List[str],
|
|
103
|
+
) -> None:
|
|
104
|
+
self._notify(
|
|
105
|
+
function_name="on_compose_config",
|
|
106
|
+
config=config,
|
|
107
|
+
config_name=config_name,
|
|
108
|
+
overrides=overrides,
|
|
109
|
+
)
|
|
@@ -5,9 +5,16 @@ import re
|
|
|
5
5
|
import sys
|
|
6
6
|
import warnings
|
|
7
7
|
from textwrap import dedent
|
|
8
|
-
from typing import Any, List, MutableSequence, Optional, Tuple
|
|
9
|
-
|
|
10
|
-
from omegaconf import
|
|
8
|
+
from typing import Any, List, MutableSequence, Optional, Tuple, Union
|
|
9
|
+
|
|
10
|
+
from omegaconf import (
|
|
11
|
+
Container,
|
|
12
|
+
DictConfig,
|
|
13
|
+
ListConfig,
|
|
14
|
+
OmegaConf,
|
|
15
|
+
flag_override,
|
|
16
|
+
open_dict,
|
|
17
|
+
)
|
|
11
18
|
from omegaconf.errors import (
|
|
12
19
|
ConfigAttributeError,
|
|
13
20
|
ConfigKeyError,
|
|
@@ -69,13 +76,11 @@ class ConfigLoaderImpl(ConfigLoader):
|
|
|
69
76
|
else:
|
|
70
77
|
example_override = f"key='{vals}'"
|
|
71
78
|
|
|
72
|
-
msg = dedent(
|
|
73
|
-
f"""\
|
|
79
|
+
msg = dedent(f"""\
|
|
74
80
|
Ambiguous value for argument '{x.input_line}'
|
|
75
81
|
1. To use it as a list, use key=[value1,value2]
|
|
76
82
|
2. To use it as string, quote the value: {example_override}
|
|
77
|
-
3. To sweep over it, add --multirun to your command line"""
|
|
78
|
-
)
|
|
83
|
+
3. To sweep over it, add --multirun to your command line""")
|
|
79
84
|
raise ConfigCompositionException(msg)
|
|
80
85
|
else:
|
|
81
86
|
raise ConfigCompositionException(
|
|
@@ -365,7 +370,10 @@ class ConfigLoaderImpl(ConfigLoader):
|
|
|
365
370
|
del cfg[key]
|
|
366
371
|
else:
|
|
367
372
|
node = OmegaConf.select(cfg, key[0:last_dot])
|
|
368
|
-
|
|
373
|
+
node_key: Union[str, int] = key[last_dot + 1 :]
|
|
374
|
+
if isinstance(node, ListConfig):
|
|
375
|
+
node_key = int(node_key)
|
|
376
|
+
del node[node_key]
|
|
369
377
|
|
|
370
378
|
elif override.is_add():
|
|
371
379
|
if OmegaConf.select(
|
|
@@ -374,17 +382,22 @@ class ConfigLoaderImpl(ConfigLoader):
|
|
|
374
382
|
OmegaConf.update(cfg, key, value, merge=True, force_add=True)
|
|
375
383
|
else:
|
|
376
384
|
assert override.input_line is not None
|
|
377
|
-
raise ConfigCompositionException(
|
|
378
|
-
dedent(
|
|
379
|
-
f"""\
|
|
385
|
+
raise ConfigCompositionException(dedent(f"""\
|
|
380
386
|
Could not append to config. An item is already at '{override.key_or_group}'.
|
|
381
387
|
Either remove + prefix: '{override.input_line[1:]}'
|
|
382
388
|
Or add a second + to add or override '{override.key_or_group}': '+{override.input_line}'
|
|
383
|
-
"""
|
|
384
|
-
)
|
|
385
|
-
)
|
|
389
|
+
"""))
|
|
386
390
|
elif override.is_force_add():
|
|
387
391
|
OmegaConf.update(cfg, key, value, merge=True, force_add=True)
|
|
392
|
+
elif override.is_list_extend():
|
|
393
|
+
config_val = OmegaConf.select(cfg, key, throw_on_missing=True)
|
|
394
|
+
if not OmegaConf.is_list(config_val):
|
|
395
|
+
raise ConfigCompositionException(
|
|
396
|
+
"Could not append to config list. The existing value of"
|
|
397
|
+
f" '{override.key_or_group}' is {config_val} which is not"
|
|
398
|
+
f" a list."
|
|
399
|
+
)
|
|
400
|
+
config_val.extend(value)
|
|
388
401
|
else:
|
|
389
402
|
try:
|
|
390
403
|
OmegaConf.update(cfg, key, value, merge=True)
|
|
@@ -427,25 +440,19 @@ class ConfigLoaderImpl(ConfigLoader):
|
|
|
427
440
|
try:
|
|
428
441
|
url = "https://hydra.cc/docs/1.2/upgrades/1.0_to_1.1/automatic_schema_matching"
|
|
429
442
|
if "defaults" in schema.config:
|
|
430
|
-
raise ConfigCompositionException(
|
|
431
|
-
dedent(
|
|
432
|
-
f"""\
|
|
443
|
+
raise ConfigCompositionException(dedent(f"""\
|
|
433
444
|
'{config_path}' is validated against ConfigStore schema with the same name.
|
|
434
445
|
This behavior is deprecated in Hydra 1.1 and will be removed in Hydra 1.2.
|
|
435
446
|
In addition, the automatically matched schema contains a defaults list.
|
|
436
447
|
This combination is no longer supported.
|
|
437
|
-
See {url} for migration instructions."""
|
|
438
|
-
)
|
|
439
|
-
)
|
|
448
|
+
See {url} for migration instructions."""))
|
|
440
449
|
else:
|
|
441
450
|
deprecation_warning(
|
|
442
|
-
dedent(
|
|
443
|
-
f"""\
|
|
451
|
+
dedent(f"""\
|
|
444
452
|
|
|
445
453
|
'{config_path}' is validated against ConfigStore schema with the same name.
|
|
446
454
|
This behavior is deprecated in Hydra 1.1 and will be removed in Hydra 1.2.
|
|
447
|
-
See {url} for migration instructions."""
|
|
448
|
-
),
|
|
455
|
+
See {url} for migration instructions."""),
|
|
449
456
|
stacklevel=11,
|
|
450
457
|
)
|
|
451
458
|
|
|
@@ -27,34 +27,27 @@ from .sources_registry import SourcesRegistry
|
|
|
27
27
|
|
|
28
28
|
class IConfigRepository(ABC):
|
|
29
29
|
@abstractmethod
|
|
30
|
-
def get_schema_source(self) -> ConfigSource:
|
|
31
|
-
...
|
|
30
|
+
def get_schema_source(self) -> ConfigSource: ...
|
|
32
31
|
|
|
33
32
|
@abstractmethod
|
|
34
|
-
def load_config(self, config_path: str) -> Optional[ConfigResult]:
|
|
35
|
-
...
|
|
33
|
+
def load_config(self, config_path: str) -> Optional[ConfigResult]: ...
|
|
36
34
|
|
|
37
35
|
@abstractmethod
|
|
38
|
-
def group_exists(self, config_path: str) -> bool:
|
|
39
|
-
...
|
|
36
|
+
def group_exists(self, config_path: str) -> bool: ...
|
|
40
37
|
|
|
41
38
|
@abstractmethod
|
|
42
|
-
def config_exists(self, config_path: str) -> bool:
|
|
43
|
-
...
|
|
39
|
+
def config_exists(self, config_path: str) -> bool: ...
|
|
44
40
|
|
|
45
41
|
@abstractmethod
|
|
46
42
|
def get_group_options(
|
|
47
43
|
self, group_name: str, results_filter: Optional[ObjectType] = ObjectType.CONFIG
|
|
48
|
-
) -> List[str]:
|
|
49
|
-
...
|
|
44
|
+
) -> List[str]: ...
|
|
50
45
|
|
|
51
46
|
@abstractmethod
|
|
52
|
-
def get_sources(self) -> List[ConfigSource]:
|
|
53
|
-
...
|
|
47
|
+
def get_sources(self) -> List[ConfigSource]: ...
|
|
54
48
|
|
|
55
49
|
@abstractmethod
|
|
56
|
-
def initialize_sources(self, config_search_path: ConfigSearchPath) -> None:
|
|
57
|
-
...
|
|
50
|
+
def initialize_sources(self, config_search_path: ConfigSearchPath) -> None: ...
|
|
58
51
|
|
|
59
52
|
|
|
60
53
|
class ConfigRepository(IConfigRepository):
|
|
@@ -179,19 +172,17 @@ class ConfigRepository(IConfigRepository):
|
|
|
179
172
|
# DEPRECATED: remove in 1.2
|
|
180
173
|
url = "https://hydra.cc/docs/1.2/upgrades/1.0_to_1.1/changes_to_package_header"
|
|
181
174
|
deprecation_warning(
|
|
182
|
-
message=dedent(
|
|
183
|
-
f"""\
|
|
175
|
+
message=dedent(f"""\
|
|
184
176
|
In {config_path}: Defaults List contains deprecated keyword _name_, see {url}
|
|
185
|
-
"""
|
|
186
|
-
),
|
|
177
|
+
"""),
|
|
187
178
|
)
|
|
188
179
|
|
|
189
180
|
res: List[InputDefault] = []
|
|
190
181
|
for item in defaults._iter_ex(resolve=False):
|
|
191
182
|
default: InputDefault
|
|
192
183
|
if isinstance(item, DictConfig):
|
|
184
|
+
old_optional = None
|
|
193
185
|
if not version.base_at_least("1.2"):
|
|
194
|
-
old_optional = None
|
|
195
186
|
if len(item) > 1:
|
|
196
187
|
if "optional" in item:
|
|
197
188
|
old_optional = item.pop("optional")
|
|
@@ -16,6 +16,7 @@ Basic Sweeper would generate 6 jobs:
|
|
|
16
16
|
The Basic Sweeper also support, the following is equivalent to the above.
|
|
17
17
|
python foo.py a=range(1,4) b=10,20
|
|
18
18
|
"""
|
|
19
|
+
|
|
19
20
|
import itertools
|
|
20
21
|
import logging
|
|
21
22
|
import time
|
|
@@ -62,7 +63,7 @@ class BasicSweeper(Sweeper):
|
|
|
62
63
|
"""
|
|
63
64
|
Instantiates
|
|
64
65
|
"""
|
|
65
|
-
super(
|
|
66
|
+
super().__init__()
|
|
66
67
|
|
|
67
68
|
if params is None:
|
|
68
69
|
params = {}
|
|
@@ -172,7 +173,8 @@ class BasicSweeper(Sweeper):
|
|
|
172
173
|
self.validate_batch_is_legal(batch)
|
|
173
174
|
elapsed = time.perf_counter() - tic
|
|
174
175
|
log.debug(
|
|
175
|
-
f"Validated configs of {len(batch)} jobs in {elapsed:0.2f} seconds,
|
|
176
|
+
f"Validated configs of {len(batch)} jobs in {elapsed:0.2f} seconds, "
|
|
177
|
+
f"{len(batch) / elapsed:.2f} / second)"
|
|
176
178
|
)
|
|
177
179
|
results = self.launcher.launch(batch, initial_job_idx=initial_job_idx)
|
|
178
180
|
|