Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
dream
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
1
Issues
1
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
dream
Commits
8f4285a7
Commit
8f4285a7
authored
Feb 19, 2014
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix reading shifts
parent
033b725d
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
+4
-2
dream/simulation/GUI/Shifts.py
dream/simulation/GUI/Shifts.py
+4
-2
No files found.
dream/simulation/GUI/Shifts.py
View file @
8f4285a7
...
...
@@ -24,9 +24,9 @@ class Simulation(DefaultSimulation):
# Get the dates, and convert them to simulation clock time units.
# In this class, time unit is a minute (XXX it can be an option)
start_date
=
strptime
(
"%s %s"
%
(
line
[
0
],
line
[
2
]),
'%Y/%m/%d %H:%M'
)
start_time
=
(
start_date
-
now
).
seconds
//
60
start_time
=
(
start_date
-
now
).
total_seconds
()
//
60
stop_date
=
strptime
(
"%s %s"
%
(
line
[
0
],
line
[
3
]),
'%Y/%m/%d %H:%M'
)
stop_time
=
(
stop_date
-
now
).
seconds
//
60
stop_time
=
(
stop_date
-
now
).
total_seconds
()
//
60
for
station
in
line
[
1
].
split
(
','
):
shift_by_station
.
setdefault
(
station
,
[]).
append
(
(
start_time
,
stop_time
)
)
...
...
@@ -41,5 +41,7 @@ class Simulation(DefaultSimulation):
"Some stations only exist in shift but not in graph: %r"
\
%
shift_by_station
.
keys
()
# from pprint import pformat
# logger.info(pformat(data))
return
data
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment