Skip to content

Fix Python demo

Bram Veenboer requested to merge fix-python-demo into master

The Python demos haven't been updated in a while, causing them to have become incompatible with the Proxies. Moreover, not all of them worked properly with Python 3 and recent versions of dependent Python libraries. This MR resolves that by patching up the most important demo (idg-demo.py) and removing the others.

In this MR, the following changes are made:

  • Fix idg-demo.py: add call to get_final_grid() and transform(), solving an empty image for the Generic Proxy and FFT shift not being applied properly when using the CPU proxy.
  • Replace use_cuda option with mode flag, which accepts 'cpu', 'gpu', and 'hybrid', using the cpu::Optimized, cuda::Generic, and hybrid:GenericOptimized proxy, respectively.
  • Fix Generic::make_plan to get correct output with dataset with many channels.
  • Miscellaneous clean-up of idg-demo.py: it now again processes the data timestep per timestep and displays the result.
  • Remove defunct idg-demo2.py. It was deemed too much work to update this Python 2 (!!) code with TKinter issues, when no one seems to need this code anyway, so it is removed.
  • Remove defunct idg-demo-hdf5.py. When needed, it can easily be reconstructed from idg-demo.py, preferably within the same script to avoid duplicated code.

Merge request reports

Loading