vantage6.client.subclients.store.review.ReviewSubClient

class ReviewSubClient(parent)

Bases: SubClient

Subclient for the reviews from the algorithm store.

__init__(parent)

Methods

__init__(parent)

approve(id_[, comment])

Approve a review.

create(algorithm, reviewer)

Assign an algorithm to be reviewed by a particular user.

delete(id_)

Delete a review.

get(id_)

Get a review by its id.

list([algorithm, reviewer, under_review, ...])

List reviews

reject(id_[, comment])

Reject a review.

approve(id_, comment=None)

Approve a review.

Parameters:
  • id (int) – The id of the review.

  • comment (str) – A comment for the approval of the review. Optional.

Returns:

The approved review.

Return type:

dict

create(algorithm, reviewer)

Assign an algorithm to be reviewed by a particular user.

Parameters:
  • algorithm (int) – The id of the algorithm.

  • reviewer (int) – The user id for the reviewer.

  • field (str, optional) – Which data field to keep in the returned dict. For instance, “field=’name’” will only return the name of the review. Default is None.

  • fields (list[str], optional) – Which data fields to keep in the returned dict. For instance, “fields=[‘name’, ‘id’]” will only return the name and id of the review. Default is None.

Returns:

The created review.

Return type:

dict

delete(id_)

Delete a review.

Parameters:

id (int) – The id of the review.

Return type:

None

get(id_)

Get a review by its id.

Parameters:
  • id (int) – The id of the review.

  • field (str, optional) – Which data field to keep in the result. For instance, “field=’name’” will only return the name of the review. Default is None.

  • fields (list[str], optional) – Which data fields to keep in the result. For instance, “fields=[‘name’, ‘id’]” will only return the name and id of the review. Default is None.

Returns:

The review.

Return type:

dict

list(algorithm=None, reviewer=None, under_review=None, reviewed=None, approved=None, rejected=None, page=1, per_page=10)

List reviews

Parameters:
  • algorithm (int, optional) – Filter by algorithm id.

  • reviewer (int, optional) – Filter by user id of the reviewer.

  • under_review (bool, optional) – Filter by under review status.

  • reviewed (bool, optional) – Filter by reviewed (either approve or rejected).

  • approved (bool, optional) – Filter by approved status.

  • rejected (bool, optional) – Filter by rejected status.

  • field (str, optinal) – Which data field to keep in the result. For instance, “field=’name’” will only return the name of the reviews. Default is None.

  • fields (list[str], optional) – Which data fields to keep in the result. For instance, “fields=[‘name’, ‘id’]” will only return the name and id of the reviews. Default is None.

  • filter (tuple, optional) – Filter the result on key-value pairs. For instance, “filter_=(‘name’, ‘my_name’)” will only return the reviews with the name ‘my_name’. Default is None.

  • filters (list[tuple], optional) – Filter the result on multiple key-value pairs. For instance, “filters=[(‘name’, ‘my_name’), (‘id’, 1)]” will only return the reviews with the name ‘my_name’ and id 1. Default is None.

  • page (int, optional) – Page number for pagination (default=1)

  • per_page (int, optional) – Number of items per page (default=10)

Returns:

List of reviews

Return type:

list[dict]

reject(id_, comment=None)

Reject a review.

Parameters:
  • id (int) – The id of the review.

  • comment (str) – A comment for the rejection of the review. Optional.

Returns:

The rejected review.

Return type:

dict