From 8efab51f7a580df81f628c77001f8d63bbe0940f Mon Sep 17 00:00:00 2001 From: BeritJanssen Date: Thu, 9 Nov 2023 14:08:02 +0100 Subject: [PATCH] error string for NotImplementedError --- backend/addcorpus/corpus.py | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/backend/addcorpus/corpus.py b/backend/addcorpus/corpus.py index b11f279bd..4c8cd4256 100644 --- a/backend/addcorpus/corpus.py +++ b/backend/addcorpus/corpus.py @@ -33,37 +33,37 @@ class CorpusDefinition(object): @property def title(self): ''' - Path to source data directory. + Title of the corpus ''' - raise NotImplementedError() + raise NotImplementedError('CorpusDefinition missing title') @property def description(self): ''' Short description of the corpus ''' - raise NotImplementedError() + raise NotImplementedError('CorpusDefinition missing description') @property def data_directory(self): ''' Path to source data directory. ''' - raise NotImplementedError() + raise NotImplementedError('CorpusDefinition missing data_directory') @property def min_date(self): ''' Minimum timestamp for data files. ''' - raise NotImplementedError() + raise NotImplementedError('CorpusDefinition missing min_date') @property def max_date(self): ''' Maximum timestamp for data files. ''' - raise NotImplementedError() + raise NotImplementedError('CorpusDefinition missing max_date') ''' @@ -81,14 +81,14 @@ def category(self): See addcorpus.constants.CATEGORIES for options ''' - raise NotImplementedError() + raise NotImplementedError('CorpusDefinition missing category') @property def es_index(self): ''' ElasticSearch index name. ''' - raise NotImplementedError() + raise NotImplementedError('CorpusDefinition missing category') ''' Elasticsearch alias. Defaults to None. @@ -111,7 +111,7 @@ def fields(self): the `Field` class, containing information about each attribute. MUST include a field with `name='id'`. ''' - raise NotImplementedError() + raise NotImplementedError('CorpusDefinition missing fields') ''' @@ -139,7 +139,7 @@ def image(self): Name of the corpus image. Should be relative path from a directory 'images' in the same directory as the corpus definition file. ''' - raise NotImplementedError() + raise NotImplementedError('CorpusDefinition missing image') ''' MIME type of scanned documents (images) @@ -241,7 +241,7 @@ def sources(self, start=datetime.min, end=datetime.max): empty or contains only a timestamp; but any data that is to be extracted without reading the file itself can be specified there. ''' - raise NotImplementedError() + raise NotImplementedError('CorpusDefinition missing sources') def source2dicts(self, sources): ''' @@ -249,7 +249,7 @@ def source2dicts(self, sources): The dictionaries are created from this corpus' `Field`s. ''' - raise NotImplementedError() + raise NotImplementedError('CorpusDefinition missing source2dicts') def documents(self, sources=None): '''