Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove get parent/children/sentence generator from Context #87

Merged
merged 1 commit into from
Jul 25, 2018
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
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