Skip to content

Fix three import errors that break modules on a fresh checkout - #6

Open
egeboy35 wants to merge 1 commit into
lkk688:mainfrom
egeboy35:fix/imports-safe
Open

Fix three import errors that break modules on a fresh checkout#6
egeboy35 wants to merge 1 commit into
lkk688:mainfrom
egeboy35:fix/imports-safe

Conversation

@egeboy35

Copy link
Copy Markdown

Three modules currently fail to import on a fresh checkout. Each fix is small and verifiable without SDR hardware.

Problem and fix

  • sdradi/myofdm.py imports tfmodules at module level. That file lives in sdradi/pluto_test/ and requires TensorFlow, so import myofdm fails from sdradi/ even though only MyDemapper uses those names. → The import is now optional; MyDemapper raises an ImportError explaining how to enable it.
  • WebApp/FastAPIbackend/radar/waveform.py runs pip install plotly as a side effect of a failed import. → It now raises a clear ImportError with the install command instead. It also adds a __file__-based sys.path entry so its AIRadar.AIRadarLib imports resolve when the backend is run from WebApp/FastAPIbackend/ as the README describes.
  • AIRadar/AIradar_model_comparison.py imports RadarTransformerNet from AIradar_transformer, which is not in the repository. → It now imports from AIRadarLib.modeling_transformer, matching the sibling script AIradar_transformer_train.py; the constructor arguments already line up.

Verification

In a clean venv without TensorFlow:

cd sdradi && python -c "import myofdm"                          # succeeds
cd WebApp/FastAPIbackend && python -c "import radar.waveform"    # succeeds

MyDemapper now raises the new explanatory error when tfmodules is unavailable, and RadarTransformerNet resolves from AIRadarLib.

Not included

While tracing these I noticed a few more import problems I did not want to guess at: PacketFramer is imported from sdr_video_comm by four scripts but does not appear to be defined anywhere in the repository, AIradar_fmcw_dataset is missing, and AIradar_model_comparison.py also imports RadarNet / RadarTimeToFreqNet from AImodels_joint, where those names are not defined. I left all of those alone — happy to follow up if you can point me at the intended sources. The WebApp/FastAPIbackend/main.py startup path also needs work, but part of it only runs with an SDR attached, so I have left it for when it can actually be exercised.

🤖 Generated with Claude Code

- sdradi/myofdm.py imported tfmodules at module level. That module lives in
  sdradi/pluto_test/ and requires TensorFlow, so "import myofdm" failed from
  sdradi/ even though only MyDemapper uses those names. The import is now
  optional, and MyDemapper raises an ImportError explaining how to enable it.
- WebApp/FastAPIbackend/radar/waveform.py ran "pip install plotly" as a side
  effect of a failed import; it now raises a clear ImportError instead. It
  also adds a __file__-based sys.path entry so its AIRadar.AIRadarLib imports
  resolve when the backend is run from WebApp/FastAPIbackend/ as documented.
- AIRadar/AIradar_model_comparison.py imported RadarTransformerNet from
  AIradar_transformer, which is not in the repository. It now imports from
  AIRadarLib.modeling_transformer, matching the sibling script
  AIradar_transformer_train.py; the constructor arguments already line up.

Verified in a clean venv without TensorFlow: "import myofdm" from sdradi/
succeeds and MyDemapper raises the new message; "import radar.waveform" from
WebApp/FastAPIbackend/ succeeds and resolves the AIRadar imports.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant