Skip to content

Commit

Permalink
Merge branch 'main' into fix_getFlowArea
Browse files Browse the repository at this point in the history
  • Loading branch information
john-science committed Nov 20, 2024
2 parents 46fc1a5 + e13de1a commit 5983607
Show file tree
Hide file tree
Showing 55 changed files with 1,655 additions and 532 deletions.
1 change: 1 addition & 0 deletions .github/workflows/coverage.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ jobs:
mpiexec -n 2 --use-hwthread-cpus coverage run --rcfile=pyproject.toml -m pytest --cov=armi --cov-config=pyproject.toml --cov-report=lcov --cov-append --ignore=venv armi/tests/test_mpiParameters.py || true
mpiexec -n 2 --use-hwthread-cpus coverage run --rcfile=pyproject.toml -m pytest --cov=armi --cov-config=pyproject.toml --cov-report=lcov --cov-append --ignore=venv armi/tests/test_mpiDirectoryChangers.py || true
coverage combine --rcfile=pyproject.toml --keep -a
coverage report --rcfile=pyproject.toml -i --skip-empty --skip-covered --sort=cover --fail-under=90
- name: Publish to coveralls.io
uses: coverallsapp/github-action@v2
with:
Expand Down
9 changes: 9 additions & 0 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
push:
branches:
- main
pull_request:

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down Expand Up @@ -37,10 +38,18 @@ jobs:
git submodule update
make html
- name: deploy
if: github.ref == 'refs/heads/main'
uses: JamesIves/[email protected]
with:
token: ${{ secrets.ACCESS_TOKEN }}
repository-name: ${{ github.repository_owner }}/terrapower.github.io
branch: main
folder: doc/_build/html
target-folder: armi
- name: Archive Docs from PR
if: github.ref != 'refs/heads/main'
uses: actions/upload-artifact@v4
with:
name: pr-docs
path: doc/_build/html
retention-days: 5
2 changes: 2 additions & 0 deletions .github/workflows/stale.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ permissions:

jobs:
stale:
# This workflow is not designed to make sense on forks
if: github.repository == 'terrapower/armi'
runs-on: ubuntu-24.04
steps:
- uses: actions/stale@v8
Expand Down
13 changes: 7 additions & 6 deletions .github/workflows/unittests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,14 +21,15 @@ jobs:
runs-on: ubuntu-24.04
strategy:
matrix:
python: [3.9, '3.10', '3.11', '3.12']
python: [3.9, '3.10', '3.11', '3.12', '3.13']

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python }}
allow-prereleases: true
- name: Update package index
run: sudo apt-get update
- name: Install mpi libs
Expand All @@ -37,6 +38,6 @@ jobs:
run: |
pip install -e .[memprof,mpi,test]
pytest -n 4 armi
mpiexec -n 2 --use-hwthread-cpus coverage run --rcfile=pyproject.toml -m pytest --cov=armi --cov-config=pyproject.toml --ignore=venv armi/tests/test_mpiFeatures.py || true
mpiexec -n 2 --use-hwthread-cpus coverage run --rcfile=pyproject.toml -m pytest --cov=armi --cov-config=pyproject.toml --ignore=venv armi/tests/test_mpiParameters.py || true
mpiexec -n 2 --use-hwthread-cpus coverage run --rcfile=pyproject.toml -m pytest --cov=armi --cov-config=pyproject.toml --ignore=venv armi/utils/tests/test_directoryChangersMpi.py || true
mpiexec -n 2 --use-hwthread-cpus pytest armi/tests/test_mpiFeatures.py
mpiexec -n 2 --use-hwthread-cpus pytest armi/tests/test_mpiParameters.py
mpiexec -n 2 --use-hwthread-cpus pytest armi/utils/tests/test_directoryChangersMpi.py
5 changes: 3 additions & 2 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -385,8 +385,9 @@ like ARMI somewhat recently.
ARMI has been written to support specific engineering/design tasks. As such, polish in
the GUIs and output is somewhat lacking.

Most of our code is in the ``camelCase`` style, which is not the normal style for
Python. This started in 2009 and we have stuck with the convention.
The ARMI framework uses the ``camelCase`` style, which is not the standard style for Python. As this
is an issue of style, it is not considered worth the API-breaking cost to our downstream users to
change it.


License
Expand Down
10 changes: 6 additions & 4 deletions armi/bookkeeping/db/tests/test_comparedb3.py
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ def test_compareDatabaseSim(self):
dbs[1]._fullPath,
timestepCompare=[(0, 0), (0, 1)],
)
self.assertEqual(len(diffs.diffs), 477)
self.assertEqual(len(diffs.diffs), 480)
# Cycle length is only diff (x3)
self.assertEqual(diffs.nDiffs(), 3)

Expand Down Expand Up @@ -228,15 +228,17 @@ def test_diffSpecialData(self):
refData4 = f4.create_dataset("numberDensities", data=a2)
refData4.attrs["shapes"] = "2"
refData4.attrs["numDens"] = a2
refData4.attrs["specialFormatting"] = True
f5 = h5py.File("test_diffSpecialData5.hdf5", "w")
srcData5 = f5.create_dataset("numberDensities", data=a2)
srcData5.attrs["shapes"] = "2"
srcData5.attrs["numDens"] = a2
srcData5.attrs["specialFormatting"] = True

# there should an exception
with self.assertRaises(Exception) as e:
# there should a log message
with mockRunLogs.BufferLog() as mock:
_diffSpecialData(refData4, srcData5, out, dr)
self.assertIn("Unable to unpack special data for paramName", e)
self.assertIn("Unable to unpack special data for", mock.getStdout())

# make an H5 datasets that will add a np.inf diff because keys don't match
f6 = h5py.File("test_diffSpecialData6.hdf5", "w")
Expand Down
2 changes: 1 addition & 1 deletion armi/bookkeeping/historyTracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,7 +339,7 @@ def writeAssemHistory(self, a, fName=""):
out.write("\n\n\nAssembly info\n")
out.write("{0} {1}\n".format(a.getName(), a.getType()))
for b in blocks:
out.write('"{}" {} {}\n'.format(b.getType(), b.p.xsType, b.p.buGroup))
out.write('"{}" {} {}\n'.format(b.getType(), b.p.xsType, b.p.envGroup))

def preloadBlockHistoryVals(self, names, keys, timesteps):
"""
Expand Down
7 changes: 4 additions & 3 deletions armi/cases/case.py
Original file line number Diff line number Diff line change
Expand Up @@ -855,7 +855,7 @@ def _copyInputsHelper(
-------
destFilePath (or origFile) : str
"""
sourceName = os.path.basename(sourcePath)
sourceName = pathlib.Path(sourcePath).name
destFilePath = os.path.join(destPath, sourceName)
try:
pathTools.copyOrWarn(fileDescription, sourcePath, destFilePath)
Expand All @@ -880,9 +880,10 @@ def copyInterfaceInputs(
This function should now be able to handle the updating of:
- a single file (relative or absolute)
- a list of files (relative or absolute), and
- a list of files (relative or absolute)
- a file entry that has a wildcard processing into multiple files.
Glob is used to offer support for wildcards.
- a directory and its contents
If the file paths are absolute, do nothing. The case will be able to find the file.
Expand Down Expand Up @@ -950,7 +951,7 @@ def copyInterfaceInputs(
path = pathlib.Path(f)
if not WILDCARD and not RELATIVE:
try:
if path.is_absolute() and path.exists() and path.is_file():
if path.is_absolute() and path.exists():
# Path is absolute, no settings modification or filecopy needed
newFiles.append(path)
continue
Expand Down
Loading

0 comments on commit 5983607

Please sign in to comment.