Skip to content

Commit b346bc2

Browse files
author
Christina Koss
committed
add docstring to explain new function
1 parent bd1567a commit b346bc2

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

rasa/test.py

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,21 @@ def test_core_models_in_directory(
3333

3434

3535
def _get_sanitized_model_directory(model_directory: Text) -> Text:
36+
"""Adjusts the '--model' argument of 'rasa test core' when called with '--evaluate-model-directory'.
37+
38+
If a file is passed as 'model_directory' to 'test_core_models_in_directory' instead of a directory, returns the
39+
directory that file is contained in. Prints a warning if the file is not the latest model. If the passed
40+
'model_directory' is the latest model, it's probably caused by the default value of the CLI. Doesn't warn in this
41+
case.
42+
If anything other than an existing file is passed as 'model_directory' to 'test_core_models_in, returns the
43+
'model_directory' argument as is.
44+
45+
Args:
46+
model_directory: the 'model_directory' argument that was given to 'test_core_models_in_directory'
47+
48+
Returns:
49+
The adjusted model_directory that should be used in 'test_core_models_in_directory'
50+
"""
3651
import rasa.model
3752

3853
p = Path(model_directory)

0 commit comments

Comments
 (0)