Browse Source

Merge pull request #9 from ricet8ur/new_todos

Correction of requrements and TODO.
Egor 2 years ago
parent
commit
cd07718db8
4 changed files with 36 additions and 25 deletions
  1. 24 13
      TODO.md
  2. 4 2
      requirements.txt
  3. 6 8
      source/backend/calc.py
  4. 2 2
      source/frontend/front.py

+ 24 - 13
TODO.md

@@ -1,24 +1,35 @@
 # Todos sorted by importance
 
-1. Do we need to calculate systematic errors?
-2. Should we apply corrections for coupling losses?
+1. Add a description for our program.
+    * What does it do?
+    * What is Q circle?
+    * What data formats are supported?
+2. Change startup file to main.py and remove os and sys calls from frontend. Pass calc function to frontend function as an argument.
 3. Add validation of separator + convertor to std backend input
-4. Add impedance data format:
-    * additional field for omega
-    * convertion to reflection coeffitient (how?)
-
+4. Should we apply corrections for coupling losses? - yes, please add this option.
 5. Draw continuous Q circle on a Smith chart using coefficients a[0..2]
 6. Add axes labels to a Smith chart
-7. Pretty-print results and errors (7 digits after dot)
-8. Plot another chart: abs(S11) from f
-9. Make all computations extra precise:
+7. Pretty-print results and errors (7 digits after dot). Try latex output.
+8. Plot second chart: abs(S11) from f
+9. Add impedance data format (only frontend):
+    * additional field for omega
+    * convertion to reflection coeffitient (how?)
+10. Codestyle fix:
+    * Format all code files
+    * Make a good code structure... If you can.
+11. Make all computations extra precise:
     * import sympy.mpmath as mp ..?
     * from sympy.mpmath import *  ..?
-    * mp.dps = ~50
+    * mp.dps = ~50 or something else.
     * make sure that result' ~ result
     * increase mp.dps while 7 digits after dot are not stable
-10. Advanced file loading:
+
+12. Advanced file loading:
     * Show file preview
     * Options to skip first and last lines
-11. Add direct support for output files from different vna models
-12. Make charts more interactive
+13. Advanced output options (only frontend):
+    * Option to choose output values precision
+14. Do we need to calculate systematic errors? - yes, if its not too hard.
+15. Add direct support for output files from different vna models
+16. Make charts more interactive
+17. Make an option to pass the whole program to .html site as a iframe

+ 4 - 2
requirements.txt

@@ -1,3 +1,5 @@
-streamlit==1.5.0
+# click<=8.0.4 for streamlit==1.5.0
+streamlit
 matplotlib
-numpy
+numpy
+# sympy?

+ 6 - 8
source/backend/calc.py

@@ -1,5 +1,4 @@
 from cmath import atan
-from multiprocessing import Queue
 import numpy as np
 
 
@@ -15,12 +14,11 @@ def open_file(path):
             re.append(float(temp[1]))
             im.append(float(temp[2]))
     return freq, re, im
-
-
-def prepare_data(freq, re, im, fl=[]):
+ 
+def prepare_data(freq, re, im, fl=None):
     """the function takes raw data and gives vectors of eq (8)"""
     # finding fl from the point with smallest magnitude if argument not provided
-    if type(fl) is list and len(fl)==0:
+    if fl is None:
         s = abs(np.array(re) + np.array(im)*1j)
         # frequency of loaded resonance
         fl = freq[list(abs(s)).index(min(abs(s)))]
@@ -115,9 +113,9 @@ def fl_fitting(freq, re, im):
 
     # Repeated curve fitting
     # 1.189 of Qfactor Matlab 
-    fl2 = 0
-    g_d=0
-    g_c=0
+    # fl2 = 0
+    # g_d=0
+    # g_c=0
     for x in range(0, 3):
         g_c = (np.conj(a[2])*a[1]-a[0])/(np.conj(a[2])-a[2])
         g_d = a[0]/a[2]

+ 2 - 2
source/frontend/front.py

@@ -3,7 +3,7 @@ import matplotlib.pyplot as plt
 import numpy as np
 import sys
   
-
+### don't do it this way!
 import os
 absolute_path = os.path.abspath(__file__)
 # print("Full path: " + absolute_path)
@@ -61,7 +61,7 @@ def plot_data(r,i, g):
 #         i.append(c)  # Im of something
 #     plot_data(r,i)
 
-
+### move all that into to a function
 data = []
 uploaded_file = st.file_uploader('Upload a csv')
 if uploaded_file is not None: