Skip to content

Boost parsing performance#67

Merged
abelfodil merged 5 commits intomasterfrom
performance
Nov 8, 2020
Merged

Boost parsing performance#67
abelfodil merged 5 commits intomasterfrom
performance

Conversation

@abelfodil
Copy link
Copy Markdown
Contributor

No description provided.

Copy link
Copy Markdown
Contributor

@WilliamHarvey97 WilliamHarvey97 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review fait par Claudia, William était secrétaire

Comment thread backend/classification/file_loading.py
usecols=retained_columns
).to_numpy()

if len(line_splitted) < CYTON_TOTAL_NB_CHANNELS:
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cela permettait de voir s'il y avait un problème dans le fichier envoyé. Par exemple, si le Cyton se ferme et se rallume momentanément, il y a aura deux commentaires qui vont indiquer le début de l'enregistrement. Voir docu %STOP AT et %START AT

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Peut-être juste mettre un try catch autour read_csv pour les lignes de commentaire où le retained_columns ne seront pas présentes. On pourra renvoyer une erreur 400 avec l'explication dans le body.

Copy link
Copy Markdown
Contributor Author

@abelfodil abelfodil Nov 8, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Est-ce qu'on drop les lignes qui pètent sinon? pandas le fait bien

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

idk, s'il manque des samples le fichier ne vaut pas probablement pas grand chose

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Les lignes tu veux dire? Oui, c'est un peu embêtant. Dans le cas où il n'y a qu'un arrêt de ~ 30 secondes, on peut drop ces lignes. Dans le cas d'un arrêt de > 5 minutes, ça ne marcherait pas tant de juste drop les lignes, comme il y a eu un arrêt non négligeable. On ne supporte pas non plus une séquence de nuit non contigüe, ni dans la classification et ni dans les visualisations. C'est pourquoi je pensais refuser le fichier dans ce cas.
De toute façon, c'est un cas limite, on peut pour l'instant drop les mauvaises lignes.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, j'ai catch l'erreur de pandas et raise ClassificationError

Comment thread backend/classification/file_loading.py
@abelfodil abelfodil marked this pull request as ready for review November 8, 2020 22:48
@abelfodil abelfodil merged commit 4011387 into master Nov 8, 2020
@abelfodil abelfodil deleted the performance branch November 8, 2020 23:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants