Skip to content

Commit

Permalink
rebrand custom phases as ROIs
Browse files Browse the repository at this point in the history
  • Loading branch information
halworsen committed Mar 2, 2024
1 parent fbaf9b4 commit 4aece22
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 13 deletions.
4 changes: 2 additions & 2 deletions fflogsapi/data/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
FFLogsReportComboRanking, FFLogsReportRanking, FFLogsReportTag,
FFLogsZoneEncounterRanking, FFLogsZoneRanking, FFMap,)

from .phases import PhaseType, PhaseInformation, OmegaPhaseData, AlexanderPhaseData, ALL_PHASE_DATA
from .rois import PhaseType, PhaseInformation, OmegaPhaseData, AlexanderPhaseData, ALL_PHASE_DATA

__all__ = [
# dataclasses.py
Expand Down Expand Up @@ -40,7 +40,7 @@
'FFLogsPartition',
'FFLogsPhase',

# .phases
# .rois
'PhaseType',
'PhaseInformation',
'OmegaPhaseData',
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
2 changes: 1 addition & 1 deletion fflogsapi/reports/fight.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ def duration(self) -> float:
return self.end_time() - self.start_time()

@fetch_data('encounterID')
def phases(self) -> Optional[list['PhaseInformation']]:
def phase_rois(self) -> Optional[list['PhaseInformation']]:
'''
WARNING: VERY SLOW!
Expand Down
20 changes: 10 additions & 10 deletions tests/reports/test_phases.py → tests/reports/test_rois.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
from ..config import CACHE_EXPIRY, CLIENT_ID, CLIENT_SECRET


class FightTest(unittest.TestCase):
class ROITest(unittest.TestCase):
'''
Test cases for fight phases.
Test cases for the ROI toolkit
This test case makes assumptions on the availability of specific reports.
If the tests break, it may be because visibility settings
Expand Down Expand Up @@ -53,7 +53,7 @@ def test_top(self) -> None:

# Test kill
top_fight = top_report.fight(self.TOP_REPORT[1])
phases = top_fight.phases()
phases = top_fight.phase_rois()
# 6 phases and 7 intermissions in total
self.assertEqual(len(phases), OmegaPhaseData.total_phases())
self.assertEqual(phases[0].start, top_fight.start_time())
Expand All @@ -65,7 +65,7 @@ def test_top(self) -> None:

# Test wipe on P4 (somewhere in the middle)
top_fight = top_report.fight(self.TOP_REPORT[2])
phases = top_fight.phases()
phases = top_fight.phase_rois()
self.assertEqual(len(phases), 6)
self.assertEqual(phases[0].start, top_fight.start_time())
self.assertEqual(phases[-1].end, top_fight.end_time())
Expand All @@ -85,7 +85,7 @@ def test_top(self) -> None:

# Test a phase 1 wipe
top_fight = top_report.fight(self.TOP_REPORT[3])
phases = top_fight.phases()
phases = top_fight.phase_rois()
self.assertEqual(len(phases), 1)
self.assertEqual(phases[0].start, top_fight.start_time())
self.assertEqual(phases[-1].end, top_fight.end_time())
Expand All @@ -95,7 +95,7 @@ def test_top(self) -> None:

# Test a phase 6 wipe
top_fight = top_report.fight(self.TOP_REPORT[4])
phases = top_fight.phases()
phases = top_fight.phase_rois()
self.assertEqual(len(phases), OmegaPhaseData.total_phases())
self.assertEqual(phases[0].start, top_fight.start_time())
self.assertEqual(phases[-1].end, top_fight.end_time())
Expand Down Expand Up @@ -125,7 +125,7 @@ def test_tea(self) -> None:

# Test kill
tea_fight = tea_report.fight(self.TEA_REPORT[1])
phases = tea_fight.phases()
phases = tea_fight.phase_rois()
self.assertEqual(len(phases), AlexanderPhaseData.total_phases())
self.assertEqual(phases[0].start, tea_fight.start_time())
self.assertEqual(
Expand All @@ -139,7 +139,7 @@ def test_tea(self) -> None:

# Test wipe on temporal stasis
tea_fight = tea_report.fight(self.TEA_REPORT[2])
phases = tea_fight.phases()
phases = tea_fight.phase_rois()
self.assertEqual(len(phases), 4)
self.assertEqual(phases[0].start, tea_fight.start_time())
self.assertEqual(phases[-1].end, tea_fight.end_time())
Expand All @@ -157,7 +157,7 @@ def test_tea(self) -> None:

# Test a phase 1 wipe
tea_fight = tea_report.fight(self.TEA_REPORT[3])
phases = tea_fight.phases()
phases = tea_fight.phase_rois()
self.assertEqual(len(phases), 1)
self.assertEqual(phases[0].start, tea_fight.start_time())
self.assertEqual(
Expand All @@ -170,7 +170,7 @@ def test_tea(self) -> None:

# Test a phase 4 wipe just before fate alpha
tea_fight = tea_report.fight(self.TEA_REPORT[4])
phases = tea_fight.phases()
phases = tea_fight.phase_rois()
self.assertEqual(len(phases), 9)
self.assertEqual(phases[0].start, tea_fight.start_time())
self.assertEqual(
Expand Down

0 comments on commit 4aece22

Please sign in to comment.