Skip to content

Commit

Permalink
Deploy: Merge pull request #399 from idaholab/develop
Browse files Browse the repository at this point in the history
Bug fix for thermal scattering not writing out
  • Loading branch information
MicahGale committed Apr 15, 2024
2 parents 5cf1e1e + 872662f commit d910100
Show file tree
Hide file tree
Showing 46 changed files with 931 additions and 320 deletions.
70 changes: 56 additions & 14 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,36 +2,78 @@
name: Bug report
about: Create a report to help us improve
title: ''
labels: bug
labels: bugs
assignees: ''

---

<!--
**Reminders**
1. This is not a place to debug your MCNP models
1. MCNP is export controlled and only its 6.2 and 6.3 user manuals are public. Don't include any information about MCNP which is not in those manuals.
1. Your model may be export controlled, or proprietary. Please change specific numbers (e.g., dimensions, material compositions, etc.) in your minimum working examples.
1. Your model may be export controlled, or proprietary. Please change specific numbers (e.g., dimensions, material compositions, etc.) in your minimum working examples. -->

**Describe the bug**

A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.
A short code snippet of what you have ran. Please change or remove any specific values or anything that can't be public. For example:

``` python
problem = montepy.read_input("foo.imcnp")
```

**Error Message (if any)**

If an error message was printed please include the entire stacktrace. If it includes any specific values please change or remove them. For example:

``` python
In [6]: problem.cells.append(copy.deepcopy(cell))
---------------------------------------------------------------------------
NumberConflictError Traceback (most recent call last)
Cell In[6], line 1
----> 1 problem.cells.append(copy.deepcopy(cell))

File ~/dev/montepy/montepy/numbered_object_collection.py:202, in NumberedObjectCollection.append(self, obj)
200 raise TypeError(f"object being appended must be of type: {self._obj_class}")
201 if obj.number in self.numbers:
--> 202 raise NumberConflictError(
203 (
204 "There was a numbering conflict when attempting to add "
205 f"{obj} to {type(self)}. Conflict was with {self[obj.number]}"
206 )
207 )
208 else:
209 self.__num_cache[obj.number] = obj

**Screenshots**
If applicable, add screenshots to help explain your problem.
NumberConflictError: There was a numbering conflict when attempting to add CELL: 3, mat: 3, DENS: 1.0 g/cm3 to <class 'montepy.cells.Cells'>. Conflict was with CELL: 3, mat: 3, DENS: 1.0 g/cm3
```

**MCNP input file snippet**

If applicable, please include a small section of the input file you were working on. If it includes any specific values please change or remove them. For example:

```
1 1 20
-1000 $ dollar comment
imp:n,p=1 U=350 trcl=5
C surfaces
1000 SO 1
C data
C materials
C UO2 5 atpt enriched
m1 92235.80c 5 &
92238.80c 95
```

**Version**

**Desktop (please complete the following information):**
- OS: [e.g. iOS]
- Version [e.g. 0.2.5]


**Additional context**

Add any other context about the problem here.
21 changes: 21 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
<!--
If you are a first-time contributor to MontePy,
refer the developing guidelines at:
https://idaholab.github.io/MontePy/developing.html
-->

# Description

Please include a summary of the change and which issue is fixed if applicable. Please also include relevant motivation and context.

Fixes # (issue)

# Checklist

- [ ] I have performed a self-review of my own code
- [ ] I have made corresponding changes to the documentation (if applicable)
- [ ] I have added tests that prove my fix is effective or that my feature works (if applicable)
<!--
While tests will automatically be checked by CI, it is good practice to
ensure that they pass locally first.
-->
81 changes: 66 additions & 15 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches: [main]


jobs:
last-minute-test:
runs-on: ubuntu-latest
Expand All @@ -13,13 +14,12 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: 3.8
- run: pip install --user -r requirements/dev.txt
- run: pip install . montepy[develop]
- run: python -m pytest

build-pages:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Configure git
Expand All @@ -30,13 +30,67 @@ jobs:
- uses: actions/setup-python@v4
with:
python-version: 3.8
- run: pip install --user montepy[doc]
- run: pip install --user . montepy[doc]
- run: cd doc && make html
- uses: actions/configure-pages@v4
- uses: actions/upload-pages-artifact@v3
with:
name: deploy-pages
path: doc/build/html/

