From 47479a3b658019f5348b4e471d91363d315180c2 Mon Sep 17 00:00:00 2001 From: Giovanni Campagna Date: Thu, 16 Jan 2020 21:00:22 -0800 Subject: [PATCH] Remove ujson library Just use the standard library, the extra dependency is not worth it --- Pipfile | 1 - Pipfile.lock | 10 +--------- decanlp/predict.py | 2 +- decanlp/server.py | 2 +- decanlp/util.py | 4 ++-- decanlp/utils/saver.py | 2 +- setup.py | 1 - 7 files changed, 6 insertions(+), 16 deletions(-) diff --git a/Pipfile b/Pipfile index edee6610..c0d73656 100644 --- a/Pipfile +++ b/Pipfile @@ -10,7 +10,6 @@ numpy = "*" torch = "~=1.4" revtok = "==0.0.3" tqdm = "~=4.0" -ujson = "*" pyrouge = ">=0.1.3" sacrebleu = "~=1.0" tensorboardX = "==2.0.*" diff --git a/Pipfile.lock b/Pipfile.lock index 3143aac1..210ab86d 100644 --- a/Pipfile.lock +++ b/Pipfile.lock @@ -1,7 +1,7 @@ { "_meta": { "hash": { - "sha256": "c8a3e10dfb33615c6f43668e4ffdbd1abb10f73704be9e3bc9a327e9102c6fee" + "sha256": "31b73f746a52946e1ca1cf3dee92c32acf94a80fc06fe7a498f515ce1b8a9ab3" }, "pipfile-spec": 6, "requires": { @@ -149,7 +149,6 @@ "sha256:73ebfe9dbf22e832286dafa60473e4cd239f8592f699aa5adaf10050e6e1823c", "sha256:75bb3f31ea686f1197762692a9ee6a7550b59fc6ca3a1f4b5d7e32fb98e2da2a" ], - "index": "pypi", "version": "==2.8.1" }, "regex": { @@ -300,13 +299,6 @@ ], "version": "==3.7.4.1" }, - "ujson": { - "hashes": [ - "sha256:f66073e5506e91d204ab0c614a148d5aa938bdbf104751be66f8ad7a222f5f86" - ], - "index": "pypi", - "version": "==1.35" - }, "urllib3": { "hashes": [ "sha256:a8a318824cc77d1fd4b2bec2ded92646630d7fe8619497b142c84a9e6f5a7293", diff --git a/decanlp/predict.py b/decanlp/predict.py index 8b548299..a25c5333 100644 --- a/decanlp/predict.py +++ b/decanlp/predict.py @@ -30,7 +30,7 @@ import os from argparse import ArgumentParser -import ujson as json +import json import torch import sys import logging diff --git a/decanlp/server.py b/decanlp/server.py index 08f62869..27ec5a65 100644 --- a/decanlp/server.py +++ b/decanlp/server.py @@ -30,7 +30,7 @@ from argparse import ArgumentParser -import ujson as json +import json import torch import asyncio import logging diff --git a/decanlp/util.py b/decanlp/util.py index c521c835..28bcf803 100644 --- a/decanlp/util.py +++ b/decanlp/util.py @@ -34,7 +34,7 @@ import os import torch import random import numpy as np -import ujson as json +import json import logging from .data.numericalizer import SimpleNumericalizer from .data.example import Batch @@ -206,4 +206,4 @@ def load_config_json(args): setattr(args, r, None) args.dropout_ratio = 0.0 - args.best_checkpoint = os.path.join(args.path, args.checkpoint_name) \ No newline at end of file + args.best_checkpoint = os.path.join(args.path, args.checkpoint_name) diff --git a/decanlp/utils/saver.py b/decanlp/utils/saver.py index 2c72d7d0..3f18c338 100644 --- a/decanlp/utils/saver.py +++ b/decanlp/utils/saver.py @@ -33,7 +33,7 @@ Created on Mar 3, 2019 ''' import torch -import ujson as json +import json import os import logging diff --git a/setup.py b/setup.py index 37926e6e..f5e5cbf4 100644 --- a/setup.py +++ b/setup.py @@ -52,7 +52,6 @@ setuptools.setup( 'revtok==0.0.3', 'tqdm~=4.0', 'tensorboardX==2.0.*', - 'ujson', 'pyrouge>=0.1.3', 'sacrebleu~=1.0', 'requests~=2.22',