Conversation
|
Hi Teresia, There's some conflict between pytango and tango-pyaml sometimes. Try to do your test in a pip environment where you only have tango-pyaml. Tango-pyaml module is required for tests and it install a dummy control system that emulates TANGO in a simple way. So, you do not need to have an actual control system to run unit tests. |
|
But this example isn't a unit test? It's just a script in the |
|
Yes, it should work then. But you might need to install the dummy-cs package from tests/ folder to emulate tango. I think it is only installed during the pytest runs. |
|
Okay, but then I think the example is clearly showing the problem with how the configuration layer is implemented at the moment. There shouldn't be any need to emulate the control system if you just want to create the configuration by creating objects of the config classes yourself instead of reading them in from a yaml file. For me that's part of the point of having config classes. If they can't be used like that they just double the number of classes to maintain without adding much benefit. |
|
Okay. I thought the purpose of the example was to show that what I want to be able to do can already be done with the current implementation. |
|
Maybe I wasn't clear. Your error stems from the fact that currently, we need a control system initialisation step when loading the configuration. If you want to initialise only the simulator part, I think that, currently, it is not possible. The dummy-cs control system is meant to be used for unit tests and CI/CD, which is very useful. The alternative to test CS-part is to use some kind of digital twin for a specific lattice. I think this is less practical. If you want to test things locally, without any kind of digital twin, this is also possible if you install a dummy-cs control system. One or two weeks ago, I also modified the README.md of pyaml to reflect this. Otherwise, pyAML tries to reach tango-host, which does not exist on your local computer. The mentioned issues will be addressed, but we only have part-time people working on the project and only very few. So, the issues cannot be resolved instantly. This is why I always encourage people to contribute and to participate in discussions -- to identify issues and resources to solve them. |
|
I understood. My point was that |
|
For me your patch is ok: To use without control system: |
I have added the root path to the
esrf_tune_example_no_yaml.pyexample since without it the csv files aren't found when running the example.However, the example still doesn't work. I get the following error which I guess is because the devices try to connect to TANGO devices that don't exist.