pasqal-io / Pulser

Library for pulse-level/analog control of neutral atom devices. Emulator with QuTiP.
Apache License 2.0
159 stars 57 forks source link

Cannot import Device or BaseDevice #699

Closed Yoric closed 4 days ago

Yoric commented 4 days ago

I'd like to write some code that takes as argument a device. Currently, both Device and BaseDevice are defined in _device_datacls, which marks them as private. Is there any better way to do this? If not, could either Device or BaseDevice be officially exported somewhere?

HGSilveri commented 4 days ago

Device and VirtualDevice are officially exported under pulser.devices, so you can import them from there. BaseDevice is an ABC and is purposefully not exported, as it is intended to be an internal class only. Why would you like to import it?

Yoric commented 4 days ago

Mmmh... Pyright informs me that:

"Device" is not exported from module "pulser.devices"
  Import from "pulser.devices._device_datacls" instead

Looking at the code, it seems that Pyright is wrong? Investigating.

Yoric commented 4 days ago

Apologies for the noise. It seems to be a Pyright error.