Skip to content

Remove copied parameter docs from Romani2025ERP._data_url - #1376

Open
dylanpulver wants to merge 1 commit into
NeuroTechX:developfrom
dylanpulver:doc-drop-copied-params-from-data-url
Open

dylanpulver wants to merge 1 commit into
NeuroTechX:developfrom
dylanpulver:doc-drop-copied-params-from-data-url

Conversation

@dylanpulver

Copy link
Copy Markdown

Description

Romani2025ERP._data_url carries a five-entry Parameters section:

subject : str          Subject identifier
path : str             Path to store data
force_update : bool    Whether to force update
update_path : bool     Whether to update path
verbose : bool         Whether to be verbose

The method is def _data_url(self) -> List[str] and its body is return [BRAINFORM_URL]. It takes none of those five.

Where they came from is not a guess: subject, path, force_update, update_path, verbose is exactly the signature of BaseDataset._download_subject, the abstract method declared in moabb/datasets/base.py, and the same five flow through bids_paths and data_path. The section was pasted from that family. Romani2025ERP does not implement _download_subject at all, so there is nothing in this class for those names to describe.

Since numpydoc resolves entries by name, the section currently documents nothing. I removed it rather than renaming anything — there is no parameter to rename it to. The docstring keeps its prose and its Returns, which are correct:

def _data_url(self) -> List[str]:
    """
    Return download URLs for the dataset.
    Required abstract method from BaseDataset.

    For local datasets, return empty list.

    Returns:
    --------
    List[str]
        List of URLs (empty for local datasets)
    """

If those five were meant to be added to _data_url rather than pasted into its docs by accident, then deleting the section is the wrong half of the fix — say so and I'll close this.

Checks

  • python -c "import ast; ast.parse(...)" — exit 0.
  • ast.get_docstring on _data_url before and after: before, 5 documented names against params=['self']; after, no Parameters section and the prose and Returns intact.
  • ruff check --no-cache --output-format=concise with the repo's own config (select = ["E","F","W","B","C4","I"], line-length 90) — output identical before and after, one pre-existing finding in both runs. Measured with the file stashed and git status --porcelain asserted empty, and the baseline re-confirmed to still contain the pasted section.
  • ruff format --check — 1 file already formatted.
  • Nothing added, so no line-length question; the diff is 13 deletions in one file.

I have not run pytest: this is a docstring-only change to a private method, and the environment here has no torch. CI is the authority on the suite.

Not changed

  • No whats_new entry. CONTRIBUTING says to update it "if needed", and a private method's docstring is not user-visible behaviour — happy to add one if you'd prefer.
  • That Returns: heading has a trailing colon and a 8-dash underline, which is not quite numpydoc. I left it alone: it is a separate claim from this one, and fixing it would be a drive-by.
  • A scan of the package finds 7 further docstring parameters that resolve to no argument, including three nemar_* entries on BaseDataset and CompoundDataset documenting sessions_per_subject. I left all of them out of this PR. Several look like they need a judgement about intent rather than a deletion, and I would rather ask than sweep.

🤖 Generated with Claude Code

_data_url(self) documented subject, path, force_update, update_path
and verbose. Those five are the signature of BaseDataset's abstract
_download_subject; _data_url takes only self.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant