qiskit-metal icon indicating copy to clipboard operation
qiskit-metal copied to clipboard

Prevent users from using renderers that are incompatible with their OS

Open marcolincs opened this issue 4 years ago • 0 comments

Information

  • Operating system: MAC

What is the current behavior?

Can import and use libraries and commands associated to Windows-only renderers. Implementation of the renderer may use libraries that are windows-only, thus causing ModuleImportErrors design = designs.DesignPlanar() appears to import the renderers already, thus causing said errors.

What is the expected behavior?

Renderers that are written in and for Windows (or other OSs) should only be available/reachable for those OSes they are compatible with.

Suggested solutions

use the following where most appropriate:

from platform import system if system() is 'Windows':

Currently I have moved the import pythoncom into the individual methods that need it, but that should not be the case because some of those methods are time-critical.

Even better: keeping as much of those renderers out of memory as possible would be ideal. For example, why to allow users to run fourq_hfss = design.renderers.hfss if they are not on Windows machines?

marcolincs avatar Feb 02 '21 16:02 marcolincs