DiamondLightSource / tickit

Event-based hardware simulation framework
Apache License 2.0
7 stars 0 forks source link

Examples in User Guide out of date #131

Closed tpoliaw closed 1 year ago

tpoliaw commented 1 year ago

The example configuration here suggests

- examples.devices.trampoline.RandomTrampoline:
    name: rand_tramp
    inputs: {}
- tickit.devices.sink.Sink:
    name: tramp_sink
    inputs:
      input:
      - rand_tramp:output

should work. Running this gives

Traceback (most recent call last):
  File "/home/qan22331/.pyenv/versions/3.10.12/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/home/qan22331/.pyenv/versions/3.10.12/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/dls/athena/tickit/src/tickit/__main__.py", line 5, in <module>
    main()
  File "/dls/athena/tickit/env/lib/python3.10/site-packages/click/core.py", line 1130, in __call__
    return self.main(*args, **kwargs)
  File "/dls/athena/tickit/env/lib/python3.10/site-packages/click/core.py", line 1055, in main
    rv = self.invoke(ctx)
  File "/dls/athena/tickit/env/lib/python3.10/site-packages/click/core.py", line 1657, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/dls/athena/tickit/env/lib/python3.10/site-packages/click/core.py", line 1404, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/dls/athena/tickit/env/lib/python3.10/site-packages/click/core.py", line 760, in invoke
    return __callback(*args, **kwargs)
  File "/dls/athena/tickit/src/tickit/cli.py", line 82, in all
    configs = read_configs(config_path)
  File "/dls/athena/tickit/src/tickit/utils/configuration/loading.py", line 52, in read_configs
    configs = deserialize(
  File "/dls/athena/tickit/env/lib/python3.10/site-packages/apischema/utils.py", line 424, in wrapper
    return wrapped(*args, **kwargs)
  File "/dls/athena/tickit/env/lib/python3.10/site-packages/apischema/deserialization/__init__.py", line 912, in deserialize
    return deserialization_method(
  File "/dls/athena/tickit/env/lib/python3.10/site-packages/apischema/deserialization/__init__.py", line 252, in method
    raise ValidationError([], elt_errors)
apischema.validation.errors.ValidationError: ValidationError(messages=[], children={1: ValidationError(messages=[], children={'inputs': ValidationError(messages=[], children={'input': ValidationError(messages=['expected type string, found array'], children={})})})})

Changing the config to

- examples.devices.trampoline.RandomTrampoline:
    name: rand_tramp
    inputs: {}
- tickit.devices.sink.Sink:
    name: tramp_sink
    inputs:
      input: rand_tramp:output

makes it run successfully but I'm not sure if it's still doing the same thing.

abbiemery commented 1 year ago

The config in the docs was just wrong, the change you made is to the correct format.