Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ruff Check for other files #27

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 20 additions & 12 deletions doc/source/_extensions/generate_dl_doc.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,6 @@
import json
import os
import shutil
import subprocess
import sys
import time
from copy import deepcopy
from pathlib import Path
from textwrap import dedent
Expand Down Expand Up @@ -150,7 +147,8 @@ def generate_damage_docs(doc_folder: Path, cache_folder: Path):
Damage Models
*************

The following collections are available in our Damage and Loss Model Library:
The following collections are available
in our Damage and Loss Model Library:

.. toctree::
:maxdepth: 1
Expand Down Expand Up @@ -217,7 +215,8 @@ def generate_damage_docs(doc_folder: Path, cache_folder: Path):
# check if there are component groups defined
dlml_cmp_groups = dlml_general.get('ComponentGroups', None)

# if yes, create the corresponding directory structure and index files
# if yes, create the corresponding directory structure
# and index files
if dlml_cmp_groups is not None:
dlml_index_contents += dedent(
"""
Expand Down Expand Up @@ -309,11 +308,14 @@ def generate_damage_docs(doc_folder: Path, cache_folder: Path):
)

else:
des = comp_meta.get("Description", "")
comp_contents = dedent(
f"""
.. raw:: html

<p class="dl_comp_name"><b>{comp}</b> | {comp_meta.get("Description", "")}</p>
<p class="dl_comp_name">
<b>{comp}</b> | {des}
</p>
<div>

"""
Expand All @@ -334,10 +336,11 @@ def generate_damage_docs(doc_folder: Path, cache_folder: Path):
else:
roundup_text = ''

cmm = comp_meta['SuggestedComponentBlockSize']
comp_contents += dedent(
f"""

Suggested Block Size: {comp_meta['SuggestedComponentBlockSize']} {roundup_text}
Suggested Block Size: {cmm} {roundup_text}

"""
)
Expand Down Expand Up @@ -380,7 +383,8 @@ def generate_repair_docs(doc_folder: Path, cache_folder: Path):
Repair Consequence Models
*************************

The following collections are available in our Damage and Loss Model Library:
The following collections are available
in our Damage and Loss Model Library:

.. toctree::
:maxdepth: 1
Expand Down Expand Up @@ -447,7 +451,8 @@ def generate_repair_docs(doc_folder: Path, cache_folder: Path):
# check if there are component groups defined
dlml_cmp_groups = dlml_general.get('ComponentGroups', None)

# if yes, create the corresponding directory structure and index files
# if yes, create the corresponding directory structure
# and index files
if dlml_cmp_groups is not None:
dlml_index_contents += dedent(
"""
Expand Down Expand Up @@ -541,11 +546,12 @@ def generate_repair_docs(doc_folder: Path, cache_folder: Path):
)

else:
des = comp_meta.get("Description", "")
comp_contents = dedent(
f"""
.. raw:: html

<p class="dl_comp_name"><b>{comp}</b> | {comp_meta.get("Description", "")}</p>
<p class="dl_comp_name"><b>{comp}</b> | {des}</p>
<div>

"""
Expand All @@ -566,18 +572,20 @@ def generate_repair_docs(doc_folder: Path, cache_folder: Path):
else:
roundup_text = ''

cmm = comp_meta['SuggestedComponentBlockSize']
comp_contents += dedent(
f"""

Suggested Block Size: {comp_meta['SuggestedComponentBlockSize']} {roundup_text}
Suggested Block Size: {cmm} {roundup_text}

"""
)

comp_contents += dedent(
"""

The following repair consequences are available for this model:
The following repair consequences
are available for this model:

"""
)
Expand Down
Loading