{
  "__type": "IngestedDoc",
  "__tag": 4010,
  "_content": {},
  "_ordered_sections": [],
  "item_file": null,
  "item_line": null,
  "item_type": null,
  "aliases": [],
  "example_section_data": {
    "__type": "Section",
    "__tag": 4015,
    "children": [],
    "title": [],
    "level": 0,
    "target": null
  },
  "see_also": [],
  "signature": null,
  "references": null,
  "qa": "dev:api-dev:design_conventions_modules",
  "arbitrary": [
    {
      "__type": "Section",
      "__tag": 4015,
      "children": [],
      "title": [],
      "level": 0,
      "target": null
    },
    {
      "__type": "Section",
      "__tag": 4015,
      "children": [
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "All SciPy modules should follow the following conventions. In the following, a "
            },
            {
              "__type": "Emphasis",
              "__tag": 4047,
              "children": [
                {
                  "__type": "Text",
                  "__tag": 4046,
                  "value": "SciPy module"
                }
              ]
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": " is defined as a Python package, say "
            },
            {
              "__type": "InlineCode",
              "__tag": 4051,
              "value": "yyy"
            },
            {
              "__type": "Text",
              "__tag": 4046,
              "value": ", that is located in the scipy/ directory."
            }
          ]
        },
        {
          "__type": "BulletList",
          "__tag": 4053,
          "ordered": false,
          "start": 1,
          "children": [
            {
              "__type": "ListItem",
              "__tag": 4054,
              "children": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Ideally, each SciPy module should be as self-contained as possible.   That is, it should have minimal dependencies on other packages or   modules. Even dependencies on other SciPy modules should be kept to   a minimum. A dependency on NumPy is of course assumed."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "ListItem",
              "__tag": 4054,
              "children": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Directory "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "yyy/"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " contains:"
                    }
                  ]
                },
                {
                  "__type": "BulletList",
                  "__tag": 4053,
                  "ordered": false,
                  "start": 1,
                  "children": [
                    {
                      "__type": "ListItem",
                      "__tag": 4054,
                      "children": [
                        {
                          "__type": "Paragraph",
                          "__tag": 4045,
                          "children": [
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": "A file "
                            },
                            {
                              "__type": "InlineCode",
                              "__tag": 4051,
                              "value": "meson.build"
                            },
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": " with build configuration for the submodule."
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "__type": "ListItem",
                      "__tag": 4054,
                      "children": [
                        {
                          "__type": "Paragraph",
                          "__tag": 4045,
                          "children": [
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": "A directory "
                            },
                            {
                              "__type": "InlineCode",
                              "__tag": 4051,
                              "value": "tests/"
                            },
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": " that contains files "
                            },
                            {
                              "__type": "InlineCode",
                              "__tag": 4051,
                              "value": "test_<name>.py"
                            },
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": "     corresponding to modules "
                            },
                            {
                              "__type": "InlineCode",
                              "__tag": 4051,
                              "value": "yyy/<name>{.py,.so,/}"
                            },
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": "."
                            }
                          ]
                        }
                      ]
                    },
                    {
                      "__type": "ListItem",
                      "__tag": 4054,
                      "children": [
                        {
                          "__type": "Paragraph",
                          "__tag": 4045,
                          "children": [
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": "An "
                            },
                            {
                              "__type": "InlineCode",
                              "__tag": 4051,
                              "value": "__init__.py"
                            },
                            {
                              "__type": "Text",
                              "__tag": 4046,
                              "value": " file, which loads functionality from the other files in the     directory as needed. Furthermore, it must list all public members, classes and     attributes into its ´´__all__`` attribute. Following Python's conventions, names     starting with an underscore character are considered private."
                            }
                          ]
                        }
                      ]
                    }
                  ]
                }
              ]
            },
            {
              "__type": "ListItem",
              "__tag": 4054,
              "children": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Private modules should be prefixed with an underscore "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "_"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": ",   for instance "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "yyy/_some_module.py"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "ListItem",
              "__tag": 4054,
              "children": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "User-visible functions should have good documentation following   the "
                    },
                    {
                      "__type": "Link",
                      "__tag": 4049,
                      "children": [
                        {
                          "__type": "Text",
                          "__tag": 4046,
                          "value": "NumPy documentation style"
                        }
                      ],
                      "url": "https://numpydoc.readthedocs.io/en/latest/format.html",
                      "title": ""
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "."
                    }
                  ]
                }
              ]
            },
            {
              "__type": "ListItem",
              "__tag": 4054,
              "children": [
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "The "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "__init__.py"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " of the module should contain the main reference documentation in   its docstring.  This is connected to the Sphinx   documentation under "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "doc/"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " via Sphinx's automodule directive."
                    }
                  ]
                },
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "The reference documentation should first give a categorized list of   the contents of the module using "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "autosummary::"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": " directives, and   after that explain points essential for understanding the use of the   module."
                    }
                  ]
                },
                {
                  "__type": "Paragraph",
                  "__tag": 4045,
                  "children": [
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "Tutorial-style documentation with extensive examples should be   separate and put under "
                    },
                    {
                      "__type": "InlineCode",
                      "__tag": 4051,
                      "value": "doc/source/tutorial/"
                    },
                    {
                      "__type": "Text",
                      "__tag": 4046,
                      "value": "."
                    }
                  ]
                }
              ]
            }
          ]
        },
        {
          "__type": "Paragraph",
          "__tag": 4045,
          "children": [
            {
              "__type": "Text",
              "__tag": 4046,
              "value": "See the existing SciPy submodules for guidance."
            }
          ]
        },
        {
          "__type": "Target",
          "__tag": 4061,
          "label": "NumPy documentation style",
          "url": "https://numpydoc.readthedocs.io/en/latest/format.html"
        }
      ],
      "title": [
        {
          "__type": "Text",
          "__tag": 4046,
          "value": "Design Conventions for Modules"
        }
      ],
      "level": 0,
      "target": "design_conventions_modules"
    }
  ],
  "local_refs": []
}