[General] Add API docs and pydantic for Data Dict

Fix schedule for latex
This commit is contained in:
Nick Touran 2025-12-12 09:40:02 -05:00
parent e474c140ee
commit fb28c6c5c5
11 changed files with 186 additions and 57 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 128 KiB

View file

@ -10,9 +10,11 @@
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use os.path.abspath to make it absolute, like shown here.
#
# import os
# import sys
# sys.path.insert(0, os.path.abspath('.'))
import os
import sys
SRC = os.path.abspath("../src")
sys.path.insert(0, SRC)
import datetime
# -- Project information -----------------------------------------------------
@ -39,11 +41,19 @@ extensions = [
"sphinx.ext.imgmath",
"sphinxcontrib.datatemplates",
"sphinxcontrib.mermaid",
"sphinxcontrib.apidoc",
"sphinx.ext.graphviz",
# "sphinx.ext.imgconverter", # SVG to png but rasterizes and bad
"sphinxcontrib.inkscapeconverter", # SVG to pdf without rasterizing
"sphinx_timeline",
"sphinx.ext.autodoc",
"sphinx.ext.napoleon",
"sphinx_autodoc_typehints",
"sphinx.ext.autosummary",
"sphinxcontrib.autodoc_pydantic",
"sphinx.ext.intersphinx",
"nrsk.schedule.load_schedule",
"nrsk.plant.plant_data_table",
]
# Add any paths that contain templates here, relative to this directory.
@ -84,6 +94,28 @@ html_css_files = [
# https://sphinx-needs.readthedocs.io/en/latest/installation.html#plantuml-support
plantuml = "java -Djava.awt.headless=true -jar /usr/share/plantuml/plantuml.jar"
latex_engine = "xelatex"
latex_elements = {
# "fontenc": r"\usepackage[T2A]{fontenc}",
# "babel": r"\usepackage[english,russian]{babel}",
# "fontpkg": r"""
# \setmainfont{DejaVu Serif}
# \setsansfont{DejaVu Sans}
# \setmonofont{DejaVu Sans Mono}
# """,
"figure_align": "H",
"extraclassoptions": "openany",
#'\makeatletter\@openrightfalse\makeatother'
"extrapackages": r"""
\usepackage{fancyhdr}
\usepackage{etoolbox}
\usepackage{pdflscape}
\usepackage{tabulary}
""",
"preamble": r"""
\AtBeginEnvironment{figure}{\pretocmd{\hyperlink}{\protect}{}{}}
""",
}
# LaTeX document generation options
# doesn't work with sphinx-needs
latex_documents = [
@ -123,6 +155,7 @@ latex_documents = [
# ]
rst_prolog = f"""
.. |inst| replace:: **{company_name}**
.. |project| replace:: **{project_name}**
"""
# will need to move relevant refs somewhere
@ -138,3 +171,29 @@ mermaid_version = "10.6.1"
# Sphinx Needs config
needs_include_needs = True # turn off to hide all needs (e.g. for working docs)
needs_extra_options = ["basis"]
autodoc_typehints = "description"
autodoc_typehints_description_target = "all"
autodoc_default_options = {
"members": True,
"private-members": False,
"undoc-members": True,
"ignore-module-all": True,
}
autodoc_member_order = "bysource"
apidoc_module_dir = SRC
apidoc_module_first = True
apidoc_output_dir = "api"
apidoc_separate_modules = True
autodoc_pydantic_model_show_field_summary = True
autodoc_pydantic_model_show_validator_summary = True
autodoc_pydantic_field_doc_policy = "both"
set_type_checking_flag = True
intersphinx_mapping = {
"pydantic": ("https://docs.pydantic.dev/latest", None),
"python": ("https://docs.python.org/3", None),
}

View file

@ -10,6 +10,39 @@ Glossary
.. glossary::
Configuration Management
The process of identifying and documenting the characteristics of a
facility's structures, systems and components (including computer
systems and software), and of ensuring that changes to these
characteristics are properly incorporated into the facility
documentation. :cite:p:`agencyInformationTechnologyNuclear2010`
Controlled document
Documents whose content is maintained uniform among the copies by an
administrative control system. The goal of controlling documents is to
ensure that work is performed using approved current information, not
obsolete information. Important documents to be controlled are uniquely
identified (including revision number, date, and specific copy number),
and distribution is formally controlled. Revisions to controlled
documents are uniquely tracked and implemented, including mandatory page
replacements and receipt acknowledgment. Controlled documents typically
include procedures for operations, surveillance, and maintenance, and
safety basis documents such as the SAR, and hazard and accident
analyses. :cite:p:`agencyInformationTechnologyNuclear2010`
Design basis
The range of conditions and events taken explicitly into account in the
design of a facility, according to established criteria, such that the
facility can withstand them without exceeding authorized limits by the
planned operation of safety systems.
:cite:p:`agencyInformationTechnologyNuclear2010`
Design control
Measures established to ensure that the information from design input
and design process documents for structures, systems, and components is
correctly translated into the final design.
:cite:p:`agencyInformationTechnologyNuclear2010`
Document
A written collection of information, instructions, drawings,
specifications, etc. that is *maintained* throughout the

View file

@ -9,10 +9,12 @@
purpose/index
organization/index
procedures/index
project/index
plant/index
schedule/index
bibliography
requirements/index
glossary
api/nrsk

View file

@ -5,7 +5,7 @@ This procedure governs the creation, maintenance, and retention of
:term:`Records <Record>` and :term:`Documents <Document>`.
.. impl:: Define processes for lifetime records
:links: R_GDC_1_4
:links: R_GDC_01_04
.. impl:: Define processes for Document Control
:links: R_APPB_45
@ -95,4 +95,7 @@ satisfy the needs of a lower-level procedure.
('Record', 'record'), ('Retention', 'retention')],
data,
title='Record/Document types',
) }}
) }}
See Also
^^^^^^^^

View file

@ -24,7 +24,7 @@ and `RG 1.232 <https://www.nrc.gov/docs/ML1732/ML17325A611.pdf>`_.
.. needtable:: Appendix A summary
:filter: id.startswith("R_GDC")
:columns: id
:columns: id, title
.. include:: /generated_assets/10-cfr-50-app-a-list.rst