Skip to content

Commit 3d8390d

Browse files
committed
Fix some imports
1 parent dd322f8 commit 3d8390d

2 files changed

Lines changed: 39 additions & 38 deletions

File tree

docs/conf.py

Lines changed: 34 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
#!/usr/bin/env python
2-
# -*- coding: utf-8 -*-
32
#
4-
# python_hll documentation build configuration file, created by
3+
# python_hll2 documentation build configuration file, created by
54
# sphinx-quickstart on Fri Jun 9 13:47:02 2017.
65
#
76
# This file is execfile()d with the current directory set to its
@@ -20,9 +19,11 @@
2019
#
2120
import os
2221
import sys
23-
sys.path.insert(0, os.path.abspath('..'))
22+
from pathlib import Path
2423

25-
import python_hll
24+
sys.path.insert(0, Path.resolve(".."))
25+
26+
import python_hll2
2627

2728
# -- General configuration ---------------------------------------------
2829

@@ -32,33 +33,33 @@
3233

3334
# Add any Sphinx extension module names here, as strings. They can be
3435
# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
35-
extensions = ['sphinx.ext.autodoc', 'sphinx.ext.viewcode']
36+
extensions = ["sphinx.ext.autodoc", "sphinx.ext.viewcode"]
3637

3738
# Add any paths that contain templates here, relative to this directory.
38-
templates_path = ['_templates']
39+
templates_path = ["_templates"]
3940

4041
# The suffix(es) of source filenames.
4142
# You can specify multiple suffix as a list of string:
4243
#
4344
# source_suffix = ['.rst', '.md']
44-
source_suffix = '.rst'
45+
source_suffix = ".rst"
4546

4647
# The master toctree document.
47-
master_doc = 'index'
48+
master_doc = "index"
4849

4950
# General information about the project.
50-
project = u'python-hll'
51-
copyright = u"2019, Jon Aquino"
52-
author = u"Jon Aquino"
51+
project = "python-hll2"
52+
copyright = "2019, Jon Aquino"
53+
author = "Jon Aquino"
5354

5455
# The version info for the project you're documenting, acts as replacement
5556
# for |version| and |release|, also used in various other places throughout
5657
# the built documents.
5758
#
5859
# The short X.Y version.
59-
version = python_hll.__version__
60+
version = python_hll2.__version__
6061
# The full version, including alpha/beta/rc tags.
61-
release = python_hll.__version__
62+
release = python_hll2.__version__
6263

6364
# The language for content autogenerated by Sphinx. Refer to documentation
6465
# for a list of supported languages.
@@ -70,10 +71,10 @@
7071
# List of patterns, relative to source directory, that match files and
7172
# directories to ignore when looking for source files.
7273
# This patterns also effect to html_static_path and html_extra_path
73-
exclude_patterns = ['_build', 'Thumbs.db', '.DS_Store']
74+
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
7475

7576
# The name of the Pygments (syntax highlighting) style to use.
76-
pygments_style = 'sphinx'
77+
pygments_style = "sphinx"
7778

7879
# If true, `todo` and `todoList` produce output, else they produce nothing.
7980
todo_include_todos = False
@@ -84,7 +85,7 @@
8485
# The theme to use for HTML and HTML Help pages. See the documentation for
8586
# a list of builtin themes.
8687
#
87-
html_theme = 'alabaster'
88+
html_theme = "alabaster"
8889

8990
# Theme options are theme-specific and customize the look and feel of a
9091
# theme further. For a list of options available for each theme, see the
@@ -95,13 +96,13 @@
9596
# Add any paths that contain custom static files (such as style sheets) here,
9697
# relative to this directory. They are copied after the builtin static files,
9798
# so a file named "default.css" will overwrite the builtin "default.css".
98-
html_static_path = ['_static']
99+
html_static_path = ["_static"]
99100

100101

101102
# -- Options for HTMLHelp output ---------------------------------------
102103

103104
# Output file base name for HTML help builder.
104-
htmlhelp_basename = 'python_hlldoc'
105+
htmlhelp_basename = "python_hlldoc"
105106

106107

107108
# -- Options for LaTeX output ------------------------------------------
@@ -128,9 +129,9 @@
128129
# (source start file, target name, title, author, documentclass
129130
# [howto, manual, or own class]).
130131
latex_documents = [
131-
(master_doc, 'python_hll.tex',
132-
u'python-hll Documentation',
133-
u'Jon Aquino', 'manual'),
132+
(master_doc, "python_hll2.tex",
133+
"python-hll Documentation",
134+
"Jon Aquino", "manual"),
134135
]
135136

