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
Add feature to select simulator programatically #805
base: master
Are you sure you want to change the base?
Conversation
@LarsAsplund Please review. I don't have much experience with tox but it seems natural to change the environment variable settings in the |
@nfrancque Today the selection of simulator is done in two steps based on the user's PATH and VUNIT_SIMULATOR:
Rearranging these events makes it harder to see if there are changes in behavior that would break backward compatibility. For that reason I suggest that the programmatic approach to changing the simulator is the same as doing step 1 and that step 2 remains where it is today. You may need to hold on to some of the arguments in the Note that |
Sets id of simulator, used for unique separate output directories for multiple versions of a class | ||
param: id: The id to use | ||
""" | ||
if id is None: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Patterns like this can be simplified as
self.id = id or self.name
param: simulator: Name of a supported simulator | ||
""" | ||
supported_simulators = self.supported_simulators() | ||
name_mapping = {simulator_class.name: simulator_class for simulator_class in self.supported_simulators()} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You declared supported_simulators
on the previous line. I would either remove that and only use self.supported_simulators()
everywhere or use that variable everywhere in here.
One request I have is to be able to also select the simulator from the CLI. When I'm debugging, it's often that I change the simulator from the command line using bash aliases. However, it'd be nice to have the ability to do this from the CLI instead of in the My use-cases are:
For 2., I would probably just use Python to run with two different simulators for all the tests to run back-to-back. But, I switch often enough that it'd be nice to change from the CLI as well. |
Add set_simulator method exposed to user for simpler switching between simulators
#793