Skip to content

Commit 5cf1e1e

Browse files
authored
Merge pull request #5 from idaholab/develop
Release 0.2.5
2 parents b323df3 + 720b2cd commit 5cf1e1e

File tree

13 files changed

+306
-19
lines changed

13 files changed

+306
-19
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
---
2+
name: Bug report
3+
about: Create a report to help us improve
4+
title: ''
5+
labels: bug
6+
assignees: ''
7+
8+
---
9+
10+
**Reminders**
11+
1. This is not a place to debug your MCNP models
12+
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.
13+
1. Your model may be export controlled, or proprietary. Please change specific numbers (e.g., dimensions, material compositions, etc.) in your minimum working examples.
14+
15+
**Describe the bug**
16+
A clear and concise description of what the bug is.
17+
18+
**To Reproduce**
19+
Steps to reproduce the behavior:
20+
1. Go to '...'
21+
2. Click on '....'
22+
3. Scroll down to '....'
23+
4. See error
24+
25+
**Expected behavior**
26+
A clear and concise description of what you expected to happen.
27+
28+
**Screenshots**
29+
If applicable, add screenshots to help explain your problem.
30+
31+
**Desktop (please complete the following information):**
32+
- OS: [e.g. iOS]
33+
- Version [e.g. 0.2.5]
34+
35+
36+
**Additional context**
37+
Add any other context about the problem here.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
name: Feature request
3+
about: Suggest an idea for this project
4+
title: ''
5+
labels: 'feature request'
6+
assignees: ''
7+
8+
---
9+
10+
**Is your feature request related to a problem? Please describe.**
11+
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
12+
13+
**Describe the solution you'd like**
14+
A clear and concise description of what you want to happen.
15+
16+
**Describe alternatives you've considered**
17+
A clear and concise description of any alternative solutions or features you've considered.
18+
19+
**Additional context**
20+
Add any other context or screenshots about the feature request here.
21+
22+
**Reminder**
23+
Only the MCNP 6.2 and 6.3 user manuals are public. If this discusses a feature of MCNP you could only know by running MCNP please do not include it.

.github/workflows/deploy.yml

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
name: Deploy
2+
3+
on:
4+
push:
5+
branches: [main]
6+
7+
jobs:
8+
last-minute-test:
9+
runs-on: ubuntu-latest
10+
steps:
11+
- uses: actions/checkout@v4
12+
- name: set up python 3.8
13+
uses: actions/setup-python@v4
14+
with:
15+
python-version: 3.8
16+
- run: pip install --user -r requirements/dev.txt
17+
- run: python -m pytest
18+
19+
build-pages:
20+
environment:
21+
name: github-pages
22+
url: ${{ steps.deployment.outputs.page_url }}
23+
runs-on: ubuntu-latest
24+
steps:
25+
- name: Configure git
26+
env:
27+
TOKEN: ${{ secrets.ACCESS_TOKEN }}
28+
run: git config --global url."https://${TOKEN}:x-oauth-basic@github.com/".insteadOf "https://github.com/"
29+
- uses: actions/checkout@v4
30+
- uses: actions/setup-python@v4
31+
with:
32+
python-version: 3.8
33+
- run: pip install --user montepy[doc]
34+
- run: cd doc && make html
35+
- uses: actions/configure-pages@v4
36+
- uses: actions/upload-pages-artifact@v3
37+
with:
38+
name: deploy-pages
39+
path: doc/build/html/
40+
41+
deploy-pages:
42+
permissions:
43+
contents: read
44+
pages: write # to deploy to Pages
45+
id-token: write # to verify the deployment originates from an appropriate source
46+
environment:
47+
name: github-pages
48+
url: ${{ steps.deployment.outputs.page_url }}
49+
needs: [build-pages, last-minute-test]
50+
runs-on: ubuntu-latest
51+
steps:
52+
- run: ls -l
53+
- uses: actions/download-artifact@v4
54+
with:
55+
name: deploy-pages
56+
- run: ls -l
57+
- name: Deploy to GitHub Pages
58+
id: deployment
59+
uses: actions/deploy-pages@v4
60+
with:
61+
artifact_name: deploy-pages
62+
63+
64+
deploy-test-pypi:
65+
environment:
66+
name: test-pypi
67+
url: https://test.pypi.org/p/montepy # Replace <package-name> with your PyPI project name
68+
needs: [deploy-pages]
69+
permissions:
70+
contents: read
71+
id-token: write
72+
runs-on: ubuntu-latest
73+
steps:
74+
- uses: actions/checkout@v4
75+
- uses: actions/setup-python@v4
76+
with:
77+
python-version: 3.8
78+
- run: python -m pip install build
79+
- run: python -m build --sdist --wheel
80+
- name: Publish distribution 📦 to PyPI
81+
uses: pypa/gh-action-pypi-publish@release/v1
82+
with:
83+
repository-url: https://test.pypi.org/legacy/
84+
85+
deploy-pypi:
86+
environment:
87+
name: pypi
88+
url: https://pypi.org/p/montepy # Replace <package-name> with your PyPI project name
89+
needs: [deploy-pages, deploy-test-pypi]
90+
permissions:
91+
contents: read
92+
id-token: write
93+
runs-on: ubuntu-latest
94+
steps:
95+
- uses: actions/checkout@v4
96+
- uses: actions/setup-python@v4
97+
with:
98+
python-version: 3.8
99+
- run: python -m pip install build
100+
- run: python -m build --sdist --wheel
101+
- name: Publish distribution 📦 to PyPI
102+
uses: pypa/gh-action-pypi-publish@release/v1
103+
104+
105+

.github/workflows/main.yml

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
name: Test package
2+
3+
on: [push]
4+
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
strategy:
9+
matrix:
10+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
11+
12+
steps:
13+
- uses: actions/checkout@v4
14+
- name: set up python ${{ matrix.python-version }}
15+
uses: actions/setup-python@v4
16+
with:
17+
python-version: ${{ matrix.python-version }}
18+
- run: pip install --upgrade pip build
19+
- run: pip install -r requirements/common.txt
20+
- run: python -m build --sdist --wheel
21+
- run: pip install .
22+
- run: pip uninstall -y montepy
23+
- run: pip install --user dist/*.whl
24+
- run: pip uninstall -y montepy
25+
- run: pip install --user dist/*.tar.gz
26+
- run: pip install --user montepy[test]
27+
- run: pip install --user montepy[doc]
28+
- run: pip freeze
29+
- name: Upload build artifacts
30+
uses: actions/upload-artifact@v3
31+
with:
32+
name: build
33+
path: dist/*
34+
35+
test:
36+
runs-on: ubuntu-latest
37+
strategy:
38+
matrix:
39+
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
40+
41+
steps:
42+
- uses: actions/checkout@v4
43+
- name: set up python ${{ matrix.python-version }}
44+
uses: actions/setup-python@v4
45+
with:
46+
python-version: ${{ matrix.python-version }}
47+
- run: pip install --user -r requirements/dev.txt
48+
- run: coverage run -m pytest --junitxml=test_report.xml
49+
- run: coverage report
50+
- run: coverage xml
51+
- name: Upload test report
52+
uses: actions/upload-artifact@v3
53+
with:
54+
name: test
55+
path: test_report.xml
56+
- name: Upload coverage report
57+
uses: actions/upload-artifact@v3
58+
with:
59+
name: coverage
60+
path: coverage.xml
61+
62+
doc-test:
63+
runs-on: ubuntu-latest
64+
65+
steps:
66+
- uses: actions/checkout@v4
67+
- name: set up python 3.8
68+
uses: actions/setup-python@v4
69+
with:
70+
python-version: 3.8
71+
- run: pip install montepy[doc]
72+
- run: sphinx-build doc/source/ doc/build/ -W --keep-going -E
73+
- run: sphinx-build -b html doc/source/ doc/build/html
74+
- uses: actions/upload-artifact@v3
75+
with:
76+
name: website
77+
path: doc/build/html
78+
79+
format-test:
80+
runs-on: ubuntu-latest
81+
82+
steps:
83+
- uses: actions/checkout@v4
84+
- name: set up python 3.8
85+
uses: actions/setup-python@v4
86+
with:
87+
python-version: 3.8
88+
- run: pip install --user -r requirements/dev.txt
89+
- run: black --check montepy/ tests/
90+
91+

README.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,17 @@
11
# MontePy
22

3+
<img src="https://raw.githubusercontent.com/idaholab/MontePy/develop/graphics/monty.svg" width="180" alt="MontePY: a cute snek on a red over white circle"/>
4+
35
A python library to read, edit, and write MCNP input files.
46

57
## Installing
68

7-
See the [Installing section in the user guide](https://experiment_analysis_all.pages.hpc.inl.gov/software/montepy/starting.html#installing).
9+
See the [Installing section in the user guide](https://idaholab.github.io/MontePy/starting.html#installing).
810

911

1012
## User Documentation
1113

12-
MontePy has a [sphinx website](https://experiment_analysis_all.pages.hpc.inl.gov/software/montepy/).
14+
MontePy has a [sphinx website](https://idaholab.github.io/MontePy/index.html).
1315
This has a getting started guide for users,
1416
as well as API documentation.
1517
There is also a developer's guide covering the design and approach of MontePy, and how to contribute.
@@ -19,9 +21,9 @@ There is also a developer's guide covering the design and approach of MontePy, a
1921
* Handles almost all MCNP input syntax including: message blocks, & continue, comments, etc.
2022
* Parses Cells, surfaces, materials, and transforms very well.
2123
* Can parse the following surfaces exactly P(X|Y|Z), C(X|Y|Z), C/(X|Y|Z) (I mean it can do PX, and PY, etc.)
22-
* Can read in all other cards but not understand them
23-
* Can write out full MCNP problem even if it doesn't fully understand a card.
24-
* Can write out the MCNP problem verbatim, if it has not been modified at all.
24+
* Can read in all other inputs but not understand them
25+
* Can write out full MCNP problem even if it doesn't fully understand an input.
26+
* Can write out the MCNP problem verbatim, and try to match
2527
* Can quickly access cells, surfaces, and materials by their numbers. For example: `cell = problem.cells[105]`.
2628
* Can quickly update cell importances. For example `cell.importance.neutron = 2.0`.
2729
* Has over 240 test cases right now
@@ -56,7 +58,7 @@ So MontePy doesn't do what you want? Right now development is done with a Just-
5658
If there's a feature you want add an issue here with the feature request tag.
5759
If you want to add a feature on your own talk to Micah Gale (but still add the issue).
5860
The system is very modular and you should be able to develop it pretty quickly.
59-
Also read the [developer's guide](https://experiment_analysis_all.pages.hpc.inl.gov/software/montepy/developing.html).
61+
Also read the [developer's guide](https://idaholab.github.io/MontePy/developing.html).
6062

6163
# Version Numbering Scheme
6264

@@ -70,4 +72,4 @@ Also read the [developer's guide](https://experiment_analysis_all.pages.hpc.inl.
7072
Official shall not change. New merges to main shall have a version number incremented.
7173

7274

73-
# Finally: make objects not regexs!
75+
# Finally: make objects not regexes!

doc/source/conf.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,8 @@
2121
# -- Project information -----------------------------------------------------
2222

2323
project = "MontePy"
24-
copyright = "2021 – 2023, Battelle Energy Alliance LLC."
25-
author = "Micah D. Gale (@galemica), Travis J. Labossiere-Hickman (@tjlaboss)"
24+
copyright = "2021 – 2024, Battelle Energy Alliance LLC."
25+
author = "Micah D. Gale (@micahgale), Travis J. Labossiere-Hickman (@tjlaboss)"
2626

2727

2828
release = importlib.metadata.version("montepy")

doc/source/developing.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -322,7 +322,7 @@ How to __str__ vs __repr__
322322
""""""""""""""""""""""""""
323323
All objects must implement ``__str__`` (called by ``str()``),
324324
and ``__repr__`` (called by ``repr()``).
325-
See `this issue <https://hpcgitlab.hpc.inl.gov/experiment_analysis/montepy/-/issues/41>`_ for a more detailed discussion.
325+
See `this issue <https://github.com/idaholab/MontePy/issues/82>`_ for a more detailed discussion.
326326
In general ``__str__`` should return a one line string with enough information to uniquely identify the object.
327327
For numbered objects this should include their number, and a few high level details.
328328
For ``__repr__`` this should include debugging information.

doc/source/index.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ See Also
2222
========
2323

2424
* `MontePy github Repository <https://github.com/idaholab/montepy>`_
25-
* `MCNP 6.2 User Manual <https://laws.lanl.gov/vhosts/mcnp.lanl.gov/pdf_files/la-ur-17-29981.pdf>`_
25+
* `MCNP 6.2 User Manual <https://mcnp.lanl.gov/pdf_files/TechReport_2017_LANL_LA-UR-17-29981_WernerArmstrongEtAl.pdf>`_
2626
* `MCNP 6.3 User Manual <https://mcnp.lanl.gov/pdf_files/TechReport_2022_LANL_LA-UR-22-30006Rev.1_KuleszaAdamsEtAl.pdf>`_
2727

2828
Indices and tables

montepy/__init__.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323
from montepy.universe import Universe
2424
import sys
2525

26-
__version__ = "0.2.4"
26+
__version__ = "0.2.5"
27+
2728
# enable deprecated warnings for users
2829
if not sys.warnoptions:
2930
import os, warnings

montepy/errors.py

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,7 @@ def __init__(self, message):
1010

1111
class MalformedInputError(ValueError):
1212
"""
13-
<<<<<<< HEAD
14-
Raised when there is an error with the MCNP input not related to the parser.
13+
Raised when there is an error with the MCNP input not related to the parser.
1514
"""
1615

1716
def __init__(self, input, message):

0 commit comments

Comments
 (0)