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

Setup SQA documents for python #19015

Merged
merged 6 commits into from
Jan 19, 2023
Merged
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
10 changes: 5 additions & 5 deletions framework/doc/content/sqa/framework_srs.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
!template load file=srs.md.template project=Framework
!template load file=srs.md.template project=Framework category=framework

!template! item key=system-purpose
!include sqa/system_purpose.md
Expand Down Expand Up @@ -88,16 +88,16 @@ behaviors of each user-defined object.
!template-end!

!template item key=functional-requirements
!sqa requirements link=False collections=FUNCTIONAL category=framework
!sqa requirements link=False collections=FUNCTIONAL category={{category}}

!template item key=usability-requirements
!sqa requirements link=False collections=USABILITY category=framework
!sqa requirements link=False collections=USABILITY category={{category}}

!template item key=performance-requirements
!sqa requirements link=False collections=PERFORMANCE category=framework
!sqa requirements link=False collections=PERFORMANCE category={{category}}

!template item key=system-interfaces-requirements
!sqa requirements link=False collections=SYSTEM category=framework
!sqa requirements link=False collections=SYSTEM category={{category}}

!template! item key=human-system-integration
!! human-system-integration-begin
Expand Down
3 changes: 1 addition & 2 deletions framework/doc/content/syntax/Debug/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,10 @@

