Skip to content

Commit

Permalink
error string for NotImplementedError
Browse files Browse the repository at this point in the history
  • Loading branch information
BeritJanssen committed Nov 9, 2023
1 parent 9c0e40c commit 8efab51
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions backend/addcorpus/corpus.py
Original file line number Diff line number Diff line change
Expand Up @@ -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')


'''
Expand All @@ -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.
Expand All @@ -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')


'''
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -241,15 +241,15 @@ 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):
'''
Generate an iterator of document dictionaries from a given source file.
The dictionaries are created from this corpus' `Field`s.
'''
raise NotImplementedError()
raise NotImplementedError('CorpusDefinition missing source2dicts')

def documents(self, sources=None):
'''
Expand Down

0 comments on commit 8efab51

Please sign in to comment.