Skip to content

Commit

Permalink
Update warnings and output strings
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Münker <mail@chipmuenk.de>
  • Loading branch information
chipmuenk committed Nov 19, 2023
1 parent ae1b653 commit de75954
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 10 deletions.
6 changes: 2 additions & 4 deletions pyfda/filterbroker.py
Original file line number Diff line number Diff line change
Expand Up @@ -386,9 +386,7 @@ def redo():
# Comparing nested dicts
# https://stackoverflow.com/questions/27265939/comparing-python-dictionaries-and-nested-dictionaries

d1 = {'as': 1, 'a': {'b': {'cs':10, 'qqq': {'qwe':1}}, 'd': {'csd':30}}}
d2 = {'as': 3, 'a': {'b': {'cs':30, 'qqq': 123}, 'd': {'csd':20}},
'newa': {'q': {'cs':50}}}

def sanitize_imported_dict(new_dict: dict, new_dict_name: str) -> str:

def compare_dictionaries(
Expand Down Expand Up @@ -443,7 +441,7 @@ def compare_dictionaries(
[i.replace("Missing in d1:", "\t") for i in err_list if "Missing in d1:" in i])
logger.warning(f"d1: {len(err_missing)}, d2: {len(err_unsupported)}")
if err_missing != "":
err_str = f"The following key(s) have not been found in '{new_dict_name}', "\
err_str = f"The following key(s) have not been found in {new_dict_name},\n\t"\
"they are copied with their values from the reference dict:\n" + err_missing
if err_unsupported != "":
err_str += "\nThe following key(s) are not part of the reference dict "\
Expand Down
2 changes: 1 addition & 1 deletion pyfda/fixpoint_widgets/fir_df/fir_df_pyfixp_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ def process_sig_rx(self, dict_sig=None):
the referenced dicts `fb.fil[0]['fxqc']['QCB']` and `...['QACC']` have already
been updated by the corresponding subwidgets `FX_UI_WQ`
"""
logger.warning("sig_rx:\n{0}".format(pprint_log(dict_sig)))
# logger.warning("sig_rx:\n{0}".format(pprint_log(dict_sig)))
if dict_sig['id'] == id(self):
logger.warning(f'Stopped infinite loop: "{first_item(dict_sig)}"')
return
Expand Down
2 changes: 1 addition & 1 deletion pyfda/fixpoint_widgets/fx_ui_wq.py
Original file line number Diff line number Diff line change
Expand Up @@ -394,7 +394,7 @@ def ui2dict(self) -> None:
self.update_WI_WF()

if self.sender():
logger.error(f"sender = {self.sender().objectName()}")
# logger.error(f"sender = {self.sender().objectName()}")
# if self.sender().objectName() == 'cmbW':
# self.enable_subwidgets() # enable / disable WI and WF subwidgets
dict_sig = {'wdg_name': self.wdg_name,
Expand Down
2 changes: 1 addition & 1 deletion pyfda/fixpoint_widgets/iir_df1/iir_df1_pyfixp_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ def dict2ui(self):
:class:`pyfda.input_widgets.input_fixpoint_specs.Input_Fixpoint_Specs`.
"""
fxq_dict = fb.fil[0]['fxqc']
logger.warning(fxq_dict)
# logger.warning(fxq_dict)
if 'QACC' not in fxq_dict:
fxq_dict.update({'QACC': {}}) # no accumulator settings in dict yet
logger.warning("'QACC' key missing in filter dict")
Expand Down
4 changes: 2 additions & 2 deletions pyfda/input_widgets/input_coeffs.py
Original file line number Diff line number Diff line change
Expand Up @@ -293,8 +293,8 @@ def process_sig_rx(self, dict_sig=None):
"""
Process signals coming from sig_rx
"""
logger.warning("process_sig_rx(): vis={0}\n{1}"\
.format(self.isVisible(), pprint_log(dict_sig)))
# logger.warning("process_sig_rx(): vis={0}\n{1}"\
# .format(self.isVisible(), pprint_log(dict_sig)))

if dict_sig['id'] == id(self):
# logger.warning(f'Stopped infinite loop: "{first_item(dict_sig)}"')
Expand Down
2 changes: 1 addition & 1 deletion pyfda/libs/pyfda_io_lib.py
Original file line number Diff line number Diff line change
Expand Up @@ -1578,7 +1578,7 @@ def load_filter(self) -> int:
logger.error(f'Unknown file type "{file_type}"')
err = True
if not err:
ret = fb.sanitize_imported_dict(fb.fil[0], 'fb.fil[0]')
ret = fb.sanitize_imported_dict(fb.fil[0], 'the loaded dict')
if ret != "":
logger.warning(ret)

Expand Down

0 comments on commit de75954

Please sign in to comment.