build-packages:
name: Build, sign, and release packages on github
runs-on: ubuntu-latest
needs: [last-minute-test]
permissions:
contents: write # IMPORTANT: mandatory for making GitHub Releases
id-token: write # IMPORTANT: mandatory for sigstore
env:
GH_TOKEN: ${{ github.token }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
- name: set up python 3.8
uses: actions/setup-python@v4
with:
python-version: 3.8
- run: pip install . montepy[build]
- name: GitHub Actions Create Tag
id: tag_version
uses: mathieudutour/github-tag-action@v6.1
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
# ensure tags are up to date
- uses: actions/checkout@v4
with:
fetch-depth: 0
fetch-tags: true
- run: python -m build .
- name: Sign the dists with Sigstore
uses: sigstore/gh-action-sigstore-python@v2.1.1
with:
inputs: >-
./dist/*.tar.gz
./dist/*.whl
- name: Create a GitHub release
uses: ncipollo/release-action@v1
with:
tag: ${{ steps.tag_version.outputs.new_tag }}
name: Release ${{ steps.tag_version.outputs.new_tag }}
body: ${{ steps.tag_version.outputs.changelog }}
draft: true
- run: >-
gh release upload
'${{ steps.tag_version.outputs.new_tag }}' dist/**
--repo '${{ github.repository }}'
- uses: actions/upload-artifact@v4
with:
name: build
path: |
dist/*.tar.gz
dist/*.whl
deploy-pages:
permissions:
Expand Down Expand Up @@ -65,18 +119,16 @@ jobs:
environment:
name: test-pypi
url: https://test.pypi.org/p/montepy # Replace <package-name> with your PyPI project name
needs: [deploy-pages]
needs: [deploy-pages, build-packages]
permissions:
contents: read
id-token: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- uses: actions/download-artifact@v4
with:
python-version: 3.8
- run: python -m pip install build
- run: python -m build --sdist --wheel
name: build
path: dist/
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1
with:
Expand All @@ -86,20 +138,19 @@ jobs:
environment:
name: pypi
url: https://pypi.org/p/montepy # Replace <package-name> with your PyPI project name
needs: [deploy-pages, deploy-test-pypi]
needs: [deploy-pages, deploy-test-pypi, build-packages]
permissions:
contents: read
id-token: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
- uses: actions/download-artifact@v4
with:
python-version: 3.8
- run: python -m pip install build
- run: python -m build --sdist --wheel
name: build
path: dist/
- name: Publish distribution 📦 to PyPI
uses: pypa/gh-action-pypi-publish@release/v1




48 changes: 38 additions & 10 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
name: Test package
name: CI testing

on: [push]
on:
pull_request:
push:
branches: [develop, main, alpha-test]

jobs:
build:
Expand All @@ -16,15 +19,20 @@ jobs:
with:
python-version: ${{ matrix.python-version }}
- run: pip install --upgrade pip build
- run: pip install -r requirements/common.txt
- run: pip install build
- run: python -m build --sdist --wheel
- run: pip install .
- run: pip uninstall -y montepy
- run: pip install --user dist/*.whl
# run scripts
- run: change_to_ascii -h
- run: pip uninstall -y montepy
- run: pip install --user dist/*.tar.gz
- run: pip install --user montepy[test]
- run: pip install --user montepy[doc]
- run: pip install --user . montepy[test]
- run: pip install --user . montepy[doc]
- run: pip install --user . montepy[format]
- run: pip install --user . montepy[build]
- run: pip install --user . montepy[develop]
- run: pip freeze
- name: Upload build artifacts
uses: actions/upload-artifact@v3
Expand All @@ -34,6 +42,7 @@ jobs:

test:
runs-on: ubuntu-latest
permissions: write-all
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
Expand All @@ -44,20 +53,35 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- run: pip install --user -r requirements/dev.txt
- run: pip install --user . montepy[test]
- run: coverage run -m pytest --junitxml=test_report.xml
- run: coverage report
- run: coverage xml
- name: Upload test report
uses: actions/upload-artifact@v3
if: ${{ matrix.python-version == '3.9' }}
uses: actions/upload-artifact@v4
with:
name: test
path: test_report.xml
- name: Upload coverage report
uses: actions/upload-artifact@v3
if: ${{ matrix.python-version == '3.9' }}
uses: actions/upload-artifact@v4
with:
name: coverage
path: coverage.xml
- name: Test Reporter
if: ${{ matrix.python-version == '3.9' }}
uses: dorny/test-reporter@v1.7.0
with:
name: CI-test-report
path: test_report.xml
reporter: java-junit
- name: Coveralls GitHub Action
if: ${{ matrix.python-version == '3.9' }}
uses: coverallsapp/github-action@v2.2.3
with:
file: coverage.xml


doc-test:
runs-on: ubuntu-latest
Expand All @@ -68,13 +92,17 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: 3.8
- run: pip install montepy[doc]
- run: pip install . montepy[doc]
- 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
with:
name: website
path: doc/build/html
- name: Test for missing API documentation
run: |
cd doc/source
python _test_for_missing_docs.py
format-test:
runs-on: ubuntu-latest
Expand All @@ -85,7 +113,7 @@ jobs:
uses: actions/setup-python@v4
with:
python-version: 3.8
- run: pip install --user -r requirements/dev.txt
- run: pip install . montepy[format]
- run: black --check montepy/ tests/


1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,3 +10,4 @@ doc/build/*
.coverage
.idea/
.ipynb_checkpoints/
montepy/_version.py
Loading

0 comments on commit d910100

Please sign in to comment.