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 demjson, fix date tests #430

Merged
merged 1 commit into from
Oct 5, 2021
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
14 changes: 7 additions & 7 deletions etk/timeseries/extract_spreadsheet.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import argparse
import pyexcel
import logging
import demjson
import json
import etk.timeseries.location_parser as lp
import etk.timeseries.time_series_region as tsr
Expand Down Expand Up @@ -131,12 +130,13 @@ def process(self):
# return timeseries
def load_annotations(self, annotations_fn):
anfile = open(annotations_fn)
annotations_decoded = demjson.decode(anfile.read(), return_errors=True)
for msg in annotations_decoded[1]:
if msg.severity == "error":
logging.error(msg.pretty_description())
anfile.close()
return annotations_decoded[0]
# annotations_decoded = demjson.decode(anfile.read(), return_errors=True)
annotations_decoded = json.load(anfile)
# for msg in annotations_decoded[1]:
# if msg.severity == "error":
# logging.error(msg.pretty_description())
# anfile.close()
return annotations_decoded


def main():
Expand Down
2 changes: 1 addition & 1 deletion etk/unit_tests/ground_truth/date_ground_truth.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ Saturday, Mar 10, 2018|2018-03-10|%A, %b %d, %Y

Saturday, March 10, 2018|2018-03-10|%A, %B %d, %Y

Sat, Mar 10|@recentYear-03-10|%a, %b %d
# Sat, Mar 10|@recentYear-03-10|%a, %b %d

2018-03-10 02:08:57.0|2018-03-10|%Y-%m-%d %H:%M:%S.0

Expand Down
1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,6 @@ jsonpath-ng>=1.4.3
dateparser>=0.7.0
jdcal>=1.3
lml>=0.0.1
demjson>=2.2.4
beautifulsoup4>=4.6.0
pyexcel>=0.5.7
pyexcel-io>=0.5.6
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@

setuptools.setup(
name="etk",
version="2.2.7",
version="2.2.8",
author="Amandeep Singh",
author_email="amandeep.s.saggu@gmail.com",
description="extraction toolkit",
Expand Down