Skip to content

Commit

Permalink
Doc/CI (all): Merged #375 improving docs and docs CI
Browse files Browse the repository at this point in the history
Impove Community documentation
  • Loading branch information
MicahGale authored May 30, 2024
2 parents 74ae807 + 4be2781 commit f4c3e86
Show file tree
Hide file tree
Showing 17 changed files with 445 additions and 105 deletions.
28 changes: 23 additions & 5 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,14 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: set up python 3.8
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.8
- run: pip install . montepy[develop]
- run: python -m pytest

build-pages:
needs: [last-minute-test, build-packages]
environment:
name: github-pages
runs-on: ubuntu-latest
Expand All @@ -27,7 +28,9 @@ jobs:
TOKEN: ${{ secrets.ACCESS_TOKEN }}
run: git config --global url."https://${TOKEN}:x-oauth-basic@github.com/".insteadOf "https://github.com/"
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
ref: main
- uses: actions/setup-python@v5
with:
python-version: 3.8
- run: pip install --user . montepy[doc]
Expand All @@ -53,13 +56,28 @@ jobs:
fetch-depth: 0
fetch-tags: true
- name: set up python 3.8
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.8
- run: pip install . montepy[build]
- uses: mathieudutour/github-tag-action@v6.2
name: Get next version number (dry)
id: version_num
with:
dry_run: True
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Update changelog version
run: |
sed -i "s/#Next Version#/${{steps.version_num.outputs.new_version}}/w changes" doc/source/changelog.rst
[[ -s changes ]] || exit 1
- name: Commit new changelog
uses: actions4git/add-commit-push@v1.0.0
with:
add-pathspec: doc/source
commit-message: Update Changelog version to ${{steps.version_num.outputs.new_version}}
- name: GitHub Actions Create Tag
id: tag_version
uses: mathieudutour/github-tag-action@v6.1
uses: mathieudutour/github-tag-action@v6.2
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
# ensure tags are up to date
Expand All @@ -85,7 +103,7 @@ jobs:
gh release upload
'${{ steps.tag_version.outputs.new_tag }}' dist/**
--repo '${{ github.repository }}'
- uses: actions/upload-artifact@v4
- uses: actions/upload-artifact@v4.3.1
with:
name: build
path: |
Expand Down
53 changes: 42 additions & 11 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: set up python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- run: pip install --upgrade pip build
Expand All @@ -35,7 +35,8 @@ jobs:
- run: pip install --user . montepy[develop]
- run: pip freeze
- name: Upload build artifacts
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4.3.1
if: ${{ matrix.python-version == '3.9' }}
with:
name: build
path: dist/*
Expand All @@ -50,7 +51,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: set up python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- run: pip install --user . montepy[test]
Expand Down Expand Up @@ -81,7 +82,7 @@ jobs:
reporter: java-junit
- name: Coveralls GitHub Action
if: ${{ matrix.python-version == '3.9' && (success() || failure() )}}
uses: coverallsapp/github-action@v2.2.3
uses: coverallsapp/github-action@v2
with:
file: coverage.xml

Expand All @@ -91,17 +92,30 @@ jobs:

steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
- name: set up python 3.8
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.8
- run: pip install . montepy[doc,build]
- uses: mathieudutour/github-tag-action@v6.2
name: Get next version number
id: version_num
with:
dry_run: True
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Update changelog version
run: |
sed -i "s/#Next Version#/${{steps.version_num.outputs.new_version}}/w changes" doc/source/changelog.rst
[[ -s changes ]] || exit 1
- run: sphinx-build doc/source/ doc/build/ -W --keep-going -E
- run: sphinx-build -b html doc/source/ doc/build/html
- uses: actions/upload-artifact@v3
name: Build site strictly
- uses: actions/upload-artifact@v4
with:
name: website
path: doc/build/html
path: doc/build
- name: Test for missing API documentation
run: |
cd doc/source
Expand All @@ -113,10 +127,27 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: set up python 3.8
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.8
- run: pip install . montepy[format]
- run: black --check montepy/ tests/




changelog-test:
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v4
- name: Check for changes
uses: dorny/paths-filter@v3
id: changes
with:
filters: |
change:
- 'doc/source/changelog.rst'
- if: steps.changes.outputs.change == 'false'
run: |
echo "Changelog not updated"
exit 1
1 change: 1 addition & 0 deletions CHANGELOG.rst
41 changes: 41 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# Contributing to MontePy

Welcome, and thank you for considering contributing to MontePy! We look forward
to welcoming new members to the community and will do our best to help you get
up to speed.

## Code of Conduct

Participants in the MontePy project are expected to follow and uphold the [Code
of Conduct](CODE_OF_CONDUCT.md). Please report any unacceptable behavior to
micah.gale@inl.gov.

## Resources

- [GitHub Repository](https://github.com/idaholab/montepy)
- [Documentation](https://idaholab.github.io/MontePy/)
- [Developer's Guide](https://idaholab.github.io/MontePy/developing.html)

## How to Report Bugs

MontePy is hosted on GitHub and all bugs are reported and tracked through the
[Issues](https://github.com/idaholab/MontePy/issues) listed on GitHub.

## How to Suggest Enhancements

If you have suggestions for new features, feel free to suggest one as a new issue.
Keep in mind that MontePy has a small development team,
and in some cases MontePy might not be the right home for the feature.
Please review the package philosophy to see if the feature would be a good fit.

## How to Submit Changes

All changes to OpenMC happen through pull requests. For a full overview of the
process, see the developer's guide section on [Contributing to
OpenMC](https://docs.openmc.org/en/latest/devguide/contributing.html).

## Code Style

Before you run off to make changes to the code, please review the [design
philosophy](https://idaholab.github.io/MontePy/developing.html#design-philosophy),
and make sure to also use [black](https://black.readthedocs.io/en/stable/index.html).
4 changes: 3 additions & 1 deletion doc/source/_test_for_missing_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import sys
import warnings

ignored = {"__pycache__", "_version.py", "__main__.py", "_cell_data_control.py"}
ignored = {"__pycache__", "_scripts", "_version.py", "__main__.py", "_cell_data_control.py"}

base = os.path.join("..", "..")

Expand All @@ -14,6 +14,8 @@ def crawl_path(rel_path):
f_name = os.path.join(rel_path, f)
if f in ignored:
continue
if f_name == "montepy/__init__.py":
continue
if os.path.isdir(os.path.join(base, f_name)):
crawl_path(f_name)
elif os.path.isfile(os.path.join(base, f_name)) and ".py" in f:
Expand Down
36 changes: 32 additions & 4 deletions doc/source/api/modules.rst
Original file line number Diff line number Diff line change
@@ -1,8 +1,36 @@
Python API
============
MontePy API
===========

Submodules
----------

.. toctree::
:maxdepth: 4
:maxdepth: 1

montepy.cell
montepy.cells
montepy.constants
montepy.errors
montepy.geometry_operators
montepy.materials
montepy.mcnp_object
montepy.mcnp_problem
montepy.numbered_mcnp_object
montepy.numbered_object_collection
montepy.particle
montepy.surface_collection
montepy.transforms
montepy.universe
montepy.universes
montepy.utilities

Subpackages
-----------

.. toctree::
:maxdepth: 2

montepy.data_inputs
montepy.input_parser
montepy.surfaces

montepy
2 changes: 1 addition & 1 deletion doc/source/api/montepy.cell.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ montepy.cell module
===================


.. automodule:: montepy.cell
.. autoclass:: montepy.cell.Cell
:members:
:undoc-members:
:show-inheritance:
2 changes: 0 additions & 2 deletions doc/source/api/montepy.data_inputs.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ montepy.data\_inputs package
:undoc-members:
:show-inheritance:

Submodules
----------

.. toctree::
:maxdepth: 4
Expand Down
5 changes: 1 addition & 4 deletions doc/source/api/montepy.input_parser.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,8 @@ montepy.input\_parser package
:undoc-members:
:show-inheritance:

Submodules
----------

.. toctree::
:maxdepth: 4
:maxdepth: 2

montepy.input_parser.block_type
montepy.input_parser.cell_parser
Expand Down
41 changes: 0 additions & 41 deletions doc/source/api/montepy.rst

This file was deleted.

4 changes: 1 addition & 3 deletions doc/source/api/montepy.surfaces.rst
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,9 @@ montepy.surfaces package
:undoc-members:
:show-inheritance:

Submodules
----------

.. toctree::
:maxdepth: 4
:maxdepth: 2

montepy.surfaces.axis_plane
montepy.surfaces.cylinder_on_axis
Expand Down
Loading

0 comments on commit f4c3e86

Please sign in to comment.