Rapido web service branche #69

Merged anki merged 2 commits into tdm:master from tdm:rapido-data-computer on 22 Dec 2023
@anki anki commented on 19 Dec 2023

Pull request for rapido web service source code.
Task remaining :

  • Comment the code
  • Readme
  • Test on VI so further change may be coming on some files

I think you should name it using a more specialized name than rapido, which applies to all services in data-computer.
I was wrong.

data-computer/v1/charger-xml.cfg
data-computer/v1/rapido-ws.ini
2mimeType = application/json
3# OpenAPI Documentation - JSON format (dot notation)
4post.operationId = post-v1-rapido-ws
5post.description = WS-rapido
@parmentf parmentf on 19 Dec 2023

I can't understand the operation done by the web service, only by reading its description (nor its summary).

data-computer/v1/rapido-ws.ini
34plugin = basics
35plugin = spawn
36# Step 1 (générique): Charger le fichier corpus
37
@parmentf parmentf on 19 Dec 2023

Step 1, Step 2, and Step 2.1 comments should be nearer to the instruction they comment.
Otherwise, we could believe that they comment the lines above them.

data-computer/v1/rapido-ws.py
2
3import sys
4import json
5import sys
@parmentf parmentf on 19 Dec 2023

Imported twice !

The problem is that this web service will probably only be used by Persee as part of the rapido project. It will probably be easier for Persee people to use the web service if it evokes the project name rather than a vague description of what the web service does, such as "idref-alignment". Or at least include rapido in the name: "Rapido-idRef-alignment", but that's a long name.

Sorry, I thought of TDM Factory, instead of Rapido, which is a project name.
I forgot this.
But you can remove the -ws part from the name: it is a web services repository ;)

data-computer/v1/rapido-ws.py
72
73for line in sys.stdin:
74 data = json.loads(line)
75 print(data,file=sys.stderr
@parmentf parmentf on 19 Dec 2023

Isn't there too much debug traces?

data-computer/v1/rapido-ws.py
76 )
77 print("RECEIVE",file=sys.stderr)
@parmentf parmentf on 19 Dec 2023

At least, add a timestamp for a useful log.

data-computer/v1/rapido/preprocessing.py

I did not read the whole code, but it seems reasonable (besides the is not None convention (instead of != None).

@anki anki referenced the pull request on 22 Dec 2023

Rapido web service branche

@anki anki merged commit 24926dc into master from rapido-data-computer on 22 Dec 2023
@anki anki closed this pull request on 22 Dec 2023
@anki anki deleted the rapido-data-computer branch on 22 Dec 2023
Labels

Priority
default
Milestone
No milestone
Assignee
No one
2 participants
@anki @parmentf