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

Incorrectly raised Exception regarding number of time points #66

Closed
leon9812 opened this issue May 5, 2023 · 1 comment · Fixed by #67
Closed

Incorrectly raised Exception regarding number of time points #66

leon9812 opened this issue May 5, 2023 · 1 comment · Fixed by #67

Comments

@leon9812
Copy link

leon9812 commented May 5, 2023

The NotImplementedError (Time course must specify an integer number of time points) in core.py#L197 is raised for specific integer numbers of steps in combination with certain time values.

Example (core.py#L191):

# sim.number_of_points = 500
# sim.initial_time = 0.0
# sim.output_start_time = 0.0
# sim.output_end_time = 1.1
step_number = (
    sim.number_of_points
    * (sim.output_end_time - sim.initial_time)
    / (sim.output_end_time - sim.output_start_time)
)

Even though the number of points is an integer, the step_number now has a value of 499.99999999999994, which raises the exception.

One way to fix this would be to add more parentheses:

step_number = (
    sim.number_of_points
    * (
        (sim.output_end_time - sim.initial_time)
        / (sim.output_end_time - sim.output_start_time)
    )
)
@AlexPatrie
Copy link
Contributor

I can confirm that this works. Fix to come!

@AlexPatrie AlexPatrie linked a pull request May 8, 2023 that will close this issue
AlexPatrie added a commit that referenced this issue May 8, 2023
Implemented try logic and instantiated global `STDOUT_LEVEL`  log level of Capturer Object as per #56 and refactored order of operations as per #66.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

2 participants