Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/terrapower/armi into addNew…
Browse files Browse the repository at this point in the history
…CompAxialLinkMthd
  • Loading branch information
keckler committed Feb 25, 2024
2 parents 836be51 + 6163e94 commit 0c995d0
Show file tree
Hide file tree
Showing 294 changed files with 10,706 additions and 5,795 deletions.
16 changes: 7 additions & 9 deletions .github/pull_request_template.md
Expand Up @@ -8,20 +8,18 @@
<!-- Optional: Link to any related GitHub Issues -->



---

## Checklist

<!--
You (the pull requester) should put an `x` in the boxes below you have completed.
If you're unsure about any of them, don't hesitate to ask. We're here to help!
Learn what a "good PR" looks like here:
https://terrapower.github.io/armi/developer/tooling.html#good-pull-requests
(If a checkbox doesn't apply to your PR, check it anyway.)
-->

- [ ] This PR has only one purpose or idea.
- [ ] Tests have been added/updated to verify that the new/changed code works.
- [ ] This PR has only [one purpose or idea](https://terrapower.github.io/armi/developer/tooling.html#one-idea-one-pr).
- [ ] [Tests](https://terrapower.github.io/armi/developer/tooling.html#test-it) have been added/updated to verify any new/changed code.

<!-- Check the code quality -->

Expand All @@ -30,6 +28,6 @@

<!-- Check the project-level cruft -->

- [ ] The [release notes](https://terrapower.github.io/armi/release/index.html) (location `doc/release/0.X.rst`) are up-to-date with any important changes.
- [ ] The documentation is still up-to-date in the `doc` folder.
- [ ] The dependencies are still up-to-date in `setup.py`.
- [ ] The [release notes](https://terrapower.github.io/armi/developer/tooling.html#add-release-notes) have been updated if necessary.
- [ ] The [documentation](https://terrapower.github.io/armi/developer/tooling.html#document-it) is still up-to-date in the `doc` folder.
- [ ] The dependencies are still up-to-date in `pyproject.toml`.
8 changes: 6 additions & 2 deletions .github/workflows/coverage.yaml
Expand Up @@ -4,7 +4,11 @@ on:
push:
branches:
- main
paths-ignore:
- 'doc/**'
pull_request:
paths-ignore:
- 'doc/**'

jobs:
build:
Expand All @@ -25,9 +29,9 @@ jobs:
- name: Install Tox and any other packages
run: pip install tox
- name: Run Coverage Part 1
run: tox -e cov1 || true
run: tox -e cov1
- name: Run Coverage Part 2
run: tox -e cov2
run: tox -e cov2 || true
- name: Publish to coveralls.io
uses: coverallsapp/github-action@v1.1.2
with:
Expand Down
53 changes: 53 additions & 0 deletions .github/workflows/find_test_crumbs.py
@@ -0,0 +1,53 @@
# Copyright 2024 TerraPower, LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

"""This script exists so we can determine if new tests in CI are leaving crumbs."""

import subprocess

# A list of objects we expect during a run, and don't mind (like pycache dirs).
IGNORED_OBJECTS = [
".pytest_cache",
".tox",
"__pycache__",
"armi.egg-info",
"armi/logs/ARMI.armiRun.",
"armi/logs/armiRun.mpi.log",
"armi/tests/tutorials/case-suite/",
"armi/tests/tutorials/logs/",
]


def main():
# use "git clean" to find all non-tracked files
proc = subprocess.Popen(["git", "clean", "-xnd"], stdout=subprocess.PIPE)
lines = proc.communicate()[0].decode("utf-8").split("\n")

# clean up the whitespace
lines = [ln.strip() for ln in lines if len(ln.strip())]

# ignore certain untracked object, like __pycache__ dirs
for ignore in IGNORED_OBJECTS:
lines = [ln for ln in lines if ignore not in ln]

# fail hard if there are still untracked files
if len(lines):
for line in lines:
print(line)

raise ValueError("The workspace is dirty; the tests are leaving crumbs!")


if __name__ == "__main__":
main()
21 changes: 21 additions & 0 deletions .github/workflows/linting.yaml
@@ -0,0 +1,21 @@
name: Linting

on: [push, pull_request]

jobs:
build:

runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v2
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: '3.9'
- name: Update package index
run: sudo apt-get update
- name: Install Tox and any other packages
run: pip install tox
- name: Run Linter
run: tox -e lint
8 changes: 7 additions & 1 deletion .github/workflows/unittests.yaml
@@ -1,6 +1,12 @@
name: ARMI unit tests

on: [push, pull_request]
on:
push:
paths-ignore:
- 'doc/**'
pull_request:
paths-ignore:
- 'doc/**'

jobs:
build:
Expand Down
39 changes: 22 additions & 17 deletions .github/workflows/validatemanifest.py
Expand Up @@ -13,39 +13,44 @@
# limitations under the License.

"""
Validating the MANIFEST.in.
Validating the package-data in the pyproject.toml.
Currently, the only validation we do of the MANIFEST.in file is to make sure
that we are trying to include files that don't exist.
Validate that we aren't trying to include files that don't exist.
"""

from glob import glob
import os

import toml

# CONSTANTS
INCLUDE_STR = "include "
MANIFEST_PATH = "MANIFEST.in"
ARMI_DIR = "armi/"
PRPROJECT = "pyproject.toml"


def main():
# loop through each line in the manifest file and find all the file paths
errors = []
lines = open(MANIFEST_PATH, "r", encoding="utf-8")
for i, line in enumerate(lines):
# if this is anything but an include line, move on
if not line.startswith(INCLUDE_STR):
continue
# parse the data files out of the pyproject.toml
txt = open(PRPROJECT, "r").read()
data = toml.loads(txt)
fileChunks = data["tool"]["setuptools"]["package-data"]["armi"]

# loop through each line in the package-data and find all the file paths
errors = []
for i, line in enumerate(fileChunks):
# make sure the file exists
path = line.strip()[len(INCLUDE_STR) :]
if not os.path.exists(path):
errors.append((i, path))
path = ARMI_DIR + line.strip()
if "*" in path:
paths = [f for f in glob(path) if len(f) > 3]
if not len(paths):
errors.append((i, path))
else:
if not os.path.exists(path):
errors.append((i, path))

# If there were any missing files, raise an Error.
if errors:
for (i, line) in errors:
print("Nonexistant file on line {}: {}".format(i, line))
raise ValueError("MANIFEST file is incorrect: includes non-existant files.")
raise ValueError("Package-data file is incorrect: includes non-existant files.")


if __name__ == "__main__":
Expand Down
10 changes: 9 additions & 1 deletion .github/workflows/wintests.yaml
@@ -1,6 +1,12 @@
name: ARMI Windows tests

on: [push, pull_request]
on:
push:
paths-ignore:
- 'doc/**'
pull_request:
paths-ignore:
- 'doc/**'

jobs:
build:
Expand All @@ -19,3 +25,5 @@ jobs:
run: python -m pip install tox tox-gh-actions
- name: Run Tox
run: tox -e test
- name: Find Test Crumbs
run: python .github/workflows/find_test_crumbs.py
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -52,6 +52,7 @@ pytestdebug.log
dump-temp-*
dump-tests*
.vim-bookmarks
armi-venv/*
venv*/
.mypy_cache/
**/__pycache__
Expand Down
70 changes: 0 additions & 70 deletions MANIFEST.in

This file was deleted.

13 changes: 5 additions & 8 deletions README.rst
Expand Up @@ -72,22 +72,21 @@ dependencies could conflict with your system dependencies.

$ git clone https://github.com/terrapower/armi
$ cd armi
$ pip3 install -r requirements.txt
$ python3 setup.py install
$ pip install -e .
$ armi

The easiest way to run the tests is to install `tox <https://tox.readthedocs.io/en/latest/>`_
and then run::

$ pip3 install -r requirements-testing.txt
$ pip install -e .[test]
$ tox -- -n 6

This runs the unit tests in parallel on 6 processes. Omit the ``-n 6`` argument
to run on a single process.

The tests can also be run directly, using ``pytest``::

$ pip3 install -r requirements-testing.txt
$ pip install -e .[test]
$ pytest -n 4 armi

From here, we recommend going through a few of our `gallery examples
Expand Down Expand Up @@ -313,7 +312,6 @@ see if their idea has wings, and if it does, they can then find a way to bring
it to engineering and commercial reality.



History of ARMI
---------------
ARMI was originally created by TerraPower, LLC near Seattle WA starting in 2009. Its
Expand Down Expand Up @@ -397,7 +395,6 @@ Most of our code is in the ``camelCase`` style, which is not the normal style fo
Python. This started in 2009 and we have stuck with the convention.



License
-------
TerraPower and ARMI are registered trademarks of TerraPower, LLC.
Expand All @@ -408,7 +405,7 @@ The ARMI system is licensed as follows:

.. code-block:: none
Copyright 2009-2023 TerraPower, LLC
Copyright 2009-2024 TerraPower, LLC
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
Expand All @@ -422,7 +419,7 @@ The ARMI system is licensed as follows:
See the License for the specific language governing permissions and
limitations under the License.
Be careful when including any dependency in ARMI (say in a requirements.txt file) not
Be careful when including any dependency in ARMI (say in the ``pyproject.toml`` file) not
to include anything with a license that superceeds our Apache license. For instance,
any third-party Python library included in ARMI with a GPL license will make the whole
project fall under the GPL license. But a lot of potential users of ARMI will want to
Expand Down

0 comments on commit 0c995d0

Please sign in to comment.