Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
CTDAS
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Container Registry
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
CTDAS
CTDAS
Commits
e32ff611
Commit
e32ff611
authored
6 years ago
by
brunner
Browse files
Options
Downloads
Patches
Plain Diff
No commit message
No commit message
parent
7c9c4182
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
da/tools/initexit.py
+3
-3
3 additions, 3 deletions
da/tools/initexit.py
with
3 additions
and
3 deletions
da/tools/initexit.py
+
3
−
3
View file @
e32ff611
...
...
@@ -73,7 +73,7 @@ import glob
import
shutil
import
copy
import
getopt
#
import
cP
ickle
import
p
ickle
import
numpy
as
np
#from string import join
...
...
@@ -257,7 +257,7 @@ class CycleControl(dict):
filename
=
os
.
path
.
join
(
self
[
'
dir.restart
'
],
'
randomseed_%s.pickle
'
%
self
[
'
time.start
'
].
strftime
(
'
%Y%m%d
'
))
f
=
open
(
filename
,
'
wb
'
)
seed
=
np
.
random
.
get_state
()
#
cP
ickle.dump(seed, f, -1)
p
ickle
.
dump
(
seed
,
f
,
-
1
)
f
.
close
()
logging
.
info
(
"
Saved the random seed generator values to file
"
)
...
...
@@ -271,7 +271,7 @@ class CycleControl(dict):
filename
=
os
.
path
.
join
(
self
[
'
dir.restart
'
],
'
randomseed_%s.pickle
'
%
self
[
'
da.restart.tstamp
'
].
strftime
(
'
%Y%m%d
'
))
logging
.
info
(
"
Retrieved the random seed generator values of last cycle from file
"
)
f
=
open
(
filename
,
'
rb
'
)
#
seed =
cP
ickle.load(f)
seed
=
p
ickle
.
load
(
f
)
np
.
random
.
set_state
(
seed
)
f
.
close
()
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment