• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Qiskit / qiskit / 18711961920
88%

Build:
DEFAULT BRANCH: main
Ran 22 Oct 2025 10:20AM UTC
Jobs 1
Files 872
Run time 2min
Badge
Embed ▾
README BADGES
x

If you need to use a raster PNG badge, change the '.svg' to '.png' in the link

Markdown

Textile

RDoc

HTML

Rst

22 Oct 2025 09:13AM UTC coverage: 88.218% (+0.01%) from 88.205%
18711961920

push

github

web-flow
Document subclass considerations for `Target` (#15220)

* Document subclass considerations for `Target`

The documentation of `Target` previously implied that subclassing it is
ok, and we have users that have done that.  However, subclassing it is
fragile, does not affect any transpiler pass that reads from the
`Target` in Rust space, and requires the subclass to arrange for
`__new__` to be called correctly.  I re-added a `**kwargs` variadic in
`Target.__new__` as a minor convenience; subclasses that only add
keyword-only arguments (which are generally the safest things to add)
will remain functional.  Had `Target.__new__` been defined in terms of
keyword-only arguments, we could also have added an `*args` munch too,
but as it is, adding or modifying the positional arguments to a `Target`
subclass constructor _always_ requires overriding `__new__` as well to
avoid clobbering positional `description`, `num_qubits`, etc, so there's
no benefit to having `*args`.

We should be discouraging users from subclassing `Target`; even our own
subclass of the Python-space `Target` from the Rust-space `Target` is
rather fragile with how we attempt to keep data in sync between the two.
Most APIs exposing a `Target` to their users would probably be better as
constructor functions; this is supposed to be the default way of
building a `Target`.

* Reexplain constructors vs subclassing

---------

Co-authored-by: Shelly Garion <46566946+ShellyGarion@users.noreply.github.com>

1 of 1 new or added line in 1 file covered. (100.0%)

6 existing lines in 3 files now uncovered.

93467 of 105950 relevant lines covered (88.22%)

1165152.73 hits per line

Uncovered Existing Lines

Lines Coverage ∆ File
1
73.19
0.33% crates/circuit/src/parameter/symbol_expr.rs
1
93.82
-0.24% crates/qasm2/src/expr.rs
4
92.54
0.26% crates/qasm2/src/lex.rs
Jobs
ID Job ID Ran Files Coverage
1 18711961920.1 22 Oct 2025 10:20AM UTC 872
88.22
GitHub Action Run
Source Files on build 18711961920
  • Tree
  • List 872
  • Changed 5
  • Source Changed 1
  • Coverage Changed 5
Coverage ∆ File Lines Relevant Covered Missed Hits/Line
  • Back to Repo
  • Github Actions Build #18711961920
  • b6484afd on github
  • Prev Build on gh-readonly-queue/main/pr-15229-24b1d64c78d7626da33e7bfdc0f187e16ed85524 (#18700821267)
  • Next Build on main (#18719241843)
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc