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

'Default' time step gets overwritten in examples #686

Open
Jaap-Neven opened this issue Oct 1, 2024 · 3 comments
Open

'Default' time step gets overwritten in examples #686

Jaap-Neven opened this issue Oct 1, 2024 · 3 comments
Assignees

Comments

@Jaap-Neven
Copy link

Problem description

The examples specified in examples.python make use of the basic interface.py module for communicating with the API. In each example, the user passes some inputs, including start time, end time and the control step. At first, interface.py returns some information about the test case, which includes a default control step. After the first initialization, the default control step is shown to be 60.0 seconds, although the user-specified step was 300 seconds. This far, it makes sense, since the default gets overwritten by the user.

image

Running this script subsequently, the default control step is shown to be the control step which was chosen by the user in the previous simulation. According to the image below, the default step is now the previously specified 300 seconds.

image

This print statement can therefore be confusing to the user, since it does not reflect the real default control step.

Proposed fix

I'm not sure if there is a way to access the default control step in a Python script through API communication. If so, this can be fixed in interface.py for all the example scripts. Otherwise, a workaround can be implemented in each example separately, or in interface.py.

@Jaap-Neven Jaap-Neven self-assigned this Oct 1, 2024
@dhblum
Copy link
Collaborator

dhblum commented Oct 1, 2024

Thanks for reporting @Jaap-Neven. Maybe a fix could be instead of printing "Default Control Step" print "Current Control Step"? Then it's true for both the 60 (default started) and the 300 (if user overwrites and subsequently runs the script)?

If you agree, feel free to submit a PR :). A good first one.

@Jaap-Neven
Copy link
Author

Hi @dhblum, I agree that changing the print statement is a good fix, since in reality the user will always want to specify their own timestep.

However, also the structure of interface.py needs to be changed slightly, because the print statement does not print the selected timestep, but the one used in the previous simulation.

I'll have a look into this :)

@dhblum
Copy link
Collaborator

dhblum commented Oct 2, 2024

I suggest then to move it down in the code and print a message about the step used in the simulation.

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

No branches or pull requests

2 participants