Skip to content

Commit

Permalink
style adjusted
Browse files Browse the repository at this point in the history
  • Loading branch information
AntonioVitoMastromarino committed Feb 27, 2024
1 parent 9f208d0 commit 7271712
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
4 changes: 2 additions & 2 deletions epios/sampling_maker.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ def __init__(self, non_resp_rate=0, keep_track=False, data=None,
self.keep_track = keep_track
self.data = data

def __call__(self, sampling_times, people, post_proc = False):
def __call__(self, sampling_times, people, post_proc=False):

'''
Method to return the results for all the planned tests
Expand Down Expand Up @@ -85,7 +85,7 @@ def __call__(self, sampling_times, people, post_proc = False):
temp = []
for x in res:
for n, y in enumerate(temp):
temp[n] = y.drop(columns = x.columns, errors = 'ignore')
temp[n] = y.drop(columns=x.columns, errors='ignore')
temp.append(x)
result.append(temp.copy())
observ.append(list(map(lambda x: (x == 'Positive').mean().mean(), temp)))
Expand Down
9 changes: 5 additions & 4 deletions epios/tests/test_re_scaler.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@ def test_call(self):
def test_smooth(self):
x = [[1.0], [1.0, 2.0], [1.0, 2.0, 3.0]]
with self.assertRaises(Exception):
ReScaler(smoothing=lambda x: 1)(x, tested=[[1],[1,1],[1,1,1]])
ReScaler(smoothing=lambda x: 1)(x, tested=[[1], [1, 1], [1, 1, 1]])
with self.assertRaises(Exception):
ReScaler(smoothing=lambda x: 1)(x, times=array([0.0, 1.0, 2.0]))
self.assertEqual(ReScaler(smoothing=lambda x: 1)(x, times=array([0.0, 1.0, 2.0]), tested=[[1],[1,1],[1,1,1]])[0], 1.0)
self.assertEqual(ReScaler(smoothing=lambda x: 1)(x, times=array([0.0, 1.0, 2.0]), tested=[[1],[1,1],[1,1,1]])[1], 2.0)
self.assertEqual(ReScaler(smoothing=lambda x: 1)(x, times=array([0.0, 1.0, 2.0]), tested=[[1],[1,1],[1,1,1]])[2], 3.0)
result = ReScaler(smoothing=lambda x: 1)(x, times=array([0.0, 1.0, 2.0]), tested=[[1], [1, 1],[1, 1, 1]])
self.assertEqual(result[0], 1.0)
self.assertEqual(result[1], 2.0)
self.assertEqual(result[2], 3.0)
2 changes: 1 addition & 1 deletion epios/tests/test_sampling_maker.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import pandas as pd
from unittest import TestCase
from sampling_maker import SamplingMaker
from numpy import array

class TestSM(TestCase):


def test_positive(self):
self.assertEqual(SamplingMaker(threshold=1)._testresult(1.1), 'Positive')
for a in [3, 4, 5, 6, 7, 8]:
Expand Down

0 comments on commit 7271712

Please sign in to comment.