quantumion / PyVCAM

Python3.X wrapper for Photometrics and QImaging PVCAM based cameras
MIT License
2 stars 0 forks source link

Missing argument when used in DAX simulation #15

Open collineps opened 1 year ago

collineps commented 1 year ago

When using this package in a DAX.sim simulation of an experiment, an error is thrown for a missing argument:

ERROR<9>:dax.sim.ddb:Controller "pyvcam" is missing the "--bind {bind}" argument
Traceback (most recent call last):
  File "/nix/store/y9g5wx06a7fna918k76ya6rmz4zzlwkm-python3-3.9.13-env/lib/python3.9/site-packages/dax/sim/ddb.py", line 198, in enable_dax_sim
    _mutate_ddb_entry(k, v, config=config_data, used_ports=used_ports)
  File "/nix/store/y9g5wx06a7fna918k76ya6rmz4zzlwkm-python3-3.9.13-env/lib/python3.9/site-packages/dax/sim/ddb.py", line 252, in _mutate_ddb_entry
    _mutate_controller(key, value, config=config, used_ports=used_ports)
  File "/nix/store/y9g5wx06a7fna918k76ya6rmz4zzlwkm-python3-3.9.13-env/lib/python3.9/site-packages/dax/sim/ddb.py", line 343, in _mutate_controller
    raise ValueError(f'Controller "{key}" is missing the "--bind {{bind}}" argument')
ValueError: Controller "pyvcam" is missing the "--bind {bind}" argument
Traceback (most recent call last):
  File "/nix/store/51pf67ils7wcn8hkb8ayb385gnizznvm-python3.9-artiq-7.8160.81dbbd0/bin/.artiq_run-wrapped", line 9, in <module>
    sys.exit(main())
  File "/nix/store/y9g5wx06a7fna918k76ya6rmz4zzlwkm-python3-3.9.13-env/lib/python3.9/site-packages/artiq/frontend/artiq_run.py", line 224, in main
    return run(with_file=True)
  File "/nix/store/y9g5wx06a7fna918k76ya6rmz4zzlwkm-python3-3.9.13-env/lib/python3.9/site-packages/artiq/frontend/artiq_run.py", line 194, in run
    device_mgr = DeviceManager(DeviceDB(args.device_db),
  File "/nix/store/y9g5wx06a7fna918k76ya6rmz4zzlwkm-python3-3.9.13-env/lib/python3.9/site-packages/artiq/master/databases.py", line 22, in __init__
    self.data = Notifier(device_db_from_file(self.backing_file))
  File "/nix/store/y9g5wx06a7fna918k76ya6rmz4zzlwkm-python3-3.9.13-env/lib/python3.9/site-packages/artiq/master/databases.py", line 11, in device_db_from_file
    mod = file_import(filename)
  File "/nix/store/y9g5wx06a7fna918k76ya6rmz4zzlwkm-python3-3.9.13-env/lib/python3.9/site-packages/artiq/tools.py", line 87, in file_import
    spec.loader.exec_module(module)
  File "<frozen importlib._bootstrap_external>", line 850, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/home/cepstein/Projects/QuantumIon-ARTIQ-System/devices/device_db_waterloo2.py", line 1060, in <module>
    enable_dax_sim(device_db)
  File "/nix/store/y9g5wx06a7fna918k76ya6rmz4zzlwkm-python3-3.9.13-env/lib/python3.9/site-packages/dax/sim/ddb.py", line 198, in enable_dax_sim
    _mutate_ddb_entry(k, v, config=config_data, used_ports=used_ports)
  File "/nix/store/y9g5wx06a7fna918k76ya6rmz4zzlwkm-python3-3.9.13-env/lib/python3.9/site-packages/dax/sim/ddb.py", line 252, in _mutate_ddb_entry
    _mutate_controller(key, value, config=config, used_ports=used_ports)
  File "/nix/store/y9g5wx06a7fna918k76ya6rmz4zzlwkm-python3-3.9.13-env/lib/python3.9/site-packages/dax/sim/ddb.py", line 343, in _mutate_controller
    raise ValueError(f'Controller "{key}" is missing the "--bind {{bind}}" argument')
ValueError: Controller "pyvcam" is missing the "--bind {bind}" argument

Implement the bind argument so the device can be used in simulation.

collineps commented 1 year ago

The bind argument does exist:

$ python -m pyvcam -h
usage: __main__.py [-h] [--bind BIND] [--no-localhost-bind] [-p PORT] [-v]
                   [-q]

PyVCAM controller. Use this controller to drive the Teledyne PrimeBSI camera.
See documentation at https://github.com/Photometrics/PyVCAM

options:
  -h, --help            show this help message and exit

network server:
  --bind BIND           additional hostname or IP address to bind to; use '*'
                        to bind to all interfaces (default: [])
  --no-localhost-bind   do not implicitly also bind to localhost addresses
  -p PORT, --port PORT  TCP port to listen on (default: 3249)

verbosity:
  -v, --verbose         increase logging level
  -q, --quiet           decrease logging level

May need to raise this issue with the DAX team to learn more.