quprep 0.1.0__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- quprep-0.1.0/.github/ISSUE_TEMPLATE/bug_report.md +26 -0
- quprep-0.1.0/.github/ISSUE_TEMPLATE/feature_request.md +19 -0
- quprep-0.1.0/.github/PULL_REQUEST_TEMPLATE.md +19 -0
- quprep-0.1.0/.github/workflows/ci.yml +39 -0
- quprep-0.1.0/.gitignore +52 -0
- quprep-0.1.0/.readthedocs.yaml +13 -0
- quprep-0.1.0/CHANGELOG.md +64 -0
- quprep-0.1.0/CODE_OF_CONDUCT.md +30 -0
- quprep-0.1.0/CONTRIBUTING.md +70 -0
- quprep-0.1.0/LICENSE +201 -0
- quprep-0.1.0/PKG-INFO +421 -0
- quprep-0.1.0/README.md +167 -0
- quprep-0.1.0/docs/api/encoders.md +56 -0
- quprep-0.1.0/docs/api/exporters.md +56 -0
- quprep-0.1.0/docs/api/index.md +57 -0
- quprep-0.1.0/docs/api/pipeline.md +77 -0
- quprep-0.1.0/docs/contributing.md +81 -0
- quprep-0.1.0/docs/getting-started/installation.md +56 -0
- quprep-0.1.0/docs/getting-started/quickstart.md +142 -0
- quprep-0.1.0/docs/guides/encodings.md +148 -0
- quprep-0.1.0/docs/guides/export.md +102 -0
- quprep-0.1.0/docs/guides/qubo.md +47 -0
- quprep-0.1.0/docs/guides/reduction.md +79 -0
- quprep-0.1.0/docs/index.md +92 -0
- quprep-0.1.0/examples/01_quickstart.ipynb +162 -0
- quprep-0.1.0/examples/01_quickstart.py +40 -0
- quprep-0.1.0/examples/02_pipeline.ipynb +201 -0
- quprep-0.1.0/examples/02_pipeline.py +58 -0
- quprep-0.1.0/examples/03_encoders.ipynb +239 -0
- quprep-0.1.0/examples/03_encoders.py +82 -0
- quprep-0.1.0/examples/04_qiskit_export.ipynb +225 -0
- quprep-0.1.0/examples/04_qiskit_export.py +90 -0
- quprep-0.1.0/examples/README.md +32 -0
- quprep-0.1.0/mkdocs.yml +66 -0
- quprep-0.1.0/pyproject.toml +93 -0
- quprep-0.1.0/quprep/__init__.py +110 -0
- quprep-0.1.0/quprep/clean/__init__.py +1 -0
- quprep-0.1.0/quprep/clean/categorical.py +95 -0
- quprep-0.1.0/quprep/clean/imputer.py +121 -0
- quprep-0.1.0/quprep/clean/outlier.py +135 -0
- quprep-0.1.0/quprep/clean/selector.py +111 -0
- quprep-0.1.0/quprep/cli.py +177 -0
- quprep-0.1.0/quprep/core/__init__.py +1 -0
- quprep-0.1.0/quprep/core/dataset.py +60 -0
- quprep-0.1.0/quprep/core/pipeline.py +181 -0
- quprep-0.1.0/quprep/core/recommender.py +65 -0
- quprep-0.1.0/quprep/encode/__init__.py +1 -0
- quprep-0.1.0/quprep/encode/amplitude.py +96 -0
- quprep-0.1.0/quprep/encode/angle.py +69 -0
- quprep-0.1.0/quprep/encode/base.py +73 -0
- quprep-0.1.0/quprep/encode/basis.py +71 -0
- quprep-0.1.0/quprep/encode/hamiltonian.py +51 -0
- quprep-0.1.0/quprep/encode/iqp.py +55 -0
- quprep-0.1.0/quprep/encode/reupload.py +56 -0
- quprep-0.1.0/quprep/export/__init__.py +1 -0
- quprep-0.1.0/quprep/export/cirq_export.py +30 -0
- quprep-0.1.0/quprep/export/pennylane_export.py +35 -0
- quprep-0.1.0/quprep/export/qasm_export.py +86 -0
- quprep-0.1.0/quprep/export/qiskit_export.py +80 -0
- quprep-0.1.0/quprep/export/tket_export.py +30 -0
- quprep-0.1.0/quprep/export/visualize.py +41 -0
- quprep-0.1.0/quprep/ingest/__init__.py +1 -0
- quprep-0.1.0/quprep/ingest/csv_ingester.py +115 -0
- quprep-0.1.0/quprep/ingest/numpy_ingester.py +77 -0
- quprep-0.1.0/quprep/ingest/profiler.py +97 -0
- quprep-0.1.0/quprep/normalize/__init__.py +1 -0
- quprep-0.1.0/quprep/normalize/scalers.py +174 -0
- quprep-0.1.0/quprep/qubo/__init__.py +1 -0
- quprep-0.1.0/quprep/qubo/constraints.py +30 -0
- quprep-0.1.0/quprep/qubo/converter.py +64 -0
- quprep-0.1.0/quprep/qubo/ising.py +41 -0
- quprep-0.1.0/quprep/qubo/problems/__init__.py +12 -0
- quprep-0.1.0/quprep/reduce/__init__.py +1 -0
- quprep-0.1.0/quprep/reduce/hardware_aware.py +55 -0
- quprep-0.1.0/quprep/reduce/lda.py +26 -0
- quprep-0.1.0/quprep/reduce/pca.py +25 -0
- quprep-0.1.0/quprep/reduce/spectral.py +46 -0
- quprep-0.1.0/tests/__init__.py +0 -0
- quprep-0.1.0/tests/test_clean.py +377 -0
- quprep-0.1.0/tests/test_cli.py +178 -0
- quprep-0.1.0/tests/test_encode.py +365 -0
- quprep-0.1.0/tests/test_export.py +277 -0
- quprep-0.1.0/tests/test_ingest.py +271 -0
- quprep-0.1.0/tests/test_normalize.py +278 -0
- quprep-0.1.0/tests/test_pipeline.py +308 -0
- quprep-0.1.0/uv.lock +3445 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Bug report
|
|
3
|
+
about: Something isn't working correctly
|
|
4
|
+
labels: bug
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
**Describe the bug**
|
|
8
|
+
A clear description of what went wrong.
|
|
9
|
+
|
|
10
|
+
**Minimal reproducible example**
|
|
11
|
+
```python
|
|
12
|
+
import quprep
|
|
13
|
+
# code that reproduces the issue
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
**Expected behaviour**
|
|
17
|
+
What you expected to happen.
|
|
18
|
+
|
|
19
|
+
**Actual behaviour**
|
|
20
|
+
What happened instead. Include the full traceback if there is one.
|
|
21
|
+
|
|
22
|
+
**Environment**
|
|
23
|
+
- QuPrep version: (`pip show quprep`)
|
|
24
|
+
- Python version:
|
|
25
|
+
- OS:
|
|
26
|
+
- Framework (if using an exporter): Qiskit / PennyLane / Cirq / TKET / other
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
---
|
|
2
|
+
name: Feature request
|
|
3
|
+
about: Suggest an addition or improvement
|
|
4
|
+
labels: enhancement
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
**What problem does this solve?**
|
|
8
|
+
Describe the gap or limitation you've encountered.
|
|
9
|
+
|
|
10
|
+
**Proposed solution**
|
|
11
|
+
What would you like to see added or changed?
|
|
12
|
+
|
|
13
|
+
**Does this fit QuPrep's scope?**
|
|
14
|
+
QuPrep handles: ingest → clean → reduce → normalize → encode → export.
|
|
15
|
+
It does not train models, simulate circuits, or run on hardware.
|
|
16
|
+
Please confirm your request falls within this scope (or explain why an exception makes sense).
|
|
17
|
+
|
|
18
|
+
**Alternatives considered**
|
|
19
|
+
Any other approaches you've thought of.
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
## Summary
|
|
2
|
+
|
|
3
|
+
<!-- What does this PR do? One or two sentences. -->
|
|
4
|
+
|
|
5
|
+
## Changes
|
|
6
|
+
|
|
7
|
+
<!-- Bullet list of changes -->
|
|
8
|
+
|
|
9
|
+
## Checklist
|
|
10
|
+
|
|
11
|
+
- [ ] Tests added or updated
|
|
12
|
+
- [ ] `CHANGELOG.md` updated under `[Unreleased]`
|
|
13
|
+
- [ ] Docstrings updated (include math formulation for encoders/normalizers)
|
|
14
|
+
- [ ] `ruff check .` passes
|
|
15
|
+
- [ ] All tests pass locally
|
|
16
|
+
|
|
17
|
+
## Related issue
|
|
18
|
+
|
|
19
|
+
Closes #
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
name: CI
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
push:
|
|
5
|
+
branches: [main]
|
|
6
|
+
pull_request:
|
|
7
|
+
branches: [main]
|
|
8
|
+
|
|
9
|
+
jobs:
|
|
10
|
+
test:
|
|
11
|
+
name: Test Python ${{ matrix.python-version }}
|
|
12
|
+
runs-on: ubuntu-latest
|
|
13
|
+
strategy:
|
|
14
|
+
fail-fast: false
|
|
15
|
+
matrix:
|
|
16
|
+
python-version: ["3.10", "3.11", "3.12"]
|
|
17
|
+
|
|
18
|
+
steps:
|
|
19
|
+
- uses: actions/checkout@v4
|
|
20
|
+
|
|
21
|
+
- name: Install uv
|
|
22
|
+
uses: astral-sh/setup-uv@v4
|
|
23
|
+
with:
|
|
24
|
+
python-version: ${{ matrix.python-version }}
|
|
25
|
+
|
|
26
|
+
- name: Install dependencies
|
|
27
|
+
run: uv sync --extra dev
|
|
28
|
+
|
|
29
|
+
- name: Lint
|
|
30
|
+
run: uv run ruff check .
|
|
31
|
+
|
|
32
|
+
- name: Run tests
|
|
33
|
+
run: uv run pytest --cov=quprep --cov-report=xml
|
|
34
|
+
|
|
35
|
+
- name: Upload coverage
|
|
36
|
+
uses: codecov/codecov-action@v4
|
|
37
|
+
with:
|
|
38
|
+
files: coverage.xml
|
|
39
|
+
continue-on-error: true
|
quprep-0.1.0/.gitignore
ADDED
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# Python
|
|
2
|
+
__pycache__/
|
|
3
|
+
*.py[cod]
|
|
4
|
+
*.pyo
|
|
5
|
+
*.pyd
|
|
6
|
+
*.so
|
|
7
|
+
*.egg
|
|
8
|
+
*.egg-info/
|
|
9
|
+
dist/
|
|
10
|
+
build/
|
|
11
|
+
.eggs/
|
|
12
|
+
pip-wheel-metadata/
|
|
13
|
+
*.whl
|
|
14
|
+
|
|
15
|
+
# Virtual environments
|
|
16
|
+
.venv/
|
|
17
|
+
venv/
|
|
18
|
+
env/
|
|
19
|
+
.env
|
|
20
|
+
|
|
21
|
+
# Testing
|
|
22
|
+
.pytest_cache/
|
|
23
|
+
.coverage
|
|
24
|
+
coverage.xml
|
|
25
|
+
htmlcov/
|
|
26
|
+
.hypothesis/
|
|
27
|
+
|
|
28
|
+
# Type checking
|
|
29
|
+
.mypy_cache/
|
|
30
|
+
.dmypy.json
|
|
31
|
+
|
|
32
|
+
# Linting
|
|
33
|
+
.ruff_cache/
|
|
34
|
+
|
|
35
|
+
# Docs
|
|
36
|
+
site/
|
|
37
|
+
docs/_build/
|
|
38
|
+
|
|
39
|
+
# IDE
|
|
40
|
+
.vscode/
|
|
41
|
+
.idea/
|
|
42
|
+
*.swp
|
|
43
|
+
*.swo
|
|
44
|
+
.DS_Store
|
|
45
|
+
|
|
46
|
+
# Jupyter
|
|
47
|
+
.ipynb_checkpoints/
|
|
48
|
+
*.ipynb
|
|
49
|
+
!examples/*.ipynb
|
|
50
|
+
|
|
51
|
+
# Distribution
|
|
52
|
+
MANIFEST
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to QuPrep will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
|
|
6
|
+
QuPrep uses [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
---
|
|
9
|
+
|
|
10
|
+
## [Unreleased]
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
14
|
+
## [0.1.0] — 2026-03-19
|
|
15
|
+
|
|
16
|
+
First public release. Covers the full ingest → clean → normalize → encode → export pipeline.
|
|
17
|
+
|
|
18
|
+
### Added
|
|
19
|
+
|
|
20
|
+
**Ingest**
|
|
21
|
+
- `CSVIngester` — CSV/TSV loading with auto delimiter detection and feature type inference (continuous, discrete, binary, categorical)
|
|
22
|
+
- `NumpyIngester` — wraps NumPy arrays, Pandas DataFrames, and list-of-lists
|
|
23
|
+
- `profiler.profile()` — dataset statistics: mean, std, min, max, missing counts per feature
|
|
24
|
+
|
|
25
|
+
**Clean**
|
|
26
|
+
- `Imputer` — missing value handling: mean, median, mode, KNN, MICE, and drop strategies; column drop threshold
|
|
27
|
+
- `OutlierHandler` — IQR, Z-score, and Isolation Forest detection with clip or remove actions
|
|
28
|
+
- `CategoricalEncoder` — one-hot, label, and ordinal encoding; merges categorical columns into the numeric matrix
|
|
29
|
+
- `FeatureSelector` — correlation, mutual information, and variance-based feature selection with optional qubit budget cap
|
|
30
|
+
|
|
31
|
+
**Normalize**
|
|
32
|
+
- `Scaler` — seven strategies: `l2`, `minmax`, `minmax_pi`, `minmax_pm_pi`, `zscore`, `binary`, `pm_one`
|
|
33
|
+
- `auto_normalizer(encoding)` — selects the mathematically correct scaler for a given encoding automatically
|
|
34
|
+
|
|
35
|
+
**Encode**
|
|
36
|
+
- `AngleEncoder` — maps features to single-qubit Ry/Rx/Rz rotation gates; depth O(1), NISQ-safe
|
|
37
|
+
- `AmplitudeEncoder` — embeds feature vectors as quantum state amplitudes; validates unit L2 norm; auto-pads to next power of two
|
|
38
|
+
- `BasisEncoder` — binarizes features to computational basis states via X gates; depth O(1)
|
|
39
|
+
|
|
40
|
+
**Export**
|
|
41
|
+
- `QASMExporter` — OpenQASM 3.0 output for angle and basis encodings; no optional dependencies required
|
|
42
|
+
- `QiskitExporter` — Qiskit `QuantumCircuit` output for angle, basis, and amplitude encodings (`pip install quprep[qiskit]`)
|
|
43
|
+
|
|
44
|
+
**Pipeline**
|
|
45
|
+
- `Pipeline.fit_transform()` — chains all stages with automatic normalization per encoding type
|
|
46
|
+
- `prepare(source, encoding, framework)` — one-liner API; defaults to QASM output with no optional dependencies
|
|
47
|
+
|
|
48
|
+
**CLI**
|
|
49
|
+
- `quprep convert <file>` — converts a CSV dataset to quantum circuits; supports `--encoding`, `--framework`, `--rotation`, `--output`, `--samples`
|
|
50
|
+
|
|
51
|
+
**Project**
|
|
52
|
+
- Apache 2.0 license
|
|
53
|
+
- GitHub Actions CI: Python 3.10, 3.11, 3.12 matrix
|
|
54
|
+
- MkDocs Material documentation with MathJax
|
|
55
|
+
- Read the Docs integration
|
|
56
|
+
- `examples/` — four worked examples as Python scripts and Jupyter notebooks
|
|
57
|
+
|
|
58
|
+
### Changed
|
|
59
|
+
- `requires-python` set to `>=3.10` (pytket and modern quantum libs require it)
|
|
60
|
+
|
|
61
|
+
---
|
|
62
|
+
|
|
63
|
+
[Unreleased]: https://github.com/quprep/quprep/compare/v0.1.0...HEAD
|
|
64
|
+
[0.1.0]: https://github.com/quprep/quprep/releases/tag/v0.1.0
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
# Code of Conduct
|
|
2
|
+
|
|
3
|
+
## Our Pledge
|
|
4
|
+
|
|
5
|
+
We are committed to making participation in this project a harassment-free experience for everyone, regardless of age, body size, disability, ethnicity, gender identity and expression, level of experience, nationality, personal appearance, race, religion, or sexual identity and orientation.
|
|
6
|
+
|
|
7
|
+
## Our Standards
|
|
8
|
+
|
|
9
|
+
Examples of behaviour that contributes to a positive environment:
|
|
10
|
+
|
|
11
|
+
- Using welcoming and inclusive language
|
|
12
|
+
- Being respectful of differing viewpoints and experience
|
|
13
|
+
- Accepting constructive criticism gracefully
|
|
14
|
+
- Focusing on what is best for the community
|
|
15
|
+
- Showing empathy towards other community members
|
|
16
|
+
|
|
17
|
+
Examples of unacceptable behaviour:
|
|
18
|
+
|
|
19
|
+
- Harassment, insults, or derogatory comments
|
|
20
|
+
- Personal or political attacks
|
|
21
|
+
- Publishing others' private information without permission
|
|
22
|
+
- Any conduct reasonably considered inappropriate in a professional setting
|
|
23
|
+
|
|
24
|
+
## Enforcement
|
|
25
|
+
|
|
26
|
+
Instances of abusive or unacceptable behaviour may be reported by opening a [GitHub issue](https://github.com/quprep/quprep/issues) marked as private, or by contacting the maintainer directly. All complaints will be reviewed and investigated.
|
|
27
|
+
|
|
28
|
+
## Attribution
|
|
29
|
+
|
|
30
|
+
This Code of Conduct is adapted from the [Contributor Covenant](https://www.contributor-covenant.org), version 2.1.
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
# Contributing to QuPrep
|
|
2
|
+
|
|
3
|
+
Thank you for your interest in contributing. QuPrep is a focused tool — contributions that keep it simple, correct, and composable are most welcome.
|
|
4
|
+
|
|
5
|
+
## Before you start
|
|
6
|
+
|
|
7
|
+
- Check [open issues](https://github.com/quprep/quprep/issues) to avoid duplicate work.
|
|
8
|
+
- For large changes, open an issue first to discuss the approach.
|
|
9
|
+
- QuPrep's scope is intentionally narrow. Features outside the ingest → clean → reduce → normalize → encode → export pipeline are unlikely to be accepted.
|
|
10
|
+
|
|
11
|
+
## Development setup
|
|
12
|
+
|
|
13
|
+
Install [uv](https://docs.astral.sh/uv/) if you don't have it:
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
curl -LsSf https://astral.sh/uv/install.sh | sh
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
Then clone and set up the project:
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
git clone https://github.com/quprep/quprep.git
|
|
23
|
+
cd quprep
|
|
24
|
+
uv sync --extra dev
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
Run tests:
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
uv run pytest
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
Lint and format:
|
|
34
|
+
|
|
35
|
+
```bash
|
|
36
|
+
uv run ruff check .
|
|
37
|
+
uv run ruff format .
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
## Pull request guidelines
|
|
41
|
+
|
|
42
|
+
- Keep PRs focused. One feature or fix per PR.
|
|
43
|
+
- Add or update tests for any changed behaviour.
|
|
44
|
+
- Update `CHANGELOG.md` under `[Unreleased]`.
|
|
45
|
+
- Docstrings should include the mathematical formulation where relevant (e.g., for encoders and normalizers).
|
|
46
|
+
- Target the `main` branch.
|
|
47
|
+
|
|
48
|
+
## Test requirements
|
|
49
|
+
|
|
50
|
+
- All tests must pass.
|
|
51
|
+
- New encoders require property-based tests (e.g., amplitude encoder must produce unit-norm states).
|
|
52
|
+
- Target ≥ 90% coverage for new modules.
|
|
53
|
+
|
|
54
|
+
## Code style
|
|
55
|
+
|
|
56
|
+
- Python ≥ 3.9, type hints encouraged.
|
|
57
|
+
- `ruff` for linting and formatting (configured in `pyproject.toml`).
|
|
58
|
+
- No external dependencies beyond core (`numpy`, `scipy`, `pandas`, `scikit-learn`). Framework packages go in optional extras only.
|
|
59
|
+
|
|
60
|
+
## Reporting bugs
|
|
61
|
+
|
|
62
|
+
Use the [bug report template](https://github.com/quprep/quprep/issues/new?template=bug_report.md). Include a minimal reproducible example.
|
|
63
|
+
|
|
64
|
+
## Questions
|
|
65
|
+
|
|
66
|
+
Use [GitHub Discussions](https://github.com/quprep/quprep/discussions) for questions. Issues are for bugs and feature requests only.
|
|
67
|
+
|
|
68
|
+
## Code of Conduct
|
|
69
|
+
|
|
70
|
+
This project follows the [Contributor Covenant](CODE_OF_CONDUCT.md). Be respectful.
|
quprep-0.1.0/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|