Skip to content

Conversation

cmgriffin
Copy link
Collaborator

This update adds the following functionality to the Tektronix_DPO4xxx class:

  • Save the current scope setup to a file
  • Load a scope setup from a file
  • Store the current scope setup to location in the scope memory
  • Recall a scope setup from a location in the scope memory

Add load_setup_file, and save_setup_file to load and save scope setups from a file
Add store_setup, and recall_setup to store and save scope setups to on board memory
@cmgriffin cmgriffin requested a review from AnnaGiasson April 18, 2025 16:49
@cmgriffin cmgriffin changed the title Add Scope Setup Functionality Add Tektronix_DPO4xxx Setup Functionality Apr 18, 2025
@AnnaGiasson
Copy link
Owner

So, I'm going to look into the functionally of your changes a little bit later, but after a quick glance I noticed something that has me questioning something.

What do you think about moving the min supported version of python to at least 3.10? This would simplify a lot of the type hinting.

For example the union type you use in this update, Union[str, Path] could just be str | Path.
Typing unions like this was added in 3.10.

Once I thought of it I also realized that our current min version, 3.9, also supports using generic collections for typing, so you don't need to do from typing import List for example you can just use the built in list ; but there's a bunch of instances of importing List Tuple or Dict from typing throughout the library.

I think for any future updates to files we should clean this up, but for new updates/additions just use the built-ins

complete. Defaults to 5s.
"""
prev_timeout = self.timeout
self.timeout = timeout_seconds * 1000
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't notice that the timeout setter in VisaResource uses milliseconds. That seems inconsistent since the init method uses seconds to define it.

I'll update the baseclass timeout setter, this line, and the one in recall_setup in a subsequent commit.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok makes sense to me.

Copy link
Owner

@AnnaGiasson AnnaGiasson left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, I see no issue merging this in.

@AnnaGiasson AnnaGiasson merged commit e57da54 into AnnaGiasson:master Apr 19, 2025
@cmgriffin
Copy link
Collaborator Author

So, I'm going to look into the functionally of your changes a little bit later, but after a quick glance I noticed something that has me questioning something.

What do you think about moving the min supported version of python to at least 3.10? This would simplify a lot of the type hinting.

For example the union type you use in this update, Union[str, Path] could just be str | Path. Typing unions like this was added in 3.10.

Once I thought of it I also realized that our current min version, 3.9, also supports using generic collections for typing, so you don't need to do from typing import List for example you can just use the built in list ; but there's a bunch of instances of importing List Tuple or Dict from typing throughout the library.

I think for any future updates to files we should clean this up, but for new updates/additions just use the built-ins

The only issue I see with going to 3.10 is what Ted mentioned in his draft PR (#30) which is that Windows 7 can only use up to 3.8. However, currently we don't have 3.8 compatible type hints either. I would personally lean towards only supporting from 3.10 up and proceeding with the latest supported type hints. These are the most intuitive and straightforward to use. If we wanted to have a separate branch/repo for 3.8 support I'm sure there is some automated program that can quickly convert the newer type hints to the older ones (or remove them all together).

@AnnaGiasson
Copy link
Owner

Yea, I'm inclined agree. At this point Windows 7 is pretty dated anyhow.
For Win 7 support I can just look back in the history to a compatible point and leave a tag. If anyone is still using Win7 they can always fork from there.
As far as I'm aware Ted's lab computer is the only one still running Win 7 there. Maybe someone should give him an upgrade.

So, I'll look into upgrading the lib then, I'll see if 3.10 is the next logical jump or if it should be 3.11/12/13. I need to look back at the change log. Is your group running anything specific? Here we are mostly 3.11+

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.

2 participants