Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: fix DeprecationWarning: invalid escape sequence \* in hydra-slayer #46

Merged
merged 1 commit into from
Jan 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions hydra_slayer/factory.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,8 @@ def metafactory_factory(factory: Factory, args: Tuple, kwargs: Mapping):

Args:
factory: factory to create instance from
args: \*args to pass to the factory
kwargs: \*\*kwargs to pass to the factory
args: positional arguments to be passed into the factory
kwargs: keyword arguments to be passed into the factory

Returns:
Instance.
Expand Down Expand Up @@ -88,8 +88,8 @@ def call_meta_factory(factory: Factory, args: Tuple, kwargs: Mapping):

Args:
factory: factory to create instance from
args: \*args to pass to the factory
kwargs: \*\*kwargs to pass to the factory
args: positional arguments to be passed into the factory
kwargs: keyword arguments to be passed into the factory

Returns:
Instance.
Expand All @@ -112,8 +112,8 @@ def partial_meta_factory(factory: Factory, args: Tuple, kwargs: Mapping):

Args:
factory: factory to create instance from
args: \*args to merge into the factory
kwargs: \*\*kwargs to merge into the factory
args: positional arguments to be merged into the factory
kwargs: keyword arguments to be merged into the factory

Returns:
Partial object.
Expand All @@ -138,8 +138,8 @@ def default_meta_factory(factory: Factory, args: Tuple, kwargs: Mapping):

Args:
factory: factory to create instance from
args: \*args to pass to the factory
kwargs: \*\*kwargs to pass to the factory
args: positional arguments to be passed into the factory
kwargs: keyword arguments to be passed into the factory

Returns:
Instance.
Expand Down
4 changes: 2 additions & 2 deletions hydra_slayer/functional.py
Original file line number Diff line number Diff line change
Expand Up @@ -90,8 +90,8 @@ def _get_instance(
factory_key: key to extract factory name from
get_factory_func: function that returns factory by its name.
Default: :py:func:`.functional.get_factory`
args: \*args to pass to the factory
kwargs: \*\*kwargs to pass to the factory
args: positional arguments to be passed into the factory
kwargs: keyword arguments to be passed into the factory
Returns:
created instance
Expand Down
8 changes: 4 additions & 4 deletions hydra_slayer/registry.py
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def add(
factories: more instances
name: name to use for the first factory instance,
if a single instance is passed
named_factories: factory and their names as \*\*kwargs
named_factories: factory and their names as keyword arguments
Returns:
first factory passed
Expand Down Expand Up @@ -193,8 +193,8 @@ def get_instance(self, *args, **kwargs):
Creates instance by calling specified factory with ``instantiate_fn``.
Args:
*args: \*args to pass to the factory
**kwargs: \*\*kwargs to pass to the factory
*args: positional arguments to be passed into the factory
**kwargs: keyword arguments to be passed into the factory
Returns:
created instance
Expand All @@ -214,7 +214,7 @@ def get_from_params(
Args:
shared_params: params to pass on all levels in case of
recursive creation
**kwargs: \*\*kwargs to pass to the factory
**kwargs: keyword arguments to be passed into the factory
Returns:
result of calling ``instantiate_fn(factory, **sub_kwargs)``
Expand Down
2 changes: 1 addition & 1 deletion tests/test_functional.py
Original file line number Diff line number Diff line change
Expand Up @@ -367,7 +367,7 @@ def test_get_from_params_var_method_with_params():


def test_fail_get_from_params_on_exclusive_keywords():
error_msg = "`.+` and `.+` \(in get mode\) keywords are exclusive"
error_msg = r"`.+` and `.+` \(in get mode\) keywords are exclusive"
with pytest.raises(ValueError, match=error_msg):
F.get_from_params(
**{
Expand Down
Loading