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

Fix issue where case was mistakenly making absolute paths relative. #914

Merged
merged 2 commits into from
Oct 3, 2022

Conversation

ntouran
Copy link
Member

@ntouran ntouran commented Oct 1, 2022

Description

Closes #913

Though should have a test.


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 bug fixes or new features.
  • The documentation is still up-to-date in the doc folder.
  • The dependencies are still up-to-date in setup.py.

@ntouran ntouran requested a review from opotowsky October 1, 2022 03:54
@john-science john-science requested review from keckler and john-science and removed request for opotowsky October 1, 2022 19:20
@john-science
Copy link
Member

@ntouran Could you add this test to the end of armi/cases/tests/test_cases.py?

    def test_copyInterfaceInputs_absPath(self):
        testSetting = "shuffleLogic"
        cs = settings.Settings(ARMI_RUN_PATH)
        shuffleFile = cs[testSetting]
        absFile = os.path.dirname(os.path.abspath(ARMI_RUN_PATH))
        absFile = str(os.path.join(absFile, os.path.basename(shuffleFile)))
        cs = cs.modified(newSettings={testSetting: absFile})

        with directoryChangers.TemporaryDirectoryChanger() as newDir:
            newSettings = cases.case.copyInterfaceInputs(
                cs, destination=newDir.destination
            )
            self.assertEqual(str(newSettings[testSetting]), absFile)

I'd do it myself, but this branch is in your fork repo.

Thanks!

@john-science john-science merged commit 7be2ad9 into terrapower:main Oct 3, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Absolute file paths being dumped as relative
3 participants