Skip to content

Commit

Permalink
Merge pull request #87 from HazyResearch/data-model
Browse files Browse the repository at this point in the history
Remove get parent/children/sentence generator from Context
  • Loading branch information
lukehsiao authored Jul 25, 2018
2 parents fc3b7f1 + 638c6a6 commit 661e4ed
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 27 deletions.
10 changes: 9 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,16 @@
Version 0.2.4 (coming soon...)
Version 0.3.0 (coming soon...)
------------------------------

.. warning::
This release is NOT backwards compatable with v0.2.3. Specifically we have
removed the ``get_parent()``, ``get_children()``, and
``get_sentence_generator()`` functions from the classes inhereting from
Context in the data model.

* `@lukehsiao`_: Organize documentation for lf_helpers by modality.
(`#85 <https://github.com/HazyResearch/fonduer/pull/85>`_)
* `@lukehsiao`_: Remove get parent/children/sentence generator from Context.
(`#87 <https://github.com/HazyResearch/fonduer/pull/87>`_)

Version 0.2.3
-------------
Expand Down
2 changes: 1 addition & 1 deletion fonduer/_version.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
__version__ = "0.2.4"
__version__ = "0.3.0"
6 changes: 0 additions & 6 deletions fonduer/candidates/models/span.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,12 +177,6 @@ class Span(Context, TemporarySpan):
foreign_keys=sentence_id,
)

def get_parent(self):
return self.sentence

def get_children(self):
return None

def _get_instance(self, **kwargs):
return Span(**kwargs)

Expand Down
9 changes: 0 additions & 9 deletions fonduer/parser/models/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,6 @@ class Context(_meta.Base):

__mapper_args__ = {"polymorphic_identity": "context", "polymorphic_on": type}

def get_parent(self):
raise NotImplementedError()

def get_children(self):
raise NotImplementedError()

def get_sentence_generator(self):
raise NotImplementedError()


def construct_stable_id(
parent_context,
Expand Down
10 changes: 0 additions & 10 deletions fonduer/parser/models/document.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,6 @@ class Document(Context):

__mapper_args__ = {"polymorphic_identity": "document"}

def get_parent(self):
return None

def get_children(self):
return self.sentences

def get_sentence_generator(self):
for sentence in self.sentences:
yield sentence

def __repr__(self):
return "Document " + str(self.name)

Expand Down

0 comments on commit 661e4ed

Please sign in to comment.