Thursday, March 4, 2021

Parameter calculated from a variable breaks python code generation

Hi

I'm facing a strange an erratic issue in the attached flowgraph used in GR 3.8.2. This flowgraph is only used to demonstrate the issue, it doesn't do anything!

The issue appears when I'm defining a fractional bandwith (fbw) as "1/sps" instead of a float value.

  • Sometime the corresponding value is not shown on the flowgraph, which shows "1/sps" in red
  • Sometime the results 0.0333 is computed but then executing the flowgraph fail with error:

Generating: '/home/seguinot/desktop/test_grc/test_fbw.py'
Generate Error: (ValueError("could not convert string to float: '0.4/sps'"), 'filter.rational_resampler_${type}(\n        interpolation=${interp},\n        decimation=${decim},\n% if taps:\n        taps=${taps},\n% else:\n        taps=None,\n% endif\n% if float(fbw) != 0:\n        fractional_bw=${fbw})\n% else:\n        fractional_bw=None)\n% endif')
>>> Failure

  • I isolated this issue in the present flowgraph one week ago, but it suddenly disapeared so that I though I made a mistake in writing my variables.
  • Today, opening this flowgraph, my fractionnal bandwith shows red.
  • After several attemp the correct value was displayed
  • But

Am I doing something wrong? 


Regards Christophe

No comments:

Post a Comment