From 3de0f4dfed13a0b4561732c054aec2d0dfcfcc22 Mon Sep 17 00:00:00 2001 From: Alvaro Lopez Garcia Date: Tue, 23 Jul 2019 13:58:09 +0200 Subject: [PATCH] Prepare 0.5.0 release --- doc/source/devel.rst | 43 ++++++++++++++----- .../allow-passing-args-dbadafef832265e9.yaml | 7 +++ 2 files changed, 40 insertions(+), 10 deletions(-) create mode 100644 releasenotes/notes/allow-passing-args-dbadafef832265e9.yaml diff --git a/doc/source/devel.rst b/doc/source/devel.rst index cf35127b..7be9a85c 100644 --- a/doc/source/devel.rst +++ b/doc/source/devel.rst @@ -23,19 +23,42 @@ Once loaded, the API exposes the following functions or methods: single argument that will contain a list of urls to be analyzed as a single prediction. * ``train()``: Perform a training over a dataset. -* ``get_train_args()``: Retrieve the parameters needed for training. This method must return a dict of dicts. A possible - example is the following: +* ``get_train_args()``: Retrieve the parameters needed for training. This + method must return a dict of dicts. A possible example is the following: .. code-block:: python - { 'arg1' : {'default': '1', #value must be a string (use json.dumps to convert Python objects and json.loads to convert back) - 'help': '', #can be an empty string - 'required': False #bool (whether or not the user must fill the parameter, for example if there is no default) - }, - 'arg2' : {... - }, - ... - } + { + 'arg1': { + 'default': '1', # value must be a string (use json.dumps to convert Python objects) + 'help': '', # can be an empty string + 'required': False # boolean defining whether the value + # must be filled to accept the query + }, + 'arg2': { + ... + }, + ... + } + +* ``get_test_args()``: Retrieve the parameters needed for testing. This method + must return a dict of dicts. A possible example is the following: + + .. code-block:: python + + { + 'arg1': { + 'default': '1', # value must be a string (use json.dumps to convert Python objects) + 'help': '', # can be an empty string + 'required': False # boolean defining whether the value + # must be filled to accept the query + }, + 'arg2': { + ... + }, + ... + } + If the API fails to lookup any of these methods it will not silently fail, but return a 501 Not Implemented HTTP Error. diff --git a/releasenotes/notes/allow-passing-args-dbadafef832265e9.yaml b/releasenotes/notes/allow-passing-args-dbadafef832265e9.yaml new file mode 100644 index 00000000..d49b3dcb --- /dev/null +++ b/releasenotes/notes/allow-passing-args-dbadafef832265e9.yaml @@ -0,0 +1,7 @@ +--- +features: + - Allow to specify which arguments the underlying model accepts for the testing + calls. In this release users can implement a "get_test_args" function in the + module entry point, allowing to expose those arguments through the API. +fixes: + - https://jira.deep-hybrid-datacloud.eu/browse/DPD-489