Cirq icon indicating copy to clipboard operation
Cirq copied to clipboard

API documentation drops type hints.

Open dabacon opened this issue 4 years ago • 3 comments

Description of the issue

See for example API documentation for on_each in Gate image But the signature was

def on_each(self, *targets: Union[Qid, Iterable[Any]]) -> List['cirq.Operation']:

A quick glance at this makes me think it is the non-forward reference....ones that are labeled like 'cirq.Qid' seem to show up.

dabacon avatar Nov 10 '21 21:11 dabacon

Actually it seems to be the varargs format. In https://quantumai.google/reference/python/cirq/circuits/CircuitOperations there are plenty of forward references that work, but with_qubits is broken even though annotated correctly.

daxfohl avatar Dec 22 '21 00:12 daxfohl

Noting that as of today, this problem still exists in the docs on quantumai.google.

https://quantumai.google/reference/python/cirq/CircuitOperation#mapped_circuit

mhucka avatar Mar 27 '25 03:03 mhucka

I've narrowed down the problem: the TensorFlow docs framework we're using has a set of default filters that explicitly ignores type information. The fix for this issue is thus very likely to be a matter of removing this filter from the tensorflow doc generator.

mhucka avatar Apr 07 '25 22:04 mhucka