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

Documentation adjustments #5

Merged
merged 11 commits into from
Sep 11, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
22 changes: 20 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
<!-- SHIELDS -->
caleb-johnson marked this conversation as resolved.
Show resolved Hide resolved
<div align="left">

[![Release](https://img.shields.io/pypi/v/qiskit-addon-sqd.svg?label=Release)](https://github.com/Qiskit/qiskit-addon-sqd/releases)
![Platform](https://img.shields.io/badge/%F0%9F%92%BB%20Platform-Linux%20%7C%20macOS%20%7C%20Windows-informational)
[![Python](https://img.shields.io/pypi/pyversions/qiskit-addon-sqd?label=Python&logo=python)](https://www.python.org/)
[![Qiskit](https://img.shields.io/badge/Qiskit%20-%20%3E%3D1.2%20-%20%236133BD?logo=Qiskit)](https://github.com/Qiskit/qiskit)
<br />
[![Docs (stable)](https://img.shields.io/badge/%F0%9F%93%84%20Docs-stable-blue.svg)](https://qiskit.github.io/qiskit-addon-sqd/)
<!-- [![DOI](https://zenodo.org/badge/DOI/TODO](https://zenodo.org/doi/TODO -->
[![License](https://img.shields.io/github/license/Qiskit/qiskit-addon-sqd?label=License)](LICENSE.txt)
[![Downloads](https://img.shields.io/pypi/dm/qiskit-addon-sqd.svg?label=Downloads)](https://pypi.org/project/qiskit-addon-sqd/)
[![Tests](https://github.com/Qiskit/qiskit-addon-sqd/actions/workflows/test_latest_versions.yml/badge.svg)](https://github.com/Qiskit/qiskit-addon-sqd/actions/workflows/test_latest_versions.yml)
[![Coverage](https://coveralls.io/repos/github/Qiskit/qiskit-addon-sqd/badge.svg?branch=main)](https://coveralls.io/github/Qiskit/qiskit-addon-sqd?branch=main)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Might need to hold off on this one until 0.4 when I have full set of tests + bug fixes

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Have removed this coverage shield for now until I get the source code tested to standards


# Qiskit addon: sample-based quantum diagonalization (SQD)

### Table of contents
Expand Down Expand Up @@ -68,13 +83,16 @@ We follow [semantic versioning](https://semver.org/) and are guided by the princ
We may occasionally make breaking changes in order to improve the user experience.
When possible, we will keep old interfaces and mark them as deprecated, as long as they can co-exist with the
new ones.
Each substantial improvement, breaking change, or deprecation will be documented in the release notes.
Each substantial improvement, breaking change, or deprecation will be documented in the
caleb-johnson marked this conversation as resolved.
Show resolved Hide resolved
[release notes](https://qiskit.github.io/qiskit-addon-sqd/release-notes.html).

----------------------------------------------------------------------------------------------------

### Contributing

The developer guide is located at [CONTRIBUTING.md](https://github.com/Qiskit/qiskit-addon-sqd/blob/main/CONTRIBUTING.md>)
The source code is available [on GitHub](https://github.com/Qiskit/qiskit-addon-sqd).
caleb-johnson marked this conversation as resolved.
Show resolved Hide resolved

The developer guide is located at [CONTRIBUTING.md](https://github.com/Qiskit/qiskit-addon-sqd/blob/main/CONTRIBUTING.md)
in the root of this project's repository.
By participating, you are expected to uphold Qiskit's [code of conduct](https://github.com/Qiskit/qiskit/blob/main/CODE_OF_CONDUCT.md).

Expand Down
4 changes: 2 additions & 2 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,9 @@
# be documented.
sys.path.insert(0, os.path.abspath(".."))

project = "Sample-based Quantum Diagonalization"
project = "Qiskit addon: sample-based quantum diagonalization (SQD)"
project_copyright = "2024, Qiskit addons team"
description = "Classically post-process noisy samples drawn from a quantum processor to produce more accurate energy estimations"
description = "Classically postprocess noisy quantum samples to yield more accurate energy estimations"
caleb-johnson marked this conversation as resolved.
Show resolved Hide resolved
author = "Qiskit addons team"
language = "en"
release = metadata_version("qiskit-addon-sqd")
Expand Down
1 change: 1 addition & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -91,3 +91,4 @@ References
How-To Guides <how_tos/index>
API Reference <apidocs/qiskit_addon_sqd>
GitHub <https://github.com/qiskit/qiskit-addon-sqd>
Release Notes <release-notes>
3 changes: 3 additions & 0 deletions docs/release-notes.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
.. _release notes:

.. release-notes:: Release Notes
caleb-johnson marked this conversation as resolved.
Show resolved Hide resolved
41 changes: 33 additions & 8 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ build-backend = "hatchling.build"
name = "qiskit-addon-sqd"
version = "0.3.0"
readme = "README.md"
description = "Classically postprocess noisy quantum samples to yield more accurate energy estimations"
caleb-johnson marked this conversation as resolved.
Show resolved Hide resolved
license = {file = "LICENSE.txt"}
classifiers = [
classifiers = [
"Intended Audience :: Developers",
"Intended Audience :: Science/Research",
"License :: OSI Approved :: Apache Software License",
Expand All @@ -34,14 +35,17 @@ dependencies = [
[project.optional-dependencies]
dev = [
"qiskit-addon-sqd[test,nbtest,lint,docs]",
"tox>=4.4.3",
]
test = [
"tox>=4.0",
caleb-johnson marked this conversation as resolved.
Show resolved Hide resolved
basetest = [
"pytest>=8.0",
"pytest-cov>=5.0",
]
test = [
"qiskit-addon-sqd[basetest]",
]
nbtest = [
"qiskit-addon-sqd[test]",
"qiskit-addon-sqd[basetest]",
"nbmake>=1.5.0",
]
style = [
Expand All @@ -50,9 +54,9 @@ style = [
]
lint = [
"qiskit-addon-sqd[style]",
"pydocstyle==6.3.0",
"mypy==1.11.2",
"pylint>=3.2.7",
"pydocstyle==6.3",
"pylint==3.2.7",
caleb-johnson marked this conversation as resolved.
Show resolved Hide resolved
"reno>=4.1",
"toml>=0.9.6",
]
Expand All @@ -75,6 +79,14 @@ docs = [
"reno>=4.1",
]

[tool.coverage.run]
branch = true
parallel = true

[tool.coverage.report]
fail_under = 100
show_missing = true
Comment on lines +82 to +88
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This may need to be amended. See also next comment


[tool.hatch.build.targets.wheel]
only-include = [
"qiskit_addon_sqd",
Expand Down Expand Up @@ -114,7 +126,7 @@ testpaths = ["./qiskit_addon_sqd/", "./test/"]
[tool.ruff]
line-length = 100
src = ["qiskit_addon_sqd", "test"]
target-version = "py39"
target-version = "py310"
caleb-johnson marked this conversation as resolved.
Show resolved Hide resolved

[tool.ruff.lint]
select = [
Expand All @@ -140,5 +152,18 @@ max-args = 6
"E402", # module level import not at top of file
]

[tool.ruff.lint.flake8-copyright]
notice-rgx = """
# This code is a Qiskit project.

# \\(C\\) Copyright IBM 2024\\.

# This code is licensed under the Apache License, Version 2\\.0\\. You may
# obtain a copy of this license in the LICENSE\\.txt file in the root directory
# of this source tree or at http\\:\\/\\/www\\.apache\\.org\\/licenses\\/LICENSE\\-2\\.0\\.
# Any modifications or derivative works of this code must retain this
# copyright notice, and modified files need to carry a notice indicating
# that they have been altered from the originals\\.
caleb-johnson marked this conversation as resolved.
Show resolved Hide resolved
"""

[tool.typos.default.extend-words]
IY = "IY"
4 changes: 4 additions & 0 deletions releasenotes/config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
---
encoding: utf8
default_branch: main
unreleased_version_title: "Upcoming release"
Empty file added releasenotes/notes/.gitkeep
Empty file.
2 changes: 1 addition & 1 deletion test/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ These environments execute all tests using [pytest], which supports its own simp

## Notebook environments

The `notebook` and `py##-notebook` environments invoke [nbmake] to ensure that all the Jupyter notebooks in the [`docs/`](/docs/tutorials) directory execute successfully.
The `notebook` and `py##-notebook` environments invoke [nbmake] to ensure that all Jupyter notebooks in the [`docs/`](/docs/) directory execute successfully.
caleb-johnson marked this conversation as resolved.
Show resolved Hide resolved

```sh
$ tox -e py310-notebook
Expand Down
17 changes: 8 additions & 9 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
[tox]
minversion = 4.0
envlist = py{39,310,311,312}{,-notebook}, lint
minversion = 4.4.3
envlist = py{310,311,312}{,-notebook}, lint, coverage, docs
isolated_build = True

[testenv]
passenv =
SSH_AUTH_SOCK
extras =
test
commands =
Expand All @@ -26,19 +24,21 @@ extras =
commands =
ruff format --check qiskit_addon_sqd/ docs/ test/
ruff check qiskit_addon_sqd/ docs/ test/
ruff check --preview --select CPY001 --exclude "*.ipynb" qiskit_addon_sqd/ test/
nbqa ruff docs/
pydocstyle qiskit_addon_sqd/
mypy qiskit_addon_sqd/
#reno lint
pylint -rn qiskit_addon_sqd/ test/
nbqa pylint -rn docs/
pydocstyle qiskit_addon_sqd/
typos
reno lint
Copy link
Collaborator

@caleb-johnson caleb-johnson Sep 11, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I went ahead and removed typos from the linter. It found one typo and one false positive. I fixed those, and it is now failing in CI and giving no indication why (I can't reproduce locally)

I feel fairly strongly that typos gets in the way more than it helps (Ive had trouble getting dictionaries to be read and trouble getting CI to tell me what happened with typos). Unless you feel strongly about this, I may leave it out of the linter

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It surprises me, that typos caused this trouble. Here are some notes:

  • typos appears to never have been declared as a dependency (smth I overlooked as well) which makes me wonder why trying to execute the command gave an exit code 2 rather than 127, but could be the reason why it kept failing at the end
  • typos does NOT use a dictionary by design. Instead, it keeps an internal list of common typos which it detects and marks. This cuts down a LOT on false positives compared to e.g. pylint's spell checker. See here for more details.


[testenv:{,py-,py3-,py39-,py310-,py311-,py312-}notebook]
[testenv:{,py-,py3-,py310-,py311-,py312-}notebook]
extras =
nbtest
notebook-dependencies
commands =
pytest --nbmake --nbmake-timeout=3000 {posargs} docs/tutorials/
pytest --nbmake --nbmake-timeout=3000 {posargs} docs/
caleb-johnson marked this conversation as resolved.
Show resolved Hide resolved

[testenv:coverage]
caleb-johnson marked this conversation as resolved.
Show resolved Hide resolved
deps =
Expand All @@ -62,6 +62,5 @@ commands =
skip_install = true
allowlist_externals =
rm
mypy
commands =
rm -rf {toxinidir}/docs/stubs/ {toxinidir}/docs/_build/
Loading