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

Adding files to twirly #1

Merged
merged 15 commits into from
Jan 27, 2025
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
26 changes: 26 additions & 0 deletions .github/ISSUE_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: bug
assignees: ''

---

**Describe the bug**


**Steps to reproduce**


**Expected behavior**


**Suggested solutions**


**Additional Information**

- **qiskit-ibm-runtime version**:
- **Python version**:
- **Operating system**:
26 changes: 26 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: bug
assignees: ''

---

**Describe the bug**


**Steps to reproduce**


**Expected behavior**


**Suggested solutions**


**Additional Information**

- **qiskit-ibm-runtime version**:
- **Python version**:
- **Operating system**:
5 changes: 5 additions & 0 deletions .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
blank_issues_enabled: true
contact_links:
- name: Non-API docs issues
url: https://github.com/Qiskit/documentation/issues/new/choose
about: Open an issue about documentation in the Guides or Migration guides sections of docs.quantum.ibm.com (non-API documentation)
13 changes: 13 additions & 0 deletions .github/ISSUE_TEMPLATE/enhancement_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
name: Enhancement request
about: Suggest an idea or improvement for this project
title: ''
labels: enhancement
assignees: ''

---

**What is the expected feature or enhancement?**


**Acceptance criteria**
17 changes: 17 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
<!--
⚠️ The pull request title should be short detailed and understandable for all.
⚠️ Also, please add a release note file using reno if the change needs to be
documented in the release notes.
⚠️ If your pull request fixes an open issue, please link to the issue.

✅ I have added the tests to cover my changes.
✅ I have updated the documentation accordingly.
✅ I have read the CONTRIBUTING document.
-->

### Summary



### Details and comments
Fixes #
63 changes: 63 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# This code is part of Twirly.
#
# This is proprietary IBM software for internal use only, do not distribute outside of IBM
# Unauthorized copying of this file is strictly prohibited.
#
# (C) Copyright IBM 2025.
#
# 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.

name: CI
on:
[ push, pull_request ]
# save resources: cancel redundant workflow runs on the same branch when new commits are pushed
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
code-quality:
name: Run code quality checks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python 3.11
uses: actions/setup-python@v5
with:
python-version: 3.11
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install tox
- name: pre-commit
run: tox -e pre-commit
tests:
# only kick-off test cases when basic code quality checks succeed
needs: [ "code-quality" ]
name: Run unit tests - python${{ matrix.python-version }}-${{ matrix.os }}
runs-on: ${{ matrix.os }}
strategy:
matrix:
python-version: ['3.10', '3.11', '3.12']
os: [ "macos-latest", "ubuntu-latest", "windows-latest" ]
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt -r requirements-dev.txt
- name: Run unit tests
run: pytest test/
30 changes: 30 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v5.0.0
hooks:
- id: trailing-whitespace
- id: end-of-file-fixer
- id: check-yaml

- repo: local
hooks:
- id: run-python-script
name: Verify headers
entry: python tools/verify_headers.py --omit project_name/_version.py project_name test tools
language: system
types: [python]
exclude: ^docs

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.8.4
hooks:
# Run the linter.
- id: ruff
args: [ --fix ]
# Run the formatter.
- id: ruff-format

- repo: https://github.com/twisted/towncrier
rev: 24.8.0
hooks:
- id: towncrier-check
9 changes: 9 additions & 0 deletions CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<!-- Copyright Contributors to the Qiskit project. -->

# Code of Conduct
All members of this project agree to adhere to the Qiskit Code of Conduct listed at [https://github.com/Qiskit/qiskit/blob/master/CODE_OF_CONDUCT.md](https://github.com/Qiskit/qiskit/blob/master/CODE_OF_CONDUCT.md)

----

License: [CC BY 4.0](https://creativecommons.org/licenses/by/4.0/),
Copyright Contributors to Qiskit.
3 changes: 3 additions & 0 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
include LICENSE.txt
include requirements.txt
include twirly/VERSION.txt
36 changes: 35 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,35 @@
# twirly
# Twirly

[![License](https://img.shields.io/github/license/Qiskit/qiskit-dynamics.svg?style=popout-square)](https://opensource.org/licenses/Apache-2.0)

**This is a beta repo and does not have support or API continuity guarantees.**

Once installed it can be imported using

```python
import twirly as tw
```

## Installation

This package can be installed from the downloaded repository using pip as

```bash
cd twirly
pip install -r requirements.txt
```

To install the dependencies required by developers, use the following commands:

```bash
cd twirly
pip install -r requirements.txt -r requirements-dev.txt
```

## Contribution Guidelines

New contributions to the `main` branch will be made through the standard Pull Request and review procedure.

## License

[Apache License 2.0](LICENSE.txt)
49 changes: 49 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
[build-system]
requires = ["setuptools", "setuptools_scm"]
build-backend = "setuptools.build_meta"

[project]
name = "project-name"
dynamic = ["version"]
description = "A particle filter implementation in Python and NumPy."
readme = "README.md"
requires-python = ">=3.11"
authors = [
{ name = "Ian Hincks", email = "[email protected]" }
]
classifiers = [
"Development Status :: 3 - Alpha",
"Intended Audience :: Developers",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3.11",
]
dependencies = [
"numpy>=2",
]

[tool.setuptools_scm]
version_file = "project_name/_version.py"

[project.urls]
Homepage = "https://github.ibm.com/ibm-q-research/project-name"
BugTracker = "https://github.ibm.com/ibm-q-research/project-name/issues"

[project.optional-dependencies]
dev = [
"pytest", # For running tests
"ruff", # Formatter and linter
"pre-commit", # Pre-commit hooks
"towncrier", # Changelog management
]

[tool.ruff]
lint.select = ["E", "F", "I"] # pycodestyle, pyflake, isort
line-length = 100
target-version = "py311"

[tool.towncrier]
directory = "changelog.d"
filename = "CHANGELOG.md"
template = "towncrier:default"
version = "attr: project_name.__version__"
2 changes: 2 additions & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

pytest>=8.3
3 changes: 3 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
numpy>=1.17
qiskit>=1.3.0
qiskit-aer>=0.15.1
Loading
Loading