Fix docstring formatting and stale Args in EngineProcessor.get_config and list_configs

Aperta
#8,587 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
1/5
Tempo stimato
1-3 ore
Idoneità per principianti
91/100
Tipo di issue
Documentazione
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
python
Ambito
documentation

Direzione di ricerca

Read the get_config and list_configs docstrings in cirq-google/cirq_google/engine/engine_processor.py around lines 426–476. Compare each Args section with the method signature, correct the stale parameter descriptions and indentation, and format the Returns section as an indented block. Done when the generated EngineProcessor API reference renders both sections correctly.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

area/docstrings area/google kind/bug-report triage/discuss

Describe the issue

The docstrings for cirq_google.EngineProcessor.get_config and cirq_google.EngineProcessor.list_configs in cirq-google/cirq_google/engine/engine_processor.py have formatting errors and stale parameter documentation that break generated API reference docs:

EngineProcessor.get_config (L426–L454)
  • Returns: The quantum processor config. is on a single line instead of an indented block under Returns:, so the generated reference documentation renders it as raw plain text instead of a Returns section/table.
  • Args: lists parameters that do not exist on this method: processor_id and run_name (which also has the typo "if none id provided.").
  • The description references run_name instead of device_config_revision.
  • config_name is misdescribed as "The quantum processor's unique identifier." rather than the configuration identifier.
EngineProcessor.list_configs (L456–L476)
  • The Args: and Returns: bodies use 3-space indentation instead of 4-space indentation.
  • Args: lists processor_id, which is not a parameter of EngineProcessor.list_configs.

Explain how to reproduce the bug or problem

Inspect the docstrings in cirq-google/cirq_google/engine/engine_processor.py (lines 426–476) or the generated EngineProcessor reference documentation:

    def get_config(
        self,
        device_config_revision: processor_config.DeviceConfigRevision | None = None,
        config_name: str = '',
    ) -> processor_config.ProcessorConfig | None:
        """Retrieves a ProcessorConfig from an automation run.

        If no `run_name` and `config_name` are specified, the internally configured default config
        is returned.

        Args:
            processor_id: The processor unique identifier.
            device_config_revision: Specifies either the snapshot_id or the run_name.
            config_name: The quantum processor's unique identifier.
            run_name: The automation run name.  Use 'default'
                      if none id provided.

        Returns: The quantum processor config.
        """
    def list_configs(
        self, device_config_revision: processor_config.DeviceConfigRevision | None = None
    ) -> list[processor_config.ProcessorConfig]:
        """Returns list of ProcessorConfigs from the given snapshot.

        Args:
           processor_id: The processor unique identifier.
           device_config_revision: Specifies either the snapshot_id or the run_name.

        Returns:
           List of ProcessorConfigs for this processor.
        """

Tell us the version of Cirq where this happens

Present on main (and v1.7.0).

Lingua principale
Python
Stelle
5.1k
Fork
1.3k
Merge medio
1g 12h
PR unite (30g)
48

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di quantumlib/Cirq

Tutte le issue di quantumlib/Cirq

Issue simili

Altre issue su Python

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.