terrapower / armi

An open-source nuclear reactor analysis automation framework that helps design teams increase efficiency and quality
https://terrapower.github.io/armi/
Apache License 2.0
214 stars 82 forks source link

Perform OS check at `import armi` time #1694

Closed opotowsky closed 2 months ago

opotowsky commented 2 months ago

Because we are trying to get internal ARMI applications working on a Linux system, we are beginning to add a lot of OS checks throughout ARMI.

We don't want to add this all over the place:

if windows:
    this
elif linux:
    that
else:
    OS fail

Instead, the proposal is to perform this check at import time.

if windows:
    armi.OS = windows
elif linux:
    armi.OS = linux
else:
    OS fail

Then everywhere that has OS-dependence in the code base can handle things a little more simply:

if windows:
    this
else:
    that
john-science commented 2 months ago

I am going to close this, as it is a duplicate of another ticket: https://github.com/terrapower/armi/issues/1693