diff --git a/cryptorandom/cryptorandom.py b/cryptorandom/cryptorandom.py index 7404692..ab6388a 100644 --- a/cryptorandom/cryptorandom.py +++ b/cryptorandom/cryptorandom.py @@ -2,7 +2,6 @@ SHA-256 PRNG prototype in Python """ -from __future__ import division import numpy as np import sys import struct diff --git a/cryptorandom/prng.py b/cryptorandom/prng.py index 4d11277..e38ca3b 100644 --- a/cryptorandom/prng.py +++ b/cryptorandom/prng.py @@ -1,4 +1,3 @@ -from __future__ import division import numpy as np # LCG; defaults to RANDU, a particularly bad choice diff --git a/cryptorandom/sample.py b/cryptorandom/sample.py index ac945bf..9c1848c 100644 --- a/cryptorandom/sample.py +++ b/cryptorandom/sample.py @@ -2,7 +2,6 @@ Sampling with or without weights, with or without replacement. """ -from __future__ import division import numpy as np import math from .cryptorandom import SHA256 @@ -29,7 +28,7 @@ def get_prng(seed=None): return SHA256(seed) if hasattr(seed, "random") and hasattr(seed, "randint"): return seed - raise ValueError('%r cannot be used to seed a PRNG' % seed) + raise ValueError(f'{seed!r} cannot be used to seed a PRNG') def random_sample(a, size, replace=False, fast=False, p=None, method="sample_by_index", prng=None): diff --git a/cryptorandom/tests/test_cryptorandom.py b/cryptorandom/tests/test_cryptorandom.py index 49de4ff..d65d344 100644 --- a/cryptorandom/tests/test_cryptorandom.py +++ b/cryptorandom/tests/test_cryptorandom.py @@ -1,7 +1,5 @@ """Unit tests for cryptorandom PRNG""" -from __future__ import (absolute_import, division, - print_function, unicode_literals) import numpy as np from ..cryptorandom import SHA256, int_from_hash diff --git a/cryptorandom/tests/test_sample.py b/cryptorandom/tests/test_sample.py index 7e78255..7ccce34 100644 --- a/cryptorandom/tests/test_sample.py +++ b/cryptorandom/tests/test_sample.py @@ -1,7 +1,5 @@ """Unit tests for cryptorandom sampling functions.""" -from __future__ import (absolute_import, division, - print_function, unicode_literals) import pytest import numpy as np from ..sample import * diff --git a/doc/conf.py b/doc/conf.py index 463a420..1044a65 100644 --- a/doc/conf.py +++ b/doc/conf.py @@ -1,4 +1,3 @@ -# -*- coding: utf-8 -*- # # cryptorandom documentation build configuration file, created by # sphinx-quickstart on Fri Oct 21 12:13:15 2016. @@ -224,8 +223,8 @@ # (source start file, target name, title, # author, documentclass [howto, manual, or own class]). latex_documents = [ - (master_doc, 'cryptorandom.tex', u'cryptorandom Documentation', - u'Kellie Ottoboni and Philip B. Stark', 'manual'), + (master_doc, 'cryptorandom.tex', 'cryptorandom Documentation', + 'Kellie Ottoboni and Philip B. Stark', 'manual'), ] # The name of an image file (relative to this directory) to place at the top of @@ -254,7 +253,7 @@ # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages = [ - (master_doc, 'cryptorandom', u'cryptorandom Documentation', + (master_doc, 'cryptorandom', 'cryptorandom Documentation', [author], 1) ] @@ -268,7 +267,7 @@ # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ - (master_doc, 'cryptorandom', u'cryptorandom Documentation', + (master_doc, 'cryptorandom', 'cryptorandom Documentation', author, 'cryptorandom', 'One line description of project.', 'Miscellaneous'), ] diff --git a/setup.py b/setup.py index 311ab48..74106a4 100755 --- a/setup.py +++ b/setup.py @@ -25,7 +25,7 @@ VERSION = line.strip().split()[-1][1:-1] break -with open("README.md", "r") as fh: +with open("README.md") as fh: LONG_DESCRIPTION = fh.read() def parse_requirements_file(filename):