The `[Debug]` input file block is designed to contain options to enable debugging tools for a
simulation. For example, the input file snippet below demonstrates how to enable the material
property debugging tool. A complete list of the available options is provided in [#debug-params].
property debugging tool. A complete list of the available options is provided below.

!listing show_material_props_debug.i block=Debug


!syntax parameters /Debug id=debug-params


Expand Down
2 changes: 1 addition & 1 deletion framework/doc/content/syntax/Outputs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ Note, the use of "file_base" anywhere in the `[Outputs]` block disables all defa

[output-types] provides a list of the most common output types, including the short-cut syntax
as well as the type to be used when creating a sub-block. A complete list of all available
output objects is given is provided below in [#output-objects].
output objects is provided below.

!table id=output-types caption=List of common output objects included in core MOOSE framework
!include output_types.md
Expand Down
4 changes: 3 additions & 1 deletion modules/doc/config.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
Content:
- modules/doc/content
- framework/doc/content
- python/doc/content
- modules/doc/content
- modules/chemical_reactions/doc/content
- modules/combined/doc/content
- modules/contact/doc/content
Expand Down Expand Up @@ -155,6 +156,7 @@ Extensions:
reports: !include modules/doc/sqa_reports.yml
categories:
framework: !include framework/doc/sqa_framework.yml
python: !include python/doc/sqa_python.yml
contact: !include modules/contact/doc/sqa_contact.yml
electromagnetics: !include modules/electromagnetics/doc/sqa_electromagnetics.yml
fluid_properties: !include modules/fluid_properties/doc/sqa_fluid_properties.yml
Expand Down
3 changes: 1 addition & 2 deletions modules/doc/content/application_usage/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ These documentation pages aid in running MOOSE-based applications. For developm

[Input File Syntax](input_syntax.md)

[Peacock](peacock.md) - Graphical user interface and results visualization
[Peacock](python/peacock.md) - Graphical user interface and results visualization

[Tracked Apps](tracked_apps.md) - A list of applications being developed

Expand All @@ -17,4 +17,3 @@ These documentation pages aid in running MOOSE-based applications. For developm
[Restart and Recovery](restart_recover.md)

[Hypre/BoomerAMG Preconditioning](hypre.md) - In-depth discussion of using Hypre's algebraic multigrid preconditioner: BoomerAMG

Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ This will open the Peacock window and display the mesh used for the [simple diff
Peacock is a python application. As such, during the initial execution binary files are cached, which often takes a few minutes. Subsequent executions of Peacock should be quicker.

!alert note title=Bash alias for Peacock
The command-line syntax for running Peacock can be simplified by creating a bash alias for it. Be sure to visit the [application_usage/peacock.md] page to learn how to do this.
The command-line syntax for running Peacock can be simplified by creating a bash alias for it. Be sure to visit the [python/peacock.md] page to learn how to do this.

## Demonstration id=demo

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ Run the following commands to visualize the solution with PEACOCK:
replace=['<d>', 'problems',
'<e>', 'pressure_diffusion_out']

Since no numerical changes were made here, the results should be identical to the [previous step](tutorial01_app_development/step05_kernel_object.md#result-demo). Note that the above command uses the `peacock` alias so you'll need to set the `$PATH` environment variable in your bash profile (see the [application_usage/peacock.md] page). This syntax shall henceforth be used exclusively whenever executing PEACOCK.
Since no numerical changes were made here, the results should be identical to the [previous step](tutorial01_app_development/step05_kernel_object.md#result-demo). Note that the above command uses the `peacock` alias so you'll need to set the `$PATH` environment variable in your bash profile (see the [python/peacock.md] page). This syntax shall henceforth be used exclusively whenever executing PEACOCK.

### Commit id=commit-demo

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ cd ~/projects/problems/verification
```

When complete an output file will be produced with the name "1d_analytical_out.e", this file
can be viewed using [Paraview](https://www.paraview.org/) or [application_usage/peacock.md].
can be viewed using [Paraview](https://www.paraview.org/) or [python/peacock.md].


## Compute Error
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ cd ~/projects/problems/verification
```

When complete an output file will be produced with the name "2d_main_out.e", this file
can be viewed using [Paraview](https://www.paraview.org/) or [application_usage/peacock.md].
can be viewed using [Paraview](https://www.paraview.org/) or [python/peacock.md].
[tutorial03-snow-results] show the change in temperature across the domain with time. A key
feature is that the surface remains cool as the heat source warms the snow internally, creating large
temperature gradient at the surface.
Expand Down
2 changes: 1 addition & 1 deletion modules/doc/content/getting_started/new_users.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ files and implement custom behavior in an application. The [first tutorial](tuto

A text editor is necessary for creating application files. There are many options available, so please feel free to chose an editor that meets your needs. A popular option for application developers is [VSCode](https://code.visualstudio.com/), which has community developed add-ons specifically for MOOSE: [VSCode MOOSE](VSCode.md).

A graphical post-processor, particularly one that can read [ExodusII](https://prod-ng.sandia.gov/techlib-noauth/access-control.cgi/1992/922137.pdf) files, is also necessary. [!ac](MOOSE) includes a [!ac](GUI): [PEACOCK](application_usage/peacock.md). Another popular tool is [ParaView](https://www.paraview.org/). Both of these applications are free and will allow you to visualize and process the results of your simulations.
A graphical post-processor, particularly one that can read [ExodusII](https://prod-ng.sandia.gov/techlib-noauth/access-control.cgi/1992/922137.pdf) files, is also necessary. [!ac](MOOSE) includes a [!ac](GUI): [PEACOCK](python/peacock.md). Another popular tool is [ParaView](https://www.paraview.org/). Both of these applications are free and will allow you to visualize and process the results of your simulations.

## Join the Community id=join

Expand Down
2 changes: 1 addition & 1 deletion modules/doc/content/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,4 +50,4 @@ Multiphysics Object-Oriented Simulation Environment

!include upcoming_training.md

!media media/inl_blue.png dark_src=media/inl_white.png style=width:30%;display:block;margin-top:3em;margin-left:auto;margin-right:auto;
!media large_media/framework/inl_blue.png dark_src=large_media/framework/inl_white.png style=width:30%;display:block;margin-top:3em;margin-left:auto;margin-right:auto;
2 changes: 1 addition & 1 deletion modules/doc/content/infrastructure/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
The following pages describe some infrastructure that supports the development
of MOOSE and MOOSE-based applications:

- [Peacock](application_usage/peacock.md): The MOOSE graphical user interface
- [Peacock](python/peacock.md): The MOOSE graphical user interface
- [VSCode](help/development/VSCode.md)
- [MooseDocs](MooseDocs/index.md): The MOOSE documentation system
- [Python Tools](python/index.md)
Expand Down
Binary file removed modules/doc/content/media/inl_blue.png
Binary file not shown.
Binary file removed modules/doc/content/media/inl_white.png
Binary file not shown.
Binary file not shown.
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ and the temperature at 45$^{\circ}$C:
!listing modules/porous_flow/examples/lava_lamp/2phase_convection.i start=[temperature] end=[brineco2]

The porepressure is initialised to approximate hydrostatic conditions, and the total mass fraction of CO$_{2}$ is zero except towards the top of the model domain where it is 0.2. This corresponds to a gas saturation of 0.29 (the gas is almost all CO$_{2}$ and only about 0.2% brine) and the mass-fraction of CO$_{2}$ in the liquid phase is 0.048. The porosity is slightly randomised by sampling from a uniform distribution between the minimum and maximum values specified in the [RandomIC](RandomIC.md) initial condition, and this promotes initiation of the beautiful "fingers" of CO$_{2}$-rich brine seen in the results. The random field seed can be changed in the input file, or on the command line using [command line overriding](command_line_usage.md optional=True). The porosity field is output in the Exodus file that is created, so
can be visualized in the MOOSE GUI [peacock](peacock.md optional=True) or in an external visualization package.
can be visualized in the MOOSE GUI [peacock](python/peacock.md optional=True) or in an external visualization package.

!listing modules/porous_flow/examples/lava_lamp/2phase_convection.i block=ICs

Expand Down
1 change: 0 additions & 1 deletion modules/scalar_transport/doc/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ Content:
root_dir: modules/doc/content
content:
- application_usage/command_line_usage.md
- media/inl_blue.png
Renderer:
type: MooseDocs.base.MaterializeRenderer
Extensions:
Expand Down
1 change: 0 additions & 1 deletion modules/thermal_hydraulics/doc/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ Content:
root_dir: modules/doc/content
content:
- application_usage/command_line_usage.md
- media/inl_blue.png

Renderer:
type: MooseDocs.base.MaterializeRenderer
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -91,4 +91,4 @@ Please use the [migration guide](howto/thm_ad_migration_guide.md) to update your

### Developed by class=center style=font-size:90%;margin-bottom:0.5em;font-weight:100

!media media/inl_blue.png style=width:20%;display:block;margin-left:auto;margin-right:auto;
!media large_media/framework/inl_blue.png style=width:20%;display:block;margin-left:auto;margin-right:auto;
2 changes: 1 addition & 1 deletion python/MooseDocs/commands/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def command_line_options(subparser, parent):
help="Create a local live server.")
parser.add_argument('--dump', action='store_true',
help="Show page tree to the screen.")
parser.add_argument('--num-threads', '-j', type=int, choices=range(1,12),
parser.add_argument('--num-threads', '-j', type=int, choices=range(1,13),
default=int(min(multiprocessing.cpu_count() / 2, 12)),
help="The number of parallel threads to execute with. The max. is twelve.")
parser.add_argument('--port', default='8000', type=str,
Expand Down
33 changes: 18 additions & 15 deletions python/MooseDocs/extensions/sqa.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
import uuid
import json
import time
import itertools
import pyhit

import MooseDocs
Expand Down Expand Up @@ -183,14 +184,13 @@ def preExecute(self):
break

# Setup the SQAMooseAppReports to use the syntax from the running app
for reports in self.__reports.values():
for app_report in reports[2]:
app_report.app_syntax = app_syntax
app_report.exe_directory = exe_dir
app_report.exe_name = exe_name.rsplit('-', maxsplit=1)[0] if exe_name else None
if app_syntax is None:
msg = 'Attempting to inject application syntax into SQAMooseAppReport, but the syntax does not exist.'
LOG.warning(msg)
for app_report in itertools.chain.from_iterable(reports[2] for reports in self.__reports.values() if reports[2] is not None):
app_report.app_syntax = app_syntax
app_report.exe_directory = exe_dir
app_report.exe_name = exe_name.rsplit('-', maxsplit=1)[0] if exe_name else None
if app_syntax is None:
msg = 'Attempting to inject application syntax into SQAMooseAppReport, but the syntax does not exist.'
LOG.warning(msg)

# Set default collection and add RunException tests to FAILURE_ANALYSIS collection
d_type = self['default_collection']
Expand Down Expand Up @@ -340,7 +340,7 @@ def _addRequirement(self, parent, info, page, req, requirements, category, setti
# Skip add if ...
if req.deprecated:
return
if (collections is not None) and not any(c in collections for c in req.collections):
if (collections is not None) and (req.collections is not None) and not any(c in collections for c in req.collections):
return
if (types is not None) and not any(t in types for t in req.types or set()):
return
Expand Down Expand Up @@ -1009,15 +1009,18 @@ def _getBadgeText(status):

class RenderSQADocumentReport(RenderSQAReport):
def createMaterialize(self, parent, token, page):
html.Tag(parent, 'h3', string='Necessary SQA Document Report(s)')
super().createMaterialize(parent, token, page)
if token['reports']:
html.Tag(parent, 'h3', string='Necessary SQA Document Report(s)')
super().createMaterialize(parent, token, page)

class RenderSQARequirementReport(RenderSQAReport):
def createMaterialize(self, parent, token, page):
html.Tag(parent, 'h3', string='Requirement Completion Report(s)')
super().createMaterialize(parent, token, page)
if token['reports']:
html.Tag(parent, 'h3', string='Requirement Completion Report(s)')
super().createMaterialize(parent, token, page)

class RenderSQAMooseAppReport(RenderSQAReport):
def createMaterialize(self, parent, token, page):
html.Tag(parent, 'h3', string='Application Design Page Report(s)')
super().createMaterialize(parent, token, page)
if token['reports']:
html.Tag(parent, 'h3', string='Application Design Page Report(s)')
super().createMaterialize(parent, token, page)
2 changes: 1 addition & 1 deletion python/MooseDocs/test/subconfig/tests
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[Tests]
issues = '#18137'
design = subsite/index.md
design = MooseDocs/index.md

[build]
type = RunCommand
Expand Down
25 changes: 25 additions & 0 deletions python/doc/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
Content:
- framework/doc/content
- python/doc/content

Renderer:
type: MooseDocs.base.MaterializeRenderer

Extensions:
MooseDocs.extensions.appsyntax: disable
MooseDocs.extensions.navigation:
name: MOOSE Tools
repo: https://github.com/idaholab/moose
home: /python/index.md
MooseDocs.extensions.common:
shortcuts: !include framework/doc/globals.yml
MooseDocs.extensions.acronym:
acronyms: !include framework/doc/acronyms.yml
MooseDocs.extensions.template:
active: True
MooseDocs.extensions.sqa:
active: True
reports: !include python/doc/sqa_reports.yml
categories:
framework: !include framework/doc/sqa_framework.yml
python: !include python/doc/sqa_python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ during translation allowing different pages to use different readers, renderers,
extensions, which provides an extraordinary amount of flexibility about how your website is built.

As a good example of how to resolve content conflicts, consider the main
[MOOSE website](index.md exact=True) along with the [workshop/index.md alternative=missing_config.md].
MOOSE website along with the [workshop/index.md alternative=missing_config.md].
It is possible to build the [main site configuration](modules/doc/config.yml language=yaml) by
itself by running the following commands:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ card command are listed in [card-settings].
caption=Example use of the 'card' command.
!card level_set/vortex_out.mp4 title=Vortex Benchmark style=width:50%;
The level set equation is commonly used to for interface tracking, especially when the interface
velocity is known. MOOSE contains a level set module, for more information see [level_set/index.md].
velocity is known.
!devel-end!

!devel settings module=MooseDocs.extensions.gallery
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ The "style" setting may be used, as in the example below, to control the placeme
image.

!devel! example id=example-media caption=Example of the media command with an image.
!media media/inl_blue.png style=width:25%;float:right;margin-left:30px;
!media large_media/framework/inl_blue.png style=width:25%;float:right;margin-left:30px;

INL is part of the U.S. Department of Energy's complex of national laboratories. The laboratory
performs work in each of the strategic goal areas of DOE: energy, national security, science and
Expand Down Expand Up @@ -70,7 +70,7 @@ possible to create numbered images that may be referenced, as shown in [example-
The "id" and "caption" settings are available for both images and videos.

!devel! example id=example-image-float caption=Example image with caption and numbered prefix.
!media media/inl_blue.png
!media large_media/framework/inl_blue.png
id=inl-logo
caption=The Idaho National Laboratory logo.
style=width:50%;padding:20px;
Expand Down
Loading