Skip to content
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
1 change: 0 additions & 1 deletion cryptorandom/cryptorandom.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
SHA-256 PRNG prototype in Python
"""

from __future__ import division
import numpy as np
import sys
import struct
Expand Down
1 change: 0 additions & 1 deletion cryptorandom/prng.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
from __future__ import division
import numpy as np

# LCG; defaults to RANDU, a particularly bad choice
Expand Down
3 changes: 1 addition & 2 deletions cryptorandom/sample.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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):
Expand Down
2 changes: 0 additions & 2 deletions cryptorandom/tests/test_cryptorandom.py
Original file line number Diff line number Diff line change
@@ -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

Expand Down
2 changes: 0 additions & 2 deletions cryptorandom/tests/test_sample.py
Original file line number Diff line number Diff line change
@@ -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 *
Expand Down
9 changes: 4 additions & 5 deletions doc/conf.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: utf-8 -*-
#
# cryptorandom documentation build configuration file, created by
# sphinx-quickstart on Fri Oct 21 12:13:15 2016.
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
]

Expand All @@ -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'),
]
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down