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
54fa912f
Commit
54fa912f
authored
Jan 20, 2015
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
RNG: hack to accept old format of distribution. I am not sure this new format is required
parent
13b3216e
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
7 additions
and
1 deletion
+7
-1
dream/simulation/RandomNumberGenerator.py
dream/simulation/RandomNumberGenerator.py
+7
-1
No files found.
dream/simulation/RandomNumberGenerator.py
View file @
54fa912f
...
@@ -49,7 +49,13 @@ class RandomNumberGenerator(object):
...
@@ -49,7 +49,13 @@ class RandomNumberGenerator(object):
unknownDistribution
=
False
unknownDistribution
=
False
break
break
if
unknownDistribution
:
if
unknownDistribution
:
raise
ValueError
(
"Unknown distribution %r used in %s %s"
%
# XXX accept old format ??
if
'distributionType'
in
distribution
:
from
copy
import
copy
distribution
=
copy
(
distribution
)
# we do not store this in json !
distribution
[
distribution
.
pop
(
'distributionType'
)]
=
(
distribution
)
else
:
raise
ValueError
(
"Unknown distribution %r used in %s %s"
%
(
distribution
,
obj
.
__class__
,
obj
.
id
))
(
distribution
,
obj
.
__class__
,
obj
.
id
))
# pop irrelevant keys
# pop irrelevant keys
for
key
in
distribution
.
keys
():
for
key
in
distribution
.
keys
():
...
...
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