Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow pyvisa-sim instrs to be loaded from yaml file #4789

Conversation

jenshnielsen
Copy link
Collaborator

@jenshnielsen jenshnielsen commented Nov 4, 2022

This makes it simpler to write examples of station yaml files that makes use of pyvisa-sim instruments

The visalib argument to the driver needs to have the full path to the sim file so it is not practical to put in the file in a portable way. As a workaround, I have added a different argument that allows the users to supply the name of the file which is then looked up in the default bundled location. Happy for other suggestions to how this could be done

In the process I have added logic to allow the loading of a pyvisa-sim yaml file using importlib-resources in the recommended portable way.

TODO

  • Tests of the station loading
  • Docstrings
  • Update other driver tests to make use of the new loaded rather than the __file__ hack
  • Examples of this in docs?

@codecov
Copy link

codecov bot commented Nov 4, 2022

Codecov Report

Merging #4789 (00ae57e) into master (6ceba6f) will increase coverage by 0.02%.
The diff coverage is 50.00%.

@@            Coverage Diff             @@
##           master    #4789      +/-   ##
==========================================
+ Coverage   68.20%   68.23%   +0.02%     
==========================================
  Files         339      339              
  Lines       32043    32050       +7     
==========================================
+ Hits        21856    21869      +13     
+ Misses      10187    10181       -6     

@jenshnielsen
Copy link
Collaborator Author

closed in favour of #4790

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant