Skip to content

Commit e96f200

Browse files
committed
Removing unused methods
1 parent 2bb6b10 commit e96f200

File tree

2 files changed

+0
-76
lines changed

2 files changed

+0
-76
lines changed

armi/bookkeeping/historyTracker.py

Lines changed: 0 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -204,13 +204,6 @@ def _writeDetailAssemblyHistories(self):
204204
def _getAssemHistoryFileName(self, assem):
205205
return self._getHistoryFileName(assem.getName(), "a")
206206

207-
def _getBlockHistoryFileName(self, block):
208-
"""Get name for block."""
209-
return self._getHistoryFileName(block.getName() + "{}".format(block.spatialLocator.k), "b")
210-
211-
def _getLocationHistoryFileName(self, location):
212-
return self._getHistoryFileName(str(location) + "{}".format(location.axial), "l")
213-
214207
def _getHistoryFileName(self, label, letter):
215208
return f"{self.cs.caseTitle}-{label}-{letter}Hist.txt"
216209

@@ -253,24 +246,6 @@ def getDetailBlocks(self) -> list["Block"]:
253246
"""Get all blocks in all detail assemblies."""
254247
return [block for a in self.getDetailAssemblies() for block in a]
255248

256-
def filterTimeIndices(self, timeIndices, boc=False, moc=False, eoc=False):
257-
"""Takes a list of time indices and filters them down to boc moc or eoc."""
258-
filtered = []
259-
260-
steps = self.cs["burnSteps"] + 1
261-
262-
for i in timeIndices:
263-
if boc and i % steps == 0:
264-
filtered.append(i)
265-
if moc and i % steps == steps // 2:
266-
filtered.append(i)
267-
if eoc and i % steps == steps - 1:
268-
filtered.append(i)
269-
if not boc and not moc and not eoc:
270-
filtered.append(i)
271-
272-
return filtered
273-
274249
def writeAssemHistory(self, a: "Assembly", fName: str = ""):
275250
"""Write the assembly history report to a text file."""
276251
fName = fName or self._getAssemHistoryFileName(a)

armi/bookkeeping/tests/test_historyTracker.py

Lines changed: 0 additions & 51 deletions
Original file line numberDiff line numberDiff line change
@@ -23,14 +23,11 @@
2323
import os
2424
import pathlib
2525
import shutil
26-
import unittest
2726

2827
from armi import settings, utils
29-
from armi.bookkeeping import historyTracker
3028
from armi.bookkeeping.tests._constants import TUTORIAL_FILES
3129
from armi.cases import case
3230
from armi.context import ROOT
33-
from armi.reactor import blocks, grids
3431
from armi.reactor.flags import Flags
3532
from armi.tests import ArmiTestHelper
3633
from armi.utils.directoryChangers import TemporaryDirectoryChanger
@@ -231,51 +228,3 @@ def test_getBlockInAssembly(self):
231228
with self.assertRaises(RuntimeError):
232229
aShield = self.o.r.core.getFirstAssembly(Flags.SHIELD)
233230
history._getBlockInAssembly(aShield)
234-
235-
236-
class TestHistoryTrackerNoModel(unittest.TestCase):
237-
"""History tracker tests that do not require a Reactor Model."""
238-
239-
def setUp(self):
240-
cs = settings.Settings()
241-
self.history = historyTracker.HistoryTrackerInterface(None, cs=cs)
242-
self._origCaseTitle = self.history.cs.caseTitle # to avoid parallel test interference.
243-
self.history.cs.caseTitle = self._testMethodName + self._origCaseTitle
244-
245-
def tearDown(self):
246-
self.history.cs.caseTitle = self._origCaseTitle
247-
248-
def test_timestepFiltering(self):
249-
times = range(30)
250-
self.history.cs = self.history.cs.modified(newSettings={"burnSteps": 2})
251-
252-
inputs = [
253-
{"boc": True},
254-
{"moc": True},
255-
{"eoc": True},
256-
{"boc": True, "eoc": True},
257-
]
258-
results = [
259-
[0, 3, 6, 9, 12, 15, 18, 21, 24, 27],
260-
[1, 4, 7, 10, 13, 16, 19, 22, 25, 28],
261-
[2, 5, 8, 11, 14, 17, 20, 23, 26, 29],
262-
[0, 2, 3, 5, 6, 8, 9, 11, 12, 14, 15, 17, 18, 20, 21, 23, 24, 26, 27, 29],
263-
]
264-
for i, expectedResults in zip(inputs, results):
265-
runResults = self.history.filterTimeIndices(times, **i)
266-
self.assertEqual(runResults, expectedResults)
267-
268-
def test_timestepFilteringWithGap(self):
269-
times = list(range(10)) + list(range(15, 20))
270-
self.history.cs = self.history.cs.modified(newSettings={"burnSteps": 2})
271-
272-
runResults = self.history.filterTimeIndices(times, boc=True)
273-
self.assertEqual(runResults, [0, 3, 6, 9, 15, 18])
274-
275-
def test_blockName(self):
276-
block = blocks.HexBlock("blockName")
277-
block.spatialLocator = grids.IndexLocation(0, 0, 7, None)
278-
self.assertEqual(
279-
self.history._getBlockHistoryFileName(block),
280-
f"{self.history.cs.caseTitle}-blockName7-bHist.txt",
281-
)

0 commit comments

Comments
 (0)