hydra-core 1.4.0.dev1__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.4.0.dev1/hydra_core.egg-info → hydra_core-1.4.0.dev3}/PKG-INFO +48 -45
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/README.md +29 -39
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/build_helpers/build_helpers.py +11 -9
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/__init__.py +1 -1
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/_internal/callbacks.py +46 -2
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/_internal/config_loader_impl.py +31 -24
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/_internal/config_repository.py +3 -5
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/_internal/core_plugins/basic_sweeper.py +3 -1
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/_internal/core_plugins/importlib_resources_config_source.py +5 -13
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/_internal/core_plugins/structured_config_source.py +4 -6
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/_internal/defaults_list.py +12 -28
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/_internal/grammar/grammar_functions.py +46 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/_internal/hydra.py +61 -3
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/_internal/instantiate/_instantiate2.py +114 -12
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/_internal/utils.py +29 -6
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/compose.py +2 -6
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/core/default_element.py +7 -6
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/core/override_parser/overrides_parser.py +5 -2
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/core/override_parser/overrides_visitor.py +24 -12
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/core/override_parser/types.py +29 -13
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/core/utils.py +4 -8
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/experimental/callback.py +13 -1
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/experimental/callbacks.py +47 -2
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/grammar/gen/OverrideLexer.py +1 -1
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/grammar/gen/OverrideParser.py +1 -1
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/grammar/gen/OverrideParserListener.py +1 -1
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/grammar/gen/OverrideParserVisitor.py +1 -1
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/initialize.py +2 -4
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/main.py +2 -4
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/plugins/completion_plugin.py +4 -2
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/plugins/launcher.py +1 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/plugins/sweeper.py +1 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/test_utils/launcher_common_tests.py +4 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/test_utils/test_utils.py +4 -5
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/utils.py +31 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/version.py +2 -4
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3/hydra_core.egg-info}/PKG-INFO +48 -45
- hydra_core-1.4.0.dev3/hydra_core.egg-info/requires.txt +2 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/pyproject.toml +34 -2
- hydra_core-1.4.0.dev3/requirements/requirements.txt +2 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/setup.py +7 -5
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/tests/test_basic_sweeper.py +5 -11
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/tests/test_callbacks.py +29 -16
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/tests/test_completion.py +9 -3
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/tests/test_compose.py +61 -15
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/tests/test_config_loader.py +13 -15
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/tests/test_env_defaults.py +1 -1
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/tests/test_hydra.py +127 -150
- hydra_core-1.4.0.dev3/tests/test_hydra_cli_errors.py +116 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/tests/test_hydra_context_warnings.py +3 -5
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/tests/test_overrides_parser.py +166 -13
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/tests/test_utils.py +43 -24
- hydra_core-1.4.0.dev1/hydra_core.egg-info/requires.txt +0 -5
- hydra_core-1.4.0.dev1/requirements/requirements.txt +0 -3
- hydra_core-1.4.0.dev1/tests/test_hydra_cli_errors.py +0 -81
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/LICENSE +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/MANIFEST.in +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/build_helpers/__init__.py +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/build_helpers/bin/__init__.py +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/build_helpers/bin/antlr-4.11.1-complete.jar +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/build_helpers/test_helpers.py +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/_internal/__init__.py +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/_internal/config_search_path_impl.py +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/_internal/core_plugins/__init__.py +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/_internal/core_plugins/bash_completion.py +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/_internal/core_plugins/basic_launcher.py +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/_internal/core_plugins/file_config_source.py +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/_internal/core_plugins/fish_completion.py +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/_internal/core_plugins/zsh_completion.py +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/_internal/deprecation_warning.py +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/_internal/grammar/__init__.py +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/_internal/grammar/functions.py +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/_internal/grammar/utils.py +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/_internal/instantiate/__init__.py +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/_internal/sources_registry.py +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/conf/__init__.py +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/conf/hydra/env/default.yaml +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/conf/hydra/help/default.yaml +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/conf/hydra/hydra_help/default.yaml +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/conf/hydra/hydra_logging/default.yaml +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/conf/hydra/hydra_logging/disabled.yaml +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/conf/hydra/hydra_logging/hydra_debug.yaml +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/conf/hydra/hydra_logging/none.yaml +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/conf/hydra/job_logging/default.yaml +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/conf/hydra/job_logging/disabled.yaml +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/conf/hydra/job_logging/none.yaml +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/conf/hydra/job_logging/stdout.yaml +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/conf/hydra/output/default.yaml +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/core/__init__.py +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/core/config_loader.py +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/core/config_search_path.py +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/core/config_store.py +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/core/global_hydra.py +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/core/hydra_config.py +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/core/object_type.py +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/core/override_parser/__init__.py +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/core/plugins.py +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/core/singleton.py +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/errors.py +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/experimental/__init__.py +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/experimental/compose.py +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/experimental/initialize.py +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/extra/pytest_plugin.py +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/grammar/.gitignore +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/grammar/OverrideLexer.g4 +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/grammar/OverrideParser.g4 +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/grammar/__init__.py +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/grammar/gen/.gitignore +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/grammar/gen/OverrideLexer.interp +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/grammar/gen/OverrideLexer.tokens +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/grammar/gen/OverrideParser.interp +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/grammar/gen/OverrideParser.tokens +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/plugins/__init__.py +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/plugins/config_source.py +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/plugins/plugin.py +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/plugins/search_path_plugin.py +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/py.typed +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/test_utils/__init__.py +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/test_utils/a_module.py +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/test_utils/completion.py +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/test_utils/config_source_common_tests.py +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/test_utils/configs/__init__.py +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/test_utils/configs/accessing_hydra_config.yaml +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/test_utils/configs/completion_test/additional_searchpath.yaml +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/test_utils/configs/completion_test/config.yaml +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/test_utils/configs/completion_test/group/dict.yaml +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/test_utils/configs/completion_test/group/list.yaml +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/test_utils/configs/completion_test/hydra/launcher/fairtask.yaml +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/test_utils/configs/completion_test/missing_default.yaml +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/test_utils/configs/completion_test/test_hydra/launcher/fairtask.yaml +0 -0
- {hydra_core-1.4.0.dev1 → 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.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/test_utils/configs/completion_test_additional_file/group/file_opt.yaml +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/test_utils/configs/completion_test_additional_package/__init__.py +0 -0
- {hydra_core-1.4.0.dev1 → 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.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/test_utils/configs/completion_test_additional_package/group/pkg_opt.yaml +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/test_utils/configs/compose.yaml +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/test_utils/configs/conf.zip +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/test_utils/configs/config.yaml +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/test_utils/configs/config.yml +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/test_utils/configs/custom_resolver.yaml +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/test_utils/configs/db/mysql.yaml +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/test_utils/configs/db/postgresql.yaml +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/test_utils/configs/db/validated_mysql.yaml +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/test_utils/configs/db/validated_postgresql.yaml +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/test_utils/configs/db_conf.yaml +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/test_utils/configs/defaults_not_list.yaml +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/test_utils/configs/group1/abc.cde.yaml +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/test_utils/configs/group1/file1.yaml +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/test_utils/configs/group1/file2.yaml +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/test_utils/configs/group2/file1.yaml +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/test_utils/configs/group2/file2.yaml +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/test_utils/configs/missing-default.yaml +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/test_utils/configs/missing-optional-default.yaml +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/test_utils/configs/missing_init_py/.gitignore +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/test_utils/configs/missing_init_py/test.yaml +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/test_utils/configs/optional-default.yaml +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/test_utils/configs/overriding_output_dir.yaml +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/test_utils/configs/overriding_run_dir.yaml +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/test_utils/configs/package_tests/__init__.py +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/test_utils/configs/package_tests/group1/option1.yaml +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/test_utils/configs/package_tests/group1/option2.yaml +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/test_utils/configs/package_tests/group2/option1.yaml +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/test_utils/configs/package_tests/group2/option2.yaml +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/test_utils/configs/package_tests/pkg_override.yaml +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/test_utils/configs/package_tests/two_packages_one_group.yaml +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/test_utils/configs/schema_key_error.yaml +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/test_utils/configs/schema_validation_error.yaml +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/test_utils/configs/some_config.yaml +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/test_utils/configs/top_level_list/file1.yaml +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/test_utils/configs/unspecified_mandatory_default.yaml +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/test_utils/example_app.py +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/types.py +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra_core.egg-info/SOURCES.txt +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra_core.egg-info/dependency_links.txt +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra_core.egg-info/entry_points.txt +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra_core.egg-info/top_level.txt +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/setup.cfg +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/tests/test_basic_launcher.py +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/tests/test_config_repository.py +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/tests/test_config_search_path.py +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/tests/test_core_utils.py +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/tests/test_errors.py +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/tests/test_internal_utils.py +0 -0
- {hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/tests/test_plugin_interface.py +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
2
|
Name: hydra-core
|
|
3
|
-
Version: 1.4.0.
|
|
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,65 +9,69 @@ 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.8
|
|
13
|
-
Classifier: Programming Language :: Python :: 3.9
|
|
14
12
|
Classifier: Programming Language :: Python :: 3.10
|
|
15
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
|
|
16
17
|
Classifier: Operating System :: POSIX :: Linux
|
|
17
18
|
Classifier: Operating System :: MacOS
|
|
18
19
|
Classifier: Operating System :: Microsoft :: Windows
|
|
20
|
+
Requires-Python: >=3.10
|
|
19
21
|
Description-Content-Type: text/markdown
|
|
20
22
|
License-File: LICENSE
|
|
21
|
-
Requires-Dist: omegaconf>=2.4.0.
|
|
22
|
-
Requires-Dist: importlib-resources; python_version < "3.9"
|
|
23
|
+
Requires-Dist: omegaconf>=2.4.0.dev11
|
|
23
24
|
Requires-Dist: packaging
|
|
25
|
+
Dynamic: author
|
|
26
|
+
Dynamic: author-email
|
|
27
|
+
Dynamic: classifier
|
|
28
|
+
Dynamic: description
|
|
29
|
+
Dynamic: description-content-type
|
|
30
|
+
Dynamic: home-page
|
|
31
|
+
Dynamic: keywords
|
|
32
|
+
Dynamic: license
|
|
33
|
+
Dynamic: license-file
|
|
34
|
+
Dynamic: requires-dist
|
|
35
|
+
Dynamic: requires-python
|
|
36
|
+
Dynamic: summary
|
|
24
37
|
|
|
25
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>
|
|
26
39
|
|
|
27
40
|
<p align="center">
|
|
28
|
-
<a href="https://pypi.org/project/hydra-core/">
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
<a href="https://
|
|
32
|
-
<img src="https://img.shields.io/circleci/build/github/facebookresearch/hydra?token=af199cd2deca9e70e53776f9ded96284b10687e9" alt="CircleCI" />
|
|
33
|
-
</a>
|
|
34
|
-
<a href="#">
|
|
35
|
-
<img src="https://img.shields.io/pypi/l/hydra-core" alt="PyPI - License" />
|
|
36
|
-
</a>
|
|
37
|
-
<a href="#">
|
|
38
|
-
<img src="https://img.shields.io/pypi/pyversions/hydra-core" alt="PyPI - Python Version" />
|
|
39
|
-
</a>
|
|
40
|
-
<a href="https://pepy.tech/project/hydra-core?versions=0.11.*&versions=1.0.*&versions=1.1.*">
|
|
41
|
-
<img src="https://pepy.tech/badge/hydra-core/month" alt="Downloads" />
|
|
42
|
-
</a>
|
|
43
|
-
<a href="https://github.com/psf/black">
|
|
44
|
-
<img src="https://img.shields.io/badge/code%20style-black-000000.svg" alt="Code style: black" />
|
|
45
|
-
</a>
|
|
46
|
-
<a href="https://lgtm.com/projects/g/facebookresearch/hydra/alerts/">
|
|
47
|
-
<img src="https://img.shields.io/lgtm/alerts/g/facebookresearch/hydra.svg?logo=lgtm&logoWidth=18" alt="Total alerts" />
|
|
48
|
-
</a>
|
|
49
|
-
<a href="https://lgtm.com/projects/g/facebookresearch/hydra/context:python">
|
|
50
|
-
<img src="https://img.shields.io/lgtm/grade/python/g/facebookresearch/hydra.svg?logo=lgtm&logoWidth=18" alt="Language grade: Python" />
|
|
51
|
-
</a>
|
|
52
|
-
<p align="center">
|
|
53
|
-
<i>A framework for elegantly configuring complex applications.</i>
|
|
54
|
-
</p>
|
|
55
|
-
<p align="center">
|
|
56
|
-
<i>Check the <a href="https://hydra.cc/">website</a> for more information,<br>
|
|
57
|
-
or click the thumbnail below for a one-minute video introduction to Hydra.</i>
|
|
58
|
-
</p>
|
|
59
|
-
<p align="center">
|
|
60
|
-
<a href="http://www.youtube.com/watch?feature=player_embedded&v=Slc3gRQpnBI" target="_blank">
|
|
61
|
-
<img src="http://img.youtube.com/vi/Slc3gRQpnBI/hqdefault.jpg" alt="1 minute overview" width="240" height="180" border="10" />
|
|
62
|
-
</a>
|
|
63
|
-
</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>
|
|
64
45
|
</p>
|
|
65
46
|
|
|
66
|
-
|
|
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>
|
|
67
63
|
|
|
64
|
+
----------------------
|
|
68
65
|
|
|
69
66
|
### Releases
|
|
70
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
|
+
|
|
71
75
|
#### Stable
|
|
72
76
|
|
|
73
77
|
**Hydra 1.3** is the stable version of Hydra.
|
|
@@ -90,7 +94,7 @@ Hydra is licensed under [MIT License](LICENSE).
|
|
|
90
94
|
#### Ask questions in Github Discussions or StackOverflow (Use the tag #fb-hydra or #omegaconf):
|
|
91
95
|
* [Github Discussions](https://github.com/facebookresearch/hydra/discussions)
|
|
92
96
|
* [StackOverflow](https://stackexchange.com/filters/391828/hydra-questions)
|
|
93
|
-
* [
|
|
97
|
+
* [X](https://twitter.com/Hydra_Framework)
|
|
94
98
|
|
|
95
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.
|
|
96
100
|
|
|
@@ -105,4 +109,3 @@ If you use Hydra in your research please use the following BibTeX entry:
|
|
|
105
109
|
url = {https://github.com/facebookresearch/hydra}
|
|
106
110
|
}
|
|
107
111
|
```
|
|
108
|
-
|
|
@@ -1,49 +1,40 @@
|
|
|
1
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
|
-
|
|
@@ -156,15 +156,17 @@ class BuildPyCommand(build_py.build_py):
|
|
|
156
156
|
|
|
157
157
|
|
|
158
158
|
class Develop(develop.develop):
|
|
159
|
-
def run(self) -> None:
|
|
159
|
+
def run(self) -> None:
|
|
160
160
|
if not self.dry_run:
|
|
161
161
|
run_antlr(self)
|
|
162
162
|
develop.develop.run(self)
|
|
163
163
|
|
|
164
164
|
|
|
165
165
|
class SDistCommand(sdist.sdist):
|
|
166
|
+
dry_run: bool
|
|
167
|
+
|
|
166
168
|
def run(self) -> None:
|
|
167
|
-
if not self.dry_run:
|
|
169
|
+
if not self.dry_run:
|
|
168
170
|
self.run_command("clean")
|
|
169
171
|
run_antlr(self)
|
|
170
172
|
sdist.sdist.run(self)
|
|
@@ -214,23 +216,23 @@ class ANTLRCommand(Command): # type: ignore
|
|
|
214
216
|
build_dir = Path(__file__).parent.absolute()
|
|
215
217
|
project_root = build_dir.parent
|
|
216
218
|
lib = "antlr4"
|
|
217
|
-
pkgname =
|
|
219
|
+
pkgname = "omegaconf.vendor"
|
|
218
220
|
|
|
219
221
|
replacements = [
|
|
220
222
|
partial( # import antlr4 -> import omegaconf.vendor.antlr4
|
|
221
|
-
re.compile(r
|
|
222
|
-
r
|
|
223
|
+
re.compile(r"(^\s*)import {}\n".format(lib), flags=re.M).sub,
|
|
224
|
+
r"\1from {} import {}\n".format(pkgname, lib),
|
|
223
225
|
),
|
|
224
226
|
partial( # from antlr4 -> from fomegaconf.vendor.antlr4
|
|
225
|
-
re.compile(r
|
|
226
|
-
r
|
|
227
|
+
re.compile(r"(^\s*)from {}(\.|\s+)".format(lib), flags=re.M).sub,
|
|
228
|
+
r"\1from {}.{}\2".format(pkgname, lib),
|
|
227
229
|
),
|
|
228
230
|
]
|
|
229
231
|
|
|
230
232
|
path = project_root / "hydra" / "grammar" / "gen"
|
|
231
233
|
for item in path.iterdir():
|
|
232
234
|
if item.is_file() and item.name.endswith(".py"):
|
|
233
|
-
text = item.read_text(
|
|
235
|
+
text = item.read_text("utf8")
|
|
234
236
|
for replacement in replacements:
|
|
235
237
|
text = replacement(text)
|
|
236
|
-
item.write_text(text,
|
|
238
|
+
item.write_text(text, "utf8")
|
|
@@ -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.0.
|
|
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
|
|
|
@@ -172,19 +172,17 @@ class ConfigRepository(IConfigRepository):
|
|
|
172
172
|
# DEPRECATED: remove in 1.2
|
|
173
173
|
url = "https://hydra.cc/docs/1.2/upgrades/1.0_to_1.1/changes_to_package_header"
|
|
174
174
|
deprecation_warning(
|
|
175
|
-
message=dedent(
|
|
176
|
-
f"""\
|
|
175
|
+
message=dedent(f"""\
|
|
177
176
|
In {config_path}: Defaults List contains deprecated keyword _name_, see {url}
|
|
178
|
-
"""
|
|
179
|
-
),
|
|
177
|
+
"""),
|
|
180
178
|
)
|
|
181
179
|
|
|
182
180
|
res: List[InputDefault] = []
|
|
183
181
|
for item in defaults._iter_ex(resolve=False):
|
|
184
182
|
default: InputDefault
|
|
185
183
|
if isinstance(item, DictConfig):
|
|
184
|
+
old_optional = None
|
|
186
185
|
if not version.base_at_least("1.2"):
|
|
187
|
-
old_optional = None
|
|
188
186
|
if len(item) > 1:
|
|
189
187
|
if "optional" in item:
|
|
190
188
|
old_optional = item.pop("optional")
|
{hydra_core-1.4.0.dev1 → hydra_core-1.4.0.dev3}/hydra/_internal/core_plugins/basic_sweeper.py
RENAMED
|
@@ -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
|
|
@@ -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
|
|
|
@@ -1,22 +1,14 @@
|
|
|
1
1
|
# Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved
|
|
2
2
|
import os
|
|
3
|
-
import sys
|
|
4
3
|
import zipfile
|
|
5
|
-
from
|
|
4
|
+
from importlib import resources
|
|
5
|
+
from typing import Any, List, Optional
|
|
6
6
|
|
|
7
7
|
from omegaconf import OmegaConf
|
|
8
8
|
|
|
9
9
|
from hydra.core.object_type import ObjectType
|
|
10
10
|
from hydra.plugins.config_source import ConfigLoadError, ConfigResult, ConfigSource
|
|
11
11
|
|
|
12
|
-
if TYPE_CHECKING or (sys.version_info < (3, 9)):
|
|
13
|
-
import importlib_resources as resources
|
|
14
|
-
else:
|
|
15
|
-
from importlib import resources
|
|
16
|
-
|
|
17
|
-
# Relevant issue: https://github.com/python/mypy/issues/1153
|
|
18
|
-
# Use importlib backport for Python older than 3.9
|
|
19
|
-
|
|
20
12
|
|
|
21
13
|
class ImportlibResourcesConfigSource(ConfigSource):
|
|
22
14
|
def __init__(self, provider: str, path: str) -> None:
|
|
@@ -56,7 +48,7 @@ class ImportlibResourcesConfigSource(ConfigSource):
|
|
|
56
48
|
def load_config(self, config_path: str) -> ConfigResult:
|
|
57
49
|
normalized_config_path = self._normalize_file_name(config_path)
|
|
58
50
|
res = resources.files(self.path).joinpath(normalized_config_path)
|
|
59
|
-
if not res.
|
|
51
|
+
if not (res.is_file() or res.is_dir()):
|
|
60
52
|
raise ConfigLoadError(f"Config not found : {normalized_config_path}")
|
|
61
53
|
|
|
62
54
|
return self._read_config(res)
|
|
@@ -75,7 +67,7 @@ class ImportlibResourcesConfigSource(ConfigSource):
|
|
|
75
67
|
return False
|
|
76
68
|
|
|
77
69
|
res = files.joinpath(config_path)
|
|
78
|
-
ret = res.
|
|
70
|
+
ret = res.is_dir()
|
|
79
71
|
assert isinstance(ret, bool)
|
|
80
72
|
return ret
|
|
81
73
|
|
|
@@ -86,7 +78,7 @@ class ImportlibResourcesConfigSource(ConfigSource):
|
|
|
86
78
|
except (ValueError, ModuleNotFoundError, TypeError):
|
|
87
79
|
return False
|
|
88
80
|
res = files.joinpath(config_path)
|
|
89
|
-
ret = res.
|
|
81
|
+
ret = res.is_file()
|
|
90
82
|
assert isinstance(ret, bool)
|
|
91
83
|
return ret
|
|
92
84
|
|
|
@@ -9,12 +9,10 @@ from hydra.plugins.config_source import ConfigResult, ConfigSource
|
|
|
9
9
|
|
|
10
10
|
|
|
11
11
|
class StructuredConfigSource(ConfigSource):
|
|
12
|
-
store: ConfigStore
|
|
13
12
|
|
|
14
13
|
def __init__(self, provider: str, path: str) -> None:
|
|
15
14
|
super().__init__(provider=provider, path=path)
|
|
16
15
|
# Import the module, the __init__ there is expected to register the configs.
|
|
17
|
-
self.store = ConfigStore.instance()
|
|
18
16
|
if self.path != "":
|
|
19
17
|
try:
|
|
20
18
|
importlib.import_module(self.path)
|
|
@@ -30,7 +28,7 @@ class StructuredConfigSource(ConfigSource):
|
|
|
30
28
|
|
|
31
29
|
def load_config(self, config_path: str) -> ConfigResult:
|
|
32
30
|
normalized_config_path = self._normalize_file_name(config_path)
|
|
33
|
-
ret =
|
|
31
|
+
ret = ConfigStore.instance().load(config_path=normalized_config_path)
|
|
34
32
|
provider = ret.provider if ret.provider is not None else self.provider
|
|
35
33
|
header = {"package": ret.package}
|
|
36
34
|
return ConfigResult(
|
|
@@ -44,17 +42,17 @@ class StructuredConfigSource(ConfigSource):
|
|
|
44
42
|
return True
|
|
45
43
|
|
|
46
44
|
def is_group(self, config_path: str) -> bool:
|
|
47
|
-
type_ =
|
|
45
|
+
type_ = ConfigStore.instance().get_type(config_path.rstrip("/"))
|
|
48
46
|
return type_ == ObjectType.GROUP
|
|
49
47
|
|
|
50
48
|
def is_config(self, config_path: str) -> bool:
|
|
51
49
|
filename = self._normalize_file_name(config_path.rstrip("/"))
|
|
52
|
-
type_ =
|
|
50
|
+
type_ = ConfigStore.instance().get_type(filename)
|
|
53
51
|
return type_ == ObjectType.CONFIG
|
|
54
52
|
|
|
55
53
|
def list(self, config_path: str, results_filter: Optional[ObjectType]) -> List[str]:
|
|
56
54
|
ret: List[str] = []
|
|
57
|
-
files =
|
|
55
|
+
files = ConfigStore.instance().list(config_path)
|
|
58
56
|
|
|
59
57
|
for file in files:
|
|
60
58
|
self._list_add_result(
|