Skip to content

Commit

Permalink
v0.2.21
Browse files Browse the repository at this point in the history
  • Loading branch information
yh202109 committed Jul 29, 2024
1 parent d3143d2 commit 3c1db05
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 25 deletions.
4 changes: 2 additions & 2 deletions mtbp3/stdiso/pdfsummary.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from pypdf import PdfReader
import os
import pandas as pd
from mtbp3 import cdt, util
from mtbp3 import util

class pdfSummary:
"""
Expand Down Expand Up @@ -186,7 +186,7 @@ def show_outline_tree(self, max_itr=5, to_right=False):
if len(self.outline_list) != 2:
raise ValueError("self.outline_list should be a length 2 list")

tree = cdt.ListTree(lst=self.outline_list[0], infmt='dotspace')
tree = util.cdt.ListTree(lst=self.outline_list[0], infmt='dotspace')
return '\n'.join(tree.list_tree(to_right=to_right))

if __name__ == "__main__":
Expand Down
23 changes: 0 additions & 23 deletions mtbp3/util/util.py

This file was deleted.

File renamed without changes.
33 changes: 33 additions & 0 deletions tests/test_util_cdtg.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import unittest
import warnings
from mtbp3.util.cdtg import catPlotter
import pandas as pd

class TestCatPlotter(unittest.TestCase):

def setUp(self):
self.df = pd.DataFrame({
'Group': ['A', 'A', 'B', 'B', 'C', 'C'],
'Value': [1, 2, 3, 4, 5, 6],
'Grid': ['G1', 'G1', 'G2', 'G2', 'G1', 'G1'],
'CValue': ['C1', 'C2', 'C1', 'C2', 'C1', 'C2'],
'CValueGroup': [1, 1, 2, 2, 1, 1]
})

def test_boxplot(self):
warnings.filterwarnings("ignore")
plotter = catPlotter(self.df, y_col='Value', group_col='Group', x_col='CValue', grid_col='Grid')
plotter.boxplot()

def test_lineplot(self):
plotter = catPlotter(self.df, y_col='Value', group_col='Group', x_col='CValue', grid_col='Grid')
plotter.lineplot()

def test_update_parameters(self):
plotter = catPlotter(self.df, y_col='Value', group_col='Group', x_col='CValue', grid_col='Grid')
plotter.update_parameters(y_col='NewValue', fig_size_0=10)
self.assertEqual(plotter.y_col, 'NewValue')
self.assertEqual(plotter.fig_size_0, 10)

if __name__ == "__main__":
unittest.main()
File renamed without changes.

0 comments on commit 3c1db05

Please sign in to comment.