deseasion.backend.resources.project_data module
- class deseasion.backend.resources.project_data.MRSortInferenceAPI
Bases:
Resource
- endpoint = 'mrsortinferenceapi'
- get(data_id)
Return the details of the MR-Sort inference model for the project’s data.
- Parameters:
data_id (int) – The id the project’s data.
- Reqheader Authorization:
JSON Web Token with Bearer scheme (
Authorization: Bearer <token>
).- Status 400:
The processing model is not an MR-Sort model.
- Status 403:
The user is not allowed to access the project.
- Status 404:
The data does not exist.
- infer_mrsort(model)
- load_alternatives(model)
- mediatypes()
- methods: t.ClassVar[t.Collection[str] | None] = {'GET', 'POST', 'PUT'}
The methods this view is registered for. Uses the same default (
["GET", "HEAD", "OPTIONS"]
) asroute
andadd_url_rule
by default.
- post(data_id)
Execute an action on the MR-Sort inference model.
- Parameters:
data_id (int) – The id the project’s data.
- Query str action:
The action to execute:
load
will load the inference alternatives,infer
will try to infer the MR-Sort model from the alternatives (required).- Reqheader Authorization:
JSON Web Token with Bearer scheme (
Authorization: Bearer <token>
).- Status 400:
The model is not an MR-Sort model or
action
is incorrect.- Status 403:
The user is not allowed to access the project.
- Status 404:
The data does not exist.
- Status 500:
Inference error
- put(data_id)
Modify the MR-Sort inference model.
- Parameters:
data_id (int) – The id the project’s data.
- Reqheader Authorization:
JSON Web Token with Bearer scheme (
Authorization: Bearer <token>
).- Status 400:
The processing model is not an MR-Sort model.
- Status 403:
The user is not allowed to access the project.
- Status 404:
The data does not exist.
- class deseasion.backend.resources.project_data.ProjectDataAPI
Bases:
Resource
- create_process_task(data_id)
Create the appropriate type of task to process data
- delete(data_id)
Delete the project’s data.
- Parameters:
data_id (int) – The id the project’s data.
- Status 403:
The user is not allowed to access the project.
- Status 404:
The data does not exist.
- endpoint = 'projectdataapi'
- get(data_id)
Return the details of the project’s data.
The schema used to serialize the data will depend on the data_type attribute.
- Parameters:
data_id (int) – The id the project’s data.
- Reqheader Authorization:
JSON Web Token with Bearer scheme (
Authorization: Bearer <token>
).- Status 403:
The user is not allowed to access the project.
- Status 404:
The data does not exist.
- get_chained_tasks(data)
Start the celery tasks
- mediatypes()
- methods: t.ClassVar[t.Collection[str] | None] = {'DELETE', 'GET', 'POST', 'PUT'}
The methods this view is registered for. Uses the same default (
["GET", "HEAD", "OPTIONS"]
) asroute
andadd_url_rule
by default.
- post(data_id)
Process the project’s data.
- Parameters:
data_id (int) – The id of the project’s data.
- Query str action:
Action to execute on the data: currently only
process
is supported (required).- Query bool chain:
Also process the required dependencies. Default: False.
- Reqheader Authorization:
JSON Web Token with Bearer scheme (
Authorization: Bearer <token>
).- Status 202:
The data is being processed asynchronously. The detail of the running task is returned.
- Status 400:
The
action
is incorrect.- Status 403:
The user is not allowed to access the project.
- Status 404:
The data does not exist.
- process_data(data_id, chain=False)
Process the data in an asynchronous task
- Args:
data_id (int): the id of the data to process chain (bool):
also process the required dependencies (default: False)
- put(data_id)
Modify the project’s data.
- Parameters:
data_id (int) – The id the project’s data.
- Reqheader Authorization:
JSON Web Token with Bearer scheme (
Authorization: Bearer <token>
).- Status 400:
There is an error in the json data.
- Status 403:
The user is not allowed to access the project.
- Status 404:
The data does not exist.
- class deseasion.backend.resources.project_data.ProjectDataActiveModelAPI
Bases:
Resource
- endpoint = 'projectdataactivemodelapi'
- mediatypes()
- methods: t.ClassVar[t.Collection[str] | None] = {'PUT'}
The methods this view is registered for. Uses the same default (
["GET", "HEAD", "OPTIONS"]
) asroute
andadd_url_rule
by default.
- put(data_id)
Update the active processing model of the data.
The type of processing model cannot be modified.
- Parameters:
data_id (int) – The id the project’s data.
- Reqheader Authorization:
JSON Web Token with Bearer scheme (
Authorization: Bearer <token>
).- Status 403:
The user is not allowed to access the project.
- Status 404:
The data does not exist.
- class deseasion.backend.resources.project_data.ProjectDataInputSubgraphAPI
Bases:
Resource
- endpoint = 'projectdatainputsubgraphapi'
- get(data_id)
Return the input data subgraph spanning from the project data.
- Parameters:
data_id (int) – The id the project’s data.
- Reqheader Authorization:
JSON Web Token with Bearer scheme (
Authorization: Bearer <token>
).- Status 403:
The user is not allowed to access the project data.
- Status 404:
The project data doesn’t exist.
- mediatypes()
- methods: t.ClassVar[t.Collection[str] | None] = {'GET'}
The methods this view is registered for. Uses the same default (
["GET", "HEAD", "OPTIONS"]
) asroute
andadd_url_rule
by default.
- class deseasion.backend.resources.project_data.ProjectDataListAPI
Bases:
Resource
- endpoint = 'projectdatalistapi'
- get()
Returns the list of project data
- Query ids:
The list of comma separated data ids (required).
- Query fields:
The list of fields to return. Default: Return all fields.
- Reqheader Authorization:
JSON Web Token with Bearer scheme (
Authorization: Bearer <token>
).- Status 403:
The user is not allowed to access at least one project data.
- Status 404:
At least one project data does not exist.
- mediatypes()
- methods: t.ClassVar[t.Collection[str] | None] = {'GET'}
The methods this view is registered for. Uses the same default (
["GET", "HEAD", "OPTIONS"]
) asroute
andadd_url_rule
by default.
- parse_fields(args)
Returns the list of string fields parsed from the comma-separated query arguments
- parse_ids(args)
Returns the list of integer ids parsed from the comma-separated query arguments
- class deseasion.backend.resources.project_data.ProjectDataModelAPI
Bases:
Resource
- delete(data_id, model_id)
Delete the processing model of the data.
- Parameters:
data_id (int) – The id the project’s data.
model_id (int) – The id the processing model.
- Reqheader Authorization:
JSON Web Token with Bearer scheme (
Authorization: Bearer <token>
).- Status 400:
The processing model is the only one for the data so cannot be deleted.
- Status 403:
The user is not allowed to access the project.
- Status 404:
Either the project data or processing model does not exist.
- endpoint = 'projectdatamodelapi'
- mediatypes()
- methods: t.ClassVar[t.Collection[str] | None] = {'DELETE', 'PUT'}
The methods this view is registered for. Uses the same default (
["GET", "HEAD", "OPTIONS"]
) asroute
andadd_url_rule
by default.
- put(data_id, model_id)
Update the processing model of the data.
The type of processing model cannot be modified.
- Parameters:
data_id (int) – The id the project’s data.
model_id (int) – The id the processing model.
- Reqheader Authorization:
JSON Web Token with Bearer scheme (
Authorization: Bearer <token>
).- Status 403:
The user is not allowed to access the project.
- Status 404:
Either the project data or processing model does not exist.
- class deseasion.backend.resources.project_data.ProjectDataModelChangeAPI
Bases:
Resource
- endpoint = 'projectdatamodelchangeapi'
- mediatypes()
- methods: t.ClassVar[t.Collection[str] | None] = {'POST'}
The methods this view is registered for. Uses the same default (
["GET", "HEAD", "OPTIONS"]
) asroute
andadd_url_rule
by default.
- post(data_id)
Change the active processing model.
- Parameters:
data_id (int) – The id of the project’s data.
- Resjson int id:
Id of the processing model to set as the active model.
- Reqheader Authorization:
JSON Web Token with Bearer scheme (
Authorization: Bearer <token>
).- Status 403:
The user is not allower to access the project.
- Status 404:
The project data or processing model does not exist.
- Status 400:
The content is incorrect.
- class deseasion.backend.resources.project_data.ProjectDataOutputSubgraphAPI
Bases:
Resource
- endpoint = 'projectdataoutputsubgraphapi'
- get(data_id)
Return the output data subgraph spanning from the project data.
- Parameters:
data_id (int) – The id the project’s data.
- Reqheader Authorization:
JSON Web Token with Bearer scheme (
Authorization: Bearer <token>
).- Status 403:
The user is not allowed to access the project data.
- Status 404:
The project data doesn’t exist.
- mediatypes()
- methods: t.ClassVar[t.Collection[str] | None] = {'GET'}
The methods this view is registered for. Uses the same default (
["GET", "HEAD", "OPTIONS"]
) asroute
andadd_url_rule
by default.
- class deseasion.backend.resources.project_data.ProjectDataReplaceInputAttributesAPI
Bases:
Resource
- endpoint = 'projectdatareplaceinputattributesapi'
- mediatypes()
- methods: t.ClassVar[t.Collection[str] | None] = {'POST'}
The methods this view is registered for. Uses the same default (
["GET", "HEAD", "OPTIONS"]
) asroute
andadd_url_rule
by default.
- post(data_id)
Replace project data input attributes.
It replaces usage of old attributes given by new attributes given, assuming the old attributes given are attributes of this project’s data and that the new attributes given are not already used as inputs alongside some of the old attributes.
Its main usage is threfore to replace whole project data (all their attributes) by completely unused other project data.
- Parameters:
data_id (int) – The id the project’s data.
- Reqheader Authorization:
JSON Web Token with Bearer scheme (
Authorization: Bearer <token>
).- Status 400:
Remapping could not proceed with given arguments.
- Status 403:
The user is not allowed to access the project.
- Status 404:
The data does not exist.