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

added Simulation.percent_complete property and fixed function name #89

Merged
merged 4 commits into from
May 8, 2017

Conversation

bemcdonnell
Copy link
Member

Addresses #88

@bemcdonnell bemcdonnell added this to the v0.3.4 milestone May 8, 2017
@bemcdonnell bemcdonnell self-assigned this May 8, 2017
@bemcdonnell bemcdonnell requested a review from goanpeca May 8, 2017 16:51
"""
dt = self.current_time - self.start_time
total_time = self.end_time - self.start_time
return dt.total_seconds() / total_time.total_seconds()
Copy link
Contributor

Choose a reason for hiding this comment

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

Are these values ints or floats? cause we might get undesired integer division. Maybe

dt.total_seconds()*1.0 / total_time.total_seconds()

To guarantee they are always floats? (Py2/Py3 gotchas)

Copy link
Member Author

@bemcdonnell bemcdonnell May 8, 2017

Choose a reason for hiding this comment

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

How about float(dt.total_seconds()) / total_time.total_seconds()?

Copy link
Contributor

Choose a reason for hiding this comment

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

Its the same...

pyswmm/swmm5.py Outdated
@@ -24,6 +22,8 @@

# Local imports
from pyswmm.lib import DLL_SELECTION
import ctypes
Copy link
Member Author

Choose a reason for hiding this comment

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

@goanpeca, ciocheck seems to be moving this... Setting issue?

Copy link
Contributor

Choose a reason for hiding this comment

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

add ctypes to known_standard_library: ctypes

Copy link
Member Author

Choose a reason for hiding this comment

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

ok

@bemcdonnell bemcdonnell merged commit 6eb3340 into pyswmm:master May 8, 2017
@bemcdonnell bemcdonnell deleted the percent_complete branch May 8, 2017 17:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants