Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions medcat-v2/medcat/config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,9 @@ class General(SerialisableBaseModel):
NOTE: While using a simple hash is faster at save time, it is less
reliable due to not taking into account all the details of the changes."""

class Config:
extra = 'allow'


class LinkingFilters(SerialisableBaseModel):
"""These describe the linking filters used alongside the model.
Expand Down Expand Up @@ -431,6 +434,9 @@ class Ner(ComponentConfig):
custom_cnf: Optional[Any] = None
"""The custom config for the component."""

class Config:
extra = 'allow'


class AnnotationOutput(SerialisableBaseModel):
"""The annotation output part of the config"""
Expand Down
4 changes: 2 additions & 2 deletions medcat-v2/tests/config/test_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ class ConfigTests(unittest.TestCase):
}
}
}
NEW_KEY_PATH_INCORRECT = 'general.this_key_is_new_woo'
NEW_KEY_PATH_INCORRECT = 'cdb_maker.this_key_is_new_woo'
TO_MERGE_NEW_KEY_INCORRECT = {
NEW_KEY_PATH_INCORRECT.split(".")[0]: {
NEW_KEY_PATH_INCORRECT.split(".")[1]: TO_MERGE_NEW_VAL,
Expand Down Expand Up @@ -68,7 +68,7 @@ def test_can_merge_new_value_where_allowed(self):
cur = getattr(cur, path)
self.assertEqual(cur, self.TO_MERGE_NEW_VAL)

def test_cannot_mege_new_value_not_allowed(self):
def test_cannot_merge_new_value_not_allowed(self):
with self.assertRaises(config.IncorrectConfigValues):
self.cnf.merge_config(self.TO_MERGE_NEW_KEY_INCORRECT)

Expand Down