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

some tweaks to build docs and pass linting #103

Merged
merged 2 commits into from
Aug 25, 2024
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
2 changes: 1 addition & 1 deletion alignparse/consensus.py
Original file line number Diff line number Diff line change
Expand Up @@ -292,7 +292,7 @@ def maxlik_eps(self):
)
if not res.success:
raise RuntimeError(f"optimization failed:\n{res}")
return res.x
return float(res.x)


def empirical_accuracy(
Expand Down
2 changes: 1 addition & 1 deletion alignparse/cs_tag.py
Original file line number Diff line number Diff line change
Expand Up @@ -532,7 +532,7 @@ def extract_cs(self, start, end):
== end - start
), f"{feature_cs},{clip5},{clip3}"

return (feature_cs, clip5, clip3)
return (feature_cs, int(clip5), int(clip3))


@functools.lru_cache(maxsize=16384)
Expand Down
2 changes: 1 addition & 1 deletion alignparse/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ def qvals_to_accuracy(qvals, encoding="numbers"):
elif encoding != "numbers":
raise ValueError(f"invalid `encoding`: {encoding}")

return (1 - 10 ** (qvals / -10)).sum() / len(qvals)
return ((1 - 10 ** (qvals / -10)).sum() / len(qvals)).astype(object)


def sort_mutations(mut_strs):
Expand Down
6 changes: 5 additions & 1 deletion docs/README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,11 @@ Build the documentation
To build the documentation, you need ensure that you have installed the packages in `doc_requirements.txt <doc_requirements.txt>`_.
If these packages are not installed, you can install them with::

pip -r doc_requirements.txt
pip install -r doc_requirements.txt

You also may need to install ``pandoc``:

mamba install pandoc

Then simply type::

Expand Down
16 changes: 8 additions & 8 deletions docs/doc_requirements.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
sphinx>=2.0
sphinx-argparse>=0.2.5
sphinx_gallery>=0.3.1
matplotlib>=3.0.2
nbsphinx>=0.4.2
nbsphinx-link>=1.2.0
ipykernel>=5.1.0
pandoc>=2.7.3
sphinx
sphinx-argparse
sphinx_gallery
matplotlib
nbsphinx
nbsphinx-link
ipykernel
pandoc
1,447 changes: 1,403 additions & 44 deletions notebooks/flu_virus_seq_example.ipynb

Large diffs are not rendered by default.

2 changes: 2 additions & 0 deletions ruff.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@ extend-exclude = [
"dist",
"docs/_build",
".*",
"notebooks",
"tests",
]
lint.ignore = [
"D203",
Expand Down