136137

@@ -139,8 +140,8 @@
139140
# One entry per manual page. List of tuples
140141
# (source start file, name, description, authors, manual section).
141142
man_pages = [
142-
(master_doc, 'python_hll',
143-
u'python-hll Documentation',
143+
(master_doc, "python_hll2",
144+
"python-hll Documentation",
144145
[author], 1)
145146
]
146147

@@ -151,27 +152,27 @@
151152
# (source start file, target name, title, author,
152153
# dir menu entry, description, category)
153154
texinfo_documents = [
154-
(master_doc, 'python_hll',
155-
u'python-hll Documentation',
155+
(master_doc, "python_hll2",
156+
"python-hll Documentation",
156157
author,
157-
'python_hll',
158-
'One line description of project.',
159-
'Miscellaneous'),
158+
"python_hll2",
159+
"One line description of project.",
160+
"Miscellaneous"),
160161
]
161162

162163
# -- Make ReadTheDocs generate API doc ----------------------------------------
163164

164165
# See https://github.com/isogeo/isogeo-api-py-minsdk/commit/df45262dae266035946839009e02e6c5e068a05f
165-
on_rtd = os.environ.get('READTHEDOCS', None) == 'True'
166+
on_rtd = os.environ.get("READTHEDOCS", None) == "True"
166167
if on_rtd:
167168
def run_apidoc(_):
168169
from sphinx.apidoc import main as apidoc_main
169170

170171
cur_dir = os.path.abspath(os.path.dirname(__file__))
171-
output_path = os.path.join(cur_dir, 'docs')
172-
modules = os.path.join(cur_dir, os.path.normpath(r"../python_hll"))
172+
output_path = os.path.join(cur_dir, "docs")
173+
modules = os.path.join(cur_dir, os.path.normpath(r"../python_hll2"))
173174
exclusions = []
174-
apidoc_main([None, '-e', '-f', '-o', output_path, modules] + exclusions)
175+
apidoc_main([None, "-e", "-f", "-o", output_path, modules] + exclusions)
175176

176177
def setup(app):
177-
app.connect('builder-inited', run_apidoc)
178+
app.connect("builder-inited", run_apidoc)

src/python_hll2/hll.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ def __init__(self, log2m, regwidth, expthresh=-1, sparseon=True, type=HLLType.EM
121121
start at. This cannot be ``None``.
122122
:type type: HLLType
123123
"""
124-
from python_hll.hllutil import HLLUtil
124+
from python_hll2.hllutil import HLLUtil
125125

126126
self._log2m = log2m
127127
if log2m < HLL.MINIMUM_LOG2M_PARAM or log2m > HLL.MAXIMUM_EXPLICIT_THRESHOLD:
@@ -409,7 +409,7 @@ def _sparse_probabilistic_algorithm_cardinality(self):
409409
:returns: the exact, unrounded cardinality given by the HLL algorithm
410410
:rtype: float
411411
"""
412-
from python_hll.hllutil import HLLUtil
412+
from python_hll2.hllutil import HLLUtil
413413
m = self._m
414414

415415
# compute the "indicator function" -- sum(2^(-M[j])) where M[j] is the
@@ -439,7 +439,7 @@ def _full_probabilistic_algorithm_cardinality(self):
439439
440440
:rtype: float
441441
"""
442-
from python_hll.hllutil import HLLUtil
442+
from python_hll2.hllutil import HLLUtil
443443
# for performance
444444
m = self._m
445445
# compute the "indicator function" -- sum(2^(-M[j])) where M[j] is the
@@ -692,7 +692,7 @@ def to_bytes(self, schema_version=SerializationUtil.DEFAULT_SCHEMA_VERSION):
692692
``None`` or empty.
693693
:rtype: list
694694
"""
695-
from python_hll.hllutil import HLLUtil
695+
from python_hll2.hllutil import HLLUtil
696696
if self._type == HLLType.EMPTY:
697697
byte_array_length = schema_version.padding_bytes(self._type)
698698
byte_array = [0] * byte_array_length
@@ -768,7 +768,7 @@ def from_bytes(cls, bytes):
768768
:returns: the deserialized HLL. This will never be ``None``.
769769
:rtype: HLL
770770
"""
771-
from python_hll.hllutil import HLLUtil
771+
from python_hll2.hllutil import HLLUtil
772772
schema_version = SerializationUtil.get_schema_version(bytes)
773773
metadata = schema_version.read_metadata(bytes)
774774

0 commit comments

Comments
 (0)