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
e85b3331
Commit
e85b3331
authored
Mar 14, 2014
by
Jérome Perrin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
replace the use of scipy by rpy2
parent
44c31d9a
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
43 deletions
+7
-43
dream/simulation/Globals.py
dream/simulation/Globals.py
+7
-6
dream/simulation/LineGenerationCMSD.py
dream/simulation/LineGenerationCMSD.py
+0
-19
dream/simulation/LineGenerationJSON.py
dream/simulation/LineGenerationJSON.py
+0
-18
No files found.
dream/simulation/Globals.py
View file @
e85b3331
...
...
@@ -33,7 +33,6 @@ import xlwt
import
xlrd
from
random
import
Random
,
expovariate
,
gammavariate
,
normalvariate
from
SimPy.Simulation
import
now
import
scipy.stats
as
stat
# ===========================================================================
# globals
...
...
@@ -257,7 +256,7 @@ def countQueueMetrics(argumentDict={}):
# =======================================================================
# Helper function to calculate the
min, max and average values of a serie
# Helper function to calculate the
confidence intervals of a serie.
# =======================================================================
def
getConfidenceIntervals
(
value_list
):
from
Globals
import
G
...
...
@@ -266,8 +265,10 @@ def getConfidenceIntervals(value_list):
return
{
'lb'
:
value_list
[
0
],
'ub'
:
value_list
[
0
],
'avg'
:
value_list
[
0
],
}
bayes_mvs
=
stat
.
bayes_mvs
(
value_list
,
G
.
confidenceLevel
)
return
{
'lb'
:
bayes_mvs
[
0
][
1
][
0
],
'ub'
:
bayes_mvs
[
0
][
1
][
1
],
'avg'
:
bayes_mvs
[
0
][
0
],
}
from
dream.KnowledgeExtraction.ConfidenceIntervals
import
Intervals
import
numpy
lb
,
ub
=
Intervals
().
ConfidIntervals
(
value_list
,
G
.
confidenceLevel
)
return
{
'lb'
:
lb
,
'ub'
:
ub
,
'avg'
:
numpy
.
mean
(
value_list
)
}
dream/simulation/LineGenerationCMSD.py
View file @
e85b3331
...
...
@@ -30,25 +30,6 @@ import logging
logger
=
logging
.
getLogger
(
"dream.platform"
)
try
:
import
scipy
except
ImportError
:
class
scipy
:
class
stats
:
@
staticmethod
def
bayes_mvs
(
*
args
,
**
kw
):
warn
(
"Scipy is missing, using fake implementation"
)
serie
,
confidence
=
args
import
numpy
mean
=
numpy
.
mean
(
serie
),
(
numpy
.
min
(
serie
),
numpy
.
max
(
serie
))
var
=
0
,
(
0
,
0
)
std
=
0
,
(
0
,
0
)
return
mean
,
var
,
std
import
sys
sys
.
modules
[
'scipy.stats'
]
=
scipy
.
stats
sys
.
modules
[
'scipy'
]
=
scipy
logger
.
error
(
"Scipy cannot be imported, using dummy implementation"
)
from
SimPy.Simulation
import
activate
,
initialize
,
simulate
,
now
,
infinity
from
Globals
import
G
from
Source
import
Source
...
...
dream/simulation/LineGenerationJSON.py
View file @
e85b3331
...
...
@@ -33,24 +33,6 @@ from warnings import warn
import
logging
logger
=
logging
.
getLogger
(
"dream.platform"
)
try
:
import
scipy
except
ImportError
:
class
scipy
:
class
stats
:
@
staticmethod
def
bayes_mvs
(
*
args
,
**
kw
):
warn
(
"Scipy is missing, using fake implementation"
)
serie
,
confidence
=
args
import
numpy
mean
=
numpy
.
mean
(
serie
),
(
numpy
.
min
(
serie
),
numpy
.
max
(
serie
))
var
=
0
,
(
0
,
0
)
std
=
0
,
(
0
,
0
)
return
mean
,
var
,
std
import
sys
sys
.
modules
[
'scipy.stats'
]
=
scipy
.
stats
sys
.
modules
[
'scipy'
]
=
scipy
logger
.
error
(
"Scipy cannot be imported, using dummy implementation"
)
# By default numpy just prints on stderr when there's an error. We do not want
# to hide errors.
...
...
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