allenai / scispacy

A full spaCy pipeline and models for scientific/biomedical documents.
https://allenai.github.io/scispacy/
Apache License 2.0
1.68k stars 225 forks source link

Refactor tests to not use global cache for models #57

Open DeNeutoy opened 5 years ago

DeNeutoy commented 5 years ago

We should move away from a functional test framework because it makes the "god-object-spacy-models" dangerous. Instead we should just load a single model for groups of related tests and re-use them.

yogeshhk commented 3 years ago

I am familiar with python and spacy but not with scispacy. Willing to take up this task. Possible to mention some steps to carry out, or chat over zoon/meet/skype?

yogeshhk commented 3 years ago

Does it mean that, whereever there is usage of spacy.load("en_core_web_sm") it needs to be replaced by generic singleton (dict) via conftest.get_spacy_model() ? [@danielkingai2 @DeNeutoy ]

dakinggg commented 3 years ago

I think the idea was to not use the spacy model cache in conftest at all, but instead have each group of related tests load a model like this: https://github.com/allenai/scispacy/blob/688ac1644178f592c946ba3a9a3ac9e7059b7c48/tests/test_abbreviation_detection.py#L15