Skip to content

bug: Instance Attributes code rendered as docstring #679

@DeaMariaLeon

Description

@DeaMariaLeon

Description of the bug

Line of code is shown on attributes.

For example on shape and fill_value:
https://sparse.pydata.org/en/latest/api/COO/#sparse.COO-attributes:~:text=shape%20%3D%20tuple(int(sh)%20for%20sh%20in%20shape)%20instance%2Dattribute

In case the link doesn't work:
Screenshot 2024-07-30 at 17 55 21

To Reproduce

WRITE MRE / INSTRUCTIONS HERE

     git clone https://github.com/pydata/sparse.git
     cd sparse
     python3 -m venv .venv
     . .venv/bin/activate

      pip install -e .[all] # or pip install -e '.[all]'

     # command or code showing the issue
     mkdocs serve

Please go to http://127.0.0.1:8000/api/COO/#sparse.COO-attributes
and search for shape = tuple(int(sh) for sh in shape) instance-attribute

Full traceback

No error raised

Expected behavior

Code should not be rendered.

Environment information

  • System: macOS-14.5-arm64-arm-64bit
  • Python: cpython 3.12.2 (/Users/dealeon/projects/bugreport/sparse/.venv/bin/python3)
  • Environment variables:
  • Installed packages:
    • mkdocstrings v0.25.2

Additional context

I removed most of the plugins on mkdocs.yml as well, and the issue was still there.


site_name: sparse
repo_url: https://github.com/pydata/sparse.git
edit_uri: edit/main/docs/

plugins:
  - gen-files:
      scripts:
      - scripts/gen_ref_pages.py
  - literate-nav
  - mkdocstrings:
      handlers:
            python:
              options:
                inherited_members: yes
                show_if_no_docstring: true
                
nav:
  - api/*
  

If I do a minimal example without using Sparse there is no issue. So, it's something to do with its structure.

Thanks in advance for any guidance/help/ideas.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions