-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #507 from idaholab/mat_redesign
Mat redesign
- Loading branch information
Showing
71 changed files
with
5,961 additions
and
1,854 deletions.
There are no files selected for viewing
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
#!/usr/bin/env python | ||
|
||
import argparse | ||
import re | ||
import sys | ||
from setuptools_scm import get_version | ||
|
||
parser = argparse.ArgumentParser() | ||
parser.add_argument("-a", "--alpha", action="store_true") | ||
DEPLOY_VERSION = r"\d+\.\d+\.\d+" | ||
ALPHA_VERSION = DEPLOY_VERSION + r"a\d+" | ||
args = parser.parse_args() | ||
if args.alpha: | ||
print("checking alpha release") | ||
parser = ALPHA_VERSION | ||
else: | ||
print("checking Final release.") | ||
parser = DEPLOY_VERSION | ||
|
||
version = get_version() | ||
print(f"version = {version}") | ||
if not re.fullmatch(parser, version): | ||
exit(1) | ||
exit(0) |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,107 @@ | ||
name: Deploy | ||
|
||
on: | ||
push: | ||
branches: [alpha-test] | ||
|
||
|
||
jobs: | ||
last-minute-test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: set up python 3.12 | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.12 | ||
- run: pip install . montepy[develop] | ||
- run: python -m pytest | ||
|
||
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.12 | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.12 | ||
- run: pip install . montepy[build] | ||
- name: Get Version | ||
id: get_version | ||
run: echo "version=`python -m setuptools_scm`" >> $GITHUB_OUTPUT | ||
- name: Verify that this is a non-dev alpha release | ||
run: .github/scripts/check_version.py --alpha | ||
- 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: v${{ steps.get_version.outputs.version }} | ||
name: Release ${{ steps.get_version.outputs.version }} | ||
draft: true | ||
- run: >- | ||
gh release upload | ||
'v${{ steps.get_version.outputs.version }}' dist/** | ||
--repo '${{ github.repository }}' | ||
- uses: actions/upload-artifact@v4 | ||
with: | ||
name: build | ||
path: | | ||
dist/*.tar.gz | ||
dist/*.whl | ||
deploy-test-pypi: | ||
environment: | ||
name: test-pypi | ||
url: https://test.pypi.org/p/montepy # Replace <package-name> with your PyPI project name | ||
needs: [build-packages] | ||
permissions: | ||
contents: read | ||
id-token: write | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/download-artifact@v4 | ||
with: | ||
name: build | ||
path: dist/ | ||
- name: Publish distribution 📦 to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
with: | ||
repository-url: https://test.pypi.org/legacy/ | ||
|
||
deploy-pypi: | ||
environment: | ||
name: pypi | ||
url: https://pypi.org/p/montepy # Replace <package-name> with your PyPI project name | ||
needs: [deploy-pages, deploy-test-pypi, build-packages] | ||
permissions: | ||
contents: read | ||
id-token: write | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/download-artifact@v4 | ||
with: | ||
name: build | ||
path: dist/ | ||
- name: Publish distribution 📦 to PyPI | ||
uses: pypa/gh-action-pypi-publish@release/v1 | ||
|
||
|
||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,41 @@ | ||
import gc | ||
import montepy | ||
|
||
import time | ||
import tracemalloc | ||
|
||
FAIL_THRESHOLD = 30 | ||
|
||
tracemalloc.start() | ||
|
||
import montepy | ||
|
||
FAIL_THRESHOLD = 40 | ||
MEMORY_FRACTION = 0.50 | ||
|
||
starting_mem = tracemalloc.get_traced_memory()[0] | ||
print(f"starting memory with montepy. {starting_mem/1024/1024} MB") | ||
start = time.time() | ||
|
||
problem = montepy.read_input("benchmark/big_model.imcnp") | ||
|
||
stop = time.time() | ||
|
||
problem_mem = tracemalloc.get_traced_memory()[0] | ||
print(f"Took {stop - start} seconds") | ||
print(f"Memory usage report: {tracemalloc.get_traced_memory()[0]/1024/1024} MB") | ||
print(f"Memory usage report: {problem_mem/1024/1024} MB") | ||
del problem | ||
gc.collect() | ||
print(f"Memory usage report after GC: {tracemalloc.get_traced_memory()[0]/1024/1024} MB") | ||
ending_mem = tracemalloc.get_traced_memory()[0] | ||
print(f"Memory usage report after GC: {ending_mem/1024/1024} MB") | ||
|
||
if (stop - start) > FAIL_THRESHOLD: | ||
raise RuntimeError( | ||
f"Benchmark took too long to complete. It must be faster than: {FAIL_THRESHOLD} s." | ||
) | ||
|
||
prob_gc_mem = problem_mem - ending_mem | ||
prob_actual_mem = problem_mem - starting_mem | ||
gc_ratio = prob_gc_mem / prob_actual_mem | ||
print(f"{gc_ratio:.2%} of the problem's memory was garbage collected.") | ||
if (prob_gc_mem / prob_actual_mem) < MEMORY_FRACTION: | ||
raise RuntimeError( | ||
f"Benchmark had too many memory leaks. Only {gc_ratio:.2%} of the memory was collected." | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
montepy.data_inputs.nuclide module | ||
================================== | ||
|
||
|
||
.. automodule:: montepy.data_inputs.nuclide | ||
:members: | ||
:inherited-members: | ||
:undoc-members: | ||
:show-inheritance: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
montepy.input\_parser.material\_parser module | ||
============================================== | ||
|
||
|
||
.. automodule:: montepy.input_parser.material_parser | ||
:members: | ||
:inherited-members: | ||
:undoc-members: | ||
:show-inheritance: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
montepy.input\_parser.tally\_seg\_parser module | ||
=============================================== | ||
|
||
|
||
.. automodule:: montepy.input_parser.tally_seg_parser | ||
:members: | ||
:inherited-members: | ||
:undoc-members: | ||
:show-inheritance: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.