Skip to content

Commit a211130

Browse files
authored
docs: DeprecationWarning: invalid escape sequence \* in hydra-slayer (#46)
1 parent 41c2153 commit a211130

File tree

4 files changed

+15
-15
lines changed

4 files changed

+15
-15
lines changed

hydra_slayer/factory.py

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,8 @@ def metafactory_factory(factory: Factory, args: Tuple, kwargs: Mapping):
3939
4040
Args:
4141
factory: factory to create instance from
42-
args: \*args to pass to the factory
43-
kwargs: \*\*kwargs to pass to the factory
42+
args: positional arguments to be passed into the factory
43+
kwargs: keyword arguments to be passed into the factory
4444
4545
Returns:
4646
Instance.
@@ -88,8 +88,8 @@ def call_meta_factory(factory: Factory, args: Tuple, kwargs: Mapping):
8888
8989
Args:
9090
factory: factory to create instance from
91-
args: \*args to pass to the factory
92-
kwargs: \*\*kwargs to pass to the factory
91+
args: positional arguments to be passed into the factory
92+
kwargs: keyword arguments to be passed into the factory
9393
9494
Returns:
9595
Instance.
@@ -112,8 +112,8 @@ def partial_meta_factory(factory: Factory, args: Tuple, kwargs: Mapping):
112112
113113
Args:
114114
factory: factory to create instance from
115-
args: \*args to merge into the factory
116-
kwargs: \*\*kwargs to merge into the factory
115+
args: positional arguments to be merged into the factory
116+
kwargs: keyword arguments to be merged into the factory
117117
118118
Returns:
119119
Partial object.
@@ -138,8 +138,8 @@ def default_meta_factory(factory: Factory, args: Tuple, kwargs: Mapping):
138138
139139
Args:
140140
factory: factory to create instance from
141-
args: \*args to pass to the factory
142-
kwargs: \*\*kwargs to pass to the factory
141+
args: positional arguments to be passed into the factory
142+
kwargs: keyword arguments to be passed into the factory
143143
144144
Returns:
145145
Instance.

hydra_slayer/functional.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,8 @@ def _get_instance(
9090
factory_key: key to extract factory name from
9191
get_factory_func: function that returns factory by its name.
9292
Default: :py:func:`.functional.get_factory`
93-
args: \*args to pass to the factory
94-
kwargs: \*\*kwargs to pass to the factory
93+
args: positional arguments to be passed into the factory
94+
kwargs: keyword arguments to be passed into the factory
9595
9696
Returns:
9797
created instance

hydra_slayer/registry.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ def add(
7070
factories: more instances
7171
name: name to use for the first factory instance,
7272
if a single instance is passed
73-
named_factories: factory and their names as \*\*kwargs
73+
named_factories: factory and their names as keyword arguments
7474
7575
Returns:
7676
first factory passed
@@ -193,8 +193,8 @@ def get_instance(self, *args, **kwargs):
193193
Creates instance by calling specified factory with ``instantiate_fn``.
194194
195195
Args:
196-
*args: \*args to pass to the factory
197-
**kwargs: \*\*kwargs to pass to the factory
196+
*args: positional arguments to be passed into the factory
197+
**kwargs: keyword arguments to be passed into the factory
198198
199199
Returns:
200200
created instance
@@ -214,7 +214,7 @@ def get_from_params(
214214
Args:
215215
shared_params: params to pass on all levels in case of
216216
recursive creation
217-
**kwargs: \*\*kwargs to pass to the factory
217+
**kwargs: keyword arguments to be passed into the factory
218218
219219
Returns:
220220
result of calling ``instantiate_fn(factory, **sub_kwargs)``

tests/test_functional.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ def test_get_from_params_var_method_with_params():
367367

368368

369369
def test_fail_get_from_params_on_exclusive_keywords():
370-
error_msg = "`.+` and `.+` \(in get mode\) keywords are exclusive"
370+
error_msg = r"`.+` and `.+` \(in get mode\) keywords are exclusive"
371371
with pytest.raises(ValueError, match=error_msg):
372372
F.get_from_params(
373373
**{

0 commit comments

Comments
 (0)