diff --git a/.gitignore b/.gitignore index d5e4f15f8c02ac458b0019ffbb99d969fdc719db..7873152158376d664554b88f3bbe656fffb618c3 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,3 @@ -**/__pycache__ \ No newline at end of file +**/__pycache__ +raser.egg-info +dist \ No newline at end of file diff --git a/elec/__init__.py b/elec/__init__.py index 71f35d15742c614f8163c1db78d585f9c43f694d..d739f8f0f1e7023f5f18d988e16eb4003da1ad22 100644 --- a/elec/__init__.py +++ b/elec/__init__.py @@ -9,7 +9,7 @@ def main(kwargs): subprocess.run(['ngspice -b -r t1.raw output/T1_tmp.cir'], shell=True) if label == 'drs4_get_analog': import subprocess - subprocess.run(['ngspice -b -r drs4_analog.raw paras/drs4_analog.cir'], shell=True) + subprocess.run(['ngspice -b -r drs4_analog.raw paras/circuitdrs4_analog.cir'], shell=True) if label == 'drs4_get_fig': from . import drs4_get_fig drs4_get_fig.main() diff --git a/elec/ngspice.py b/elec/ngspice.py index 51b093d0e302aba89683b825b738eef3c9cba511..cf323767f061060bfb2587208d49fc193c46f4bb 100644 --- a/elec/ngspice.py +++ b/elec/ngspice.py @@ -1,5 +1,5 @@ def ngspice(input_c, input_p): - with open('./paras/T1.cir', 'r') as f: + with open('./paras/circuitT1.cir', 'r') as f: lines = f.readlines() lines[113] = 'I1 2 0 PWL('+str(input_c)+') \n' lines[140] = 'tran 0.1p ' + str((input_p[len(input_p) - 2])) + '\n' diff --git a/elec/t1_create.py b/elec/t1_create.py index caddb30ee3fdacca1445d5442da26fe6180a74eb..70df9e24cbd56f7fadb3adaf7d58419232083b9c 100644 --- a/elec/t1_create.py +++ b/elec/t1_create.py @@ -70,7 +70,7 @@ if number>=1: input_c.append(str(0)) input_p=','.join(input_c) - with open('/scratchfs/atlas/xingchenli/raser/paras/T1.cir', 'r') as f: + with open('/scratchfs/atlas/xingchenli/raser/paras/circuitT1.cir', 'r') as f: lines = f.readlines() lines[113] = 'I1 2 0 PWL('+str(input_p)+') \n' lines[140] = 'tran 0.1p ' + str((input_c[len(input_c) - 2])) + '\n' @@ -142,7 +142,7 @@ else: input_c.append(str(0)) input_p=','.join(input_c) - with open('/scratchfs/atlas/xingchenli/raser/paras/T1.cir', 'r') as f: + with open('/scratchfs/atlas/xingchenli/raser/paras/circuitT1.cir', 'r') as f: lines = f.readlines() lines[113] = 'I1 2 0 PWL('+str(input_p)+') \n' lines[140] = 'tran 0.1p ' + str((input_c[len(input_c) - 2])) + '\n' diff --git a/tct/tct_signal.py b/tct/tct_signal.py index c6f9a84c421bb6290515947443874ffd17cce512..e08a73adab33d52250b5edbd202e07435a546739 100644 --- a/tct/tct_signal.py +++ b/tct/tct_signal.py @@ -44,7 +44,7 @@ if "ngspice" in args: my_current.save_current(dset,my_d,my_l,my_f,"fx_rel") input_p=ngsip.set_input(dset,my_current,my_l,my_d,"fx_rel") input_c=','.join(input_p) - with open('paras/T1.cir', 'r') as f: + with open('paras/circuitT1.cir', 'r') as f: lines = f.readlines() lines[113] = 'I1 2 0 PWL('+str(input_c)+') \n' lines[140] = 'tran 0.1p ' + str((input_p[len(input_p) - 2])) + '\n' diff --git a/tct/tct_t1.py b/tct/tct_t1.py index 0d903c837378cc6576a5660fec424940fd906053..5701fd72fdb1311889549c60b6b98b650b062c3c 100644 --- a/tct/tct_t1.py +++ b/tct/tct_t1.py @@ -64,7 +64,7 @@ t_start = t1 t_rise = t2 - t1 t_fall = t3 - t2 -with open('paras/T1.cir', 'r') as f: +with open('paras/circuitT1.cir', 'r') as f: lines = f.readlines() lines[113] = 'I1 2 0 pulse(0 ' + str(c_max) + 'u ' + str(t_start) + 'n ' + str(t_rise) + 'n ' + str(t_fall) + 'n 0.00000001n ' + str((T_ele[len(T_ele) - 1])) + 'n 0)\n' lines[140] = 'tran 0.1p ' + str((T_ele[len(T_ele) - 1])) + 'n\n' diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 0000000000000000000000000000000000000000..e69de29bb2d1d6434b8b29ae775ad8c2e48c5391 diff --git a/tests/test_draw.py b/tests/test_draw.py new file mode 100644 index 0000000000000000000000000000000000000000..553444b67db4d02eb0951da36f9aa0e47b0ac47f --- /dev/null +++ b/tests/test_draw.py @@ -0,0 +1,13 @@ +import unittest + +class TestSum(unittest.TestCase): + def test_draw(self): + """ + Test draw functions + """ + data = [1, 2, 3] + result = sum(data) + self.assertEqual(result, 6) + +if __name__ == '__main__': + unittest.main() diff --git a/tests/test_field.py b/tests/test_field.py new file mode 100644 index 0000000000000000000000000000000000000000..b3ce17650d8b1ca16a652ea7ba0b0f5ab17e338f --- /dev/null +++ b/tests/test_field.py @@ -0,0 +1,13 @@ +import unittest + +class TestSum(unittest.TestCase): + def test_field_cal_gen_devsim_db(self): + """ + Test field cal gen_devsim_db + """ + data = [1, 2, 3] + result = sum(data) + self.assertEqual(result, 6) + +if __name__ == '__main__': + unittest.main()