Skip to content

Commit

Permalink
updating test cases for new formatted inputs
Browse files Browse the repository at this point in the history
  • Loading branch information
raaguln committed Mar 13, 2024
1 parent 4d0c9f0 commit 85176ca
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 7 deletions.
3 changes: 1 addition & 2 deletions thronetalk-game-of-thrones-summarizer/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,7 @@ def remove_zeros(lst):
int(season_to),
int(to_ep_no)
)
line_chart = vg.sentiment_analysis_visualization(characters)
print(characters)
line_chart = vg.sentiment_analysis_visualization(characters)
chart = alt.Chart(line_chart).transform_fold(
characters, as_=["character name", "value"]
).mark_line(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ class TestVisualizationGenerator(unittest.TestCase):
# side_effect=mock_functions.mocked_read_csv_ouput_dialogues)
def test_smoke_test(self):
'''Smoke test for VisualizationGenerator'''
top_3_characters = ["eddard 'ned' stark", "catelyn stark", "robert baratheon"]
top_3_characters = ["eddard ned stark", "catelyn stark", "robert baratheon"]
v_g = VisualizationGenerator(1,1,1,3)
v_g.multi_word_cloud(top_3_characters)
v_g.sentiment_analysis_visualization(top_3_characters)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,6 @@ def pre_process_data_for_character_per_episode(self, character: str) -> list[str
data = self.data
char_episode_wise_arr = []
character_mask = data[data['Character'].str.upper() == character.upper()]
print(self.season_from,self.episode_from,self.season_to,self.episode_to)
for i in range(self.season_from, self.season_to + 1):
season_mask_df = character_mask[character_mask['Season'] == "season-0" + str(i)]
if self.season_from == self.season_to:
Expand Down Expand Up @@ -265,10 +264,7 @@ def sentiment_analysis_visualization(self, char_arr: list[str]) -> pd.DataFrame:
elif self.season_from < i < self.season_to:
episode_wise_desc.append("S"+str(i)+":E"+str(j))
sentiment_arr.append(episode_wise_desc)
print(sentiment_arr)
sentiment_arr = sentiment_arr + self.get_sentiment(char_arr)
print(sentiment_arr)

chart_data = pd.DataFrame(np.asarray(sentiment_arr).transpose(),
columns=['season-episode']+char_arr)
return chart_data
Expand Down

0 comments on commit 85176ca

Please sign in to comment.