Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing some miscellaneous TODOs #1392

Merged
merged 9 commits into from
Aug 17, 2023

Conversation

john-science
Copy link
Member

What is the change?

There are several TODOs in the ARMI codebase. I found some that were low-hanging fruit to fix or test/delete if they were defunct.

Why is the change being made?

Our docs say we shouldn't keep TODOs in the codebase. Also, some of these were questions that needed testing, so I just did the testing.

There are more left, but perfect is the enemy of better.


Checklist

  • This PR has only one purpose or idea.
  • Tests have been added/updated to verify that the new/changed code works.
  • The release notes (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.

We don't WANT to change `replaceNoneWithNonsense()` to handle the
logic in `replaceNonsenseWithNone()`. It is fine they are two
different methods. And frankly it would be confusing if one method
did them both.
This exception is never hit in the wild, that I can see.
It IS possible someone could write code to trip this exception though,
so I am raising a custom exception rather than remove the try/except.
@john-science john-science added the cleanup Code/comment cleanup: Low Priority label Aug 17, 2023
Copy link
Member

@albeanth albeanth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just 1 comment on settings not getting moved to physics. There's lots of physics specific settings listed in globalSettings.

armi/settings/fwSettings/globalSettings.py Show resolved Hide resolved
# Non-none entries below the top level fail to coerce to a serializable
# numpy array and would raise an exception when trying to write. TL;DR:
# this is a dead branch until the replaceNonesWithNonsense impl is more
# sophisticated.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess replaceNonesWithNonsense is now sufficiently sophisticated? 🤷‍♂️

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I mean, imagine you need to "replace Nonsense with Nones", WHY would you want to use a function called "replace Nones with Nonsense"?

That would be EXTRA confusing to explain to people.

Also... if that one function did both things I would want to break it up into two smaller functions that only do one thing each.

Copy link
Member

@opotowsky opotowsky left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I stepped through each commit and they all make sense to me.

@john-science john-science merged commit 5403ec2 into terrapower:main Aug 17, 2023
@john-science john-science deleted the fix_todos_20230815 branch August 17, 2023 22:19
drewj-usnctech added a commit to drewj-usnctech/armi that referenced this pull request Aug 24, 2023
…id-refactor-pre-1278

* terrapower/main:
  Move max assembly number out of global scope (terrapower#1383)
  Ensuring we throw an error on bad YAML files (terrapower#1358)
  Removing unused settings (terrapower#1393)
  Fixing some miscellaneous TODOs (terrapower#1392)
  Removing global plugin flags (terrapower#1388)
  Update reactivity coefficient parameters (terrapower#1355)
  Fixing ruff formatting of doc gallery examples (terrapower#1389)
  Fixing broken link (terrapower#1390)
  Removing unreachable code block (terrapower#1391)
  Removing unnecessary f-strings (terrapower#1387)
  Updating documentation dependencies for Python 3.11 (terrapower#1378)
  Adding a little code coverage to the CLIs (terrapower#1371)
  Remove coveragepy-lcov dependency during CI. (terrapower#1382)
  Reconnect logger after disconnecting in test. (terrapower#1381)
  Add Python 3.11 to GH Actions (terrapower#1341)
  Removing global variable from runLog.py (terrapower#1370)
  Moving the First-Time Contributors guide to the docs (terrapower#1368)
drewj-usnctech added a commit to drewj-usnctech/armi that referenced this pull request Sep 6, 2023
…t-mod-empty-validation

* terrapower/main: (23 commits)
  Allowing users to set powerDensity instead of power (terrapower#1395)
  Fix assemNum parameter for uniform mesh reactor. (terrapower#1398)
  Update to black v22.6.0 (terrapower#1396)
  Fixing gallery example for new working Grids (terrapower#1394)
  Refactor armi.reactor.grids to wider submodule; Grids as ABC (terrapower#1373)
  Make SFP a child of reactor. (terrapower#1349)
  Move max assembly number out of global scope (terrapower#1383)
  Ensuring we throw an error on bad YAML files (terrapower#1358)
  Removing unused settings (terrapower#1393)
  Fixing some miscellaneous TODOs (terrapower#1392)
  Removing global plugin flags (terrapower#1388)
  Update reactivity coefficient parameters (terrapower#1355)
  Fixing ruff formatting of doc gallery examples (terrapower#1389)
  Fixing broken link (terrapower#1390)
  Removing unreachable code block (terrapower#1391)
  Removing unnecessary f-strings (terrapower#1387)
  Updating documentation dependencies for Python 3.11 (terrapower#1378)
  Adding a little code coverage to the CLIs (terrapower#1371)
  Remove coveragepy-lcov dependency during CI. (terrapower#1382)
  Reconnect logger after disconnecting in test. (terrapower#1381)
  ...
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cleanup Code/comment cleanup: Low Priority
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants