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

Open
#8,587 0 comments 0 reactions 0 assignees View on GitHub

Maintainers usually reply within 1 day

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
1-3 hours
Newbie friendliness
91/100
Issue type
Documentation
Clarity
Clearly specified
Activity status
Active
Tech stack
python
Domain
documentation

Research direction

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.

Written by the indexing model from the issue text.

Description

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).

Dominant language
Python
Stars
5.1k
Forks
1.3k
Avg merge
1d 12h
Merged PRs (30d)
48

Getting set up

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from quantumlib/Cirq

All issues in quantumlib/Cirq

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.