added tests for db an ma tochstone data

pull/140/head
Holger Mueller 2020-01-22 18:18:38 +01:00
rodzic afd366f88d
commit 2e636066fb
3 zmienionych plików z 34 dodań i 0 usunięć

11
test/data/db.s2p 100644
Wyświetl plik

@ -0,0 +1,11 @@
# HZ S DB R 50
1.465003750937734E9 -1.396696934098445E1 3.349568174026075 -2.261174260421613 1.620714227806657E2 -2.255142489055356 1.626927267495817E2 -1.442619251233750E1 4.509019031432469
1.465503875968992E9 -1.369876098541207E1 3.479938266374748 -2.224036324693064 1.631219183133622E2 -2.230062353322664 1.612120965710581E2 -1.353367611139944E1 1.954291818822123
1.466004001000250E9 -1.379085768177502E1 6.788018243134909 -2.234675921557394 1.616283462983217E2 -2.241155297558765 1.629287928899836E2 -1.404466816442995E1 2.475833229081635
1.466504126031508E9 -1.424627608260705E1 4.706658182189423 -2.267732265261066 1.630281926898599E2 -2.279113484903308 1.637911206096939E2 -1.403985522782244E1 6.258852806593705
1.467004251062766E9 -1.388823218559945E1 3.744481757023677 -2.243118570936963 1.619407156405345E2 -2.256689625298824 1.620401320385134E2 -1.437657711076861E1 4.378386297027917
1.467504376094024E9 -1.363131206363558E1 4.481745062167305 -2.234202921073654 1.609017179760186E2 -2.231499875527908 1.621150648113463E2 -1.403567006946793E1 6.008756896907650
1.468004501125281E9 -1.357308913865166E1 6.752417012204787 -2.190762960848804 1.592255394852820E2 -2.213893899730369 1.604919620912775E2 -1.392469613271226E1 5.802146694755130
1.468504626156539E9 -1.328017288789247E1 4.347321859152585 -2.211094613088734 1.590669733070027E2 -2.207418277887152 1.574936196343803E2 -1.424893658605293E1 2.965770345166085
1.469004751187797E9 -1.308760188829710E1 1.035833400693584E1 -2.213146425167909 1.605810413752405E2 -2.241527794979899 1.595688676701842E2 -1.413210094282936E1 7.337633110667883
1.469504876219055E9 -1.441098551455218E1 9.046042843197457 -2.219676590923017 1.602570163112450E2 -2.255210742654332 1.603381378830466E2 -1.369031345080353E1 7.167051366612957

11
test/data/ma.s2p 100644
Wyświetl plik

@ -0,0 +1,11 @@
# MHZ S MA R 50
10.0000 0.915 -63.193 57.033 142.886 0.013 51.862 0.525 -89.730
20.0000 0.830 -99.758 40.867 122.518 0.021 32.533 0.638 -123.891
30.0000 0.787 -121.018 30.176 110.861 0.022 20.814 0.684 -140.388
40.0000 0.765 -134.056 23.331 103.406 0.023 15.181 0.708 -149.561
50.0000 0.757 -141.913 19.148 98.789 0.023 10.360 0.719 -154.726
60.0000 0.752 -147.447 16.060 94.882 0.024 5.949 0.724 -158.168
70.0000 0.751 -151.523 13.785 91.746 0.024 2.789 0.732 -160.919
80.0000 0.750 -154.603 12.098 88.870 0.024 2.787 0.735 -162.634
90.0000 0.751 -156.729 10.716 86.488 0.024 -0.815 0.740 -164.178
100.000 0.750 -158.996 9.593 84.260 0.024 -3.226 0.742 -165.291

Wyświetl plik

@ -73,6 +73,18 @@ class TestTouchstoneTouchstone(unittest.TestCase):
self.assertEqual(len(ts.s22data), 1020)
self.assertIn("! Vector Network Analyzer VNA R2", ts.comments)
ts = Touchstone("./test/data/ma.s2p")
ts.load()
self.assertEqual(str(ts.opts), "# MHZ S MA R 50")
ts = Touchstone("./test/data/db.s2p")
ts.load()
self.assertEqual(str(ts.opts), "# HZ S DB R 50")
# ts = Touchstone("./test/data/nosudhfile")
# self.assertRaises(FileNotFoundError, ts.load)
def test_load_scikit(self):
ts = Touchstone("./test/data/scikit_unordered.s2p")
with self.assertLogs(level=logging.WARNING) as cm: