Commit c3958eaf authored by Pamphile Roy's avatar Pamphile Roy
Browse files

OT with PIP and CLN

parent 9e4afc8c
......@@ -6,7 +6,7 @@
.. |Codecov| image:: https://gitlab.com/cerfacs/batman/badges/develop/coverage.svg
.. _Codecov: https://gitlab.com/cerfacs/batman/pipelines
.. |Python| image:: https://img.shields.io/badge/python-2.7,_3.6-blue.svg
.. |Python| image:: https://img.shields.io/badge/python-2.7,_3.7-blue.svg
.. _Python: https://python.org
.. |License| image:: https://img.shields.io/badge/license-CECILL--B_License-blue.svg
......@@ -95,9 +95,9 @@ To install conda::
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh
bash Miniconda3-latest-Linux-x86_64.sh
To install batman through ``conda``::
To create a new environment and install batman through ``conda``::
conda install -c conda-forge batman
conda create -n bat_env -c conda-forge batman
All the above dependencies are automatically handled by ``conda``,
except `Antares <http://www.cerfacs.fr/antares>`_. For more information, refer
......@@ -130,7 +130,7 @@ If batman has been correctly installed, you should be able to call it simply::
installation folders. It is recommanded that you leave your ``PYTHONPATH`` empty.
Dependencies
............
````````````
The required dependencies are:
......
......@@ -68,11 +68,11 @@ def mascaret(multizone=False, fname=None):
"""
desc = ("Monte-Carlo sampling simulated using 1D MASCARET flow solver."
" The Garonne river was used and the output consists in water"
" height observations. There are two dataset: (i) multizone with"
" 3 different friction coefficients Ks(1,2,3)~U(15, 60)"
" discretized on 463 points along the channel;"
" (ii) single zone with Ks~U(15, 60). In both cases the mass flow"
" rate Q~N(4035, 400) discretized in 14.")
" height observations. There are two dataset: (i) 5000 samples,"
" multizone with 3 different friction coefficients"
" Ks(1,2,3)~U(15, 60) discretized on 463 points along the channel;"
" (ii) 100000 samples, single zone with Ks~U(15, 60) discretized"
" in 14. In both cases the mass flow rate Q~N(4035, 400).")
if multizone:
flabels = ['13150.0', '13250.0', '13350.0', '13450.0', '13550.0',
......
......@@ -55,9 +55,9 @@ class DbGeneric(object):
:return: f(x).
:rtype: array_like (1, n_features).
"""
x_scaled = self.scaler.transform(np.array(x)[None, :])[0]
dists = distance.cdist([x_scaled, x_scaled], self.sample_scaled, 'seuclidean')
idx = np.argmin(dists, axis=1)[0]
x_scaled = self.scaler.transform(np.array(x)[None, :])
dists = distance.cdist(x_scaled, self.sample_scaled, 'seuclidean')
idx = np.argmin(dists, axis=1)
corresp = self.space[idx]
self.logger.debug("Input: {} -> Database: {}".format(x, corresp))
......
......@@ -62,6 +62,9 @@ def response_surface(bounds, sample=None, data=None, fun=None, doe=None,
n_samples = 50625
n_samples = int(np.floor(np.power(n_samples, 1.0 / dim)))
if doe is not None:
n_samples = n_samples if len(doe) < n_samples else len(doe)
# If axis discretisation is not given through option axis_disc,
# apply default discretisation (same discretisation for every dimension).
if axis_disc is None:
......
......@@ -19,7 +19,6 @@ import os
import sys
import subprocess
from setuptools import (setup, find_packages, Command)
from distutils.version import LooseVersion
cmdclasses = {}
......@@ -45,15 +44,6 @@ class BuildSphinx(Command):
cmdclasses['build_sphinx'] = BuildSphinx
# Check some import before starting build process.
OPENTURNS_MIN_VERSION = LooseVersion('1.10')
try:
import openturns
if LooseVersion(openturns.__version__) < OPENTURNS_MIN_VERSION:
raise ImportError('Found OpenTurns {}'.format(openturns.__version__))
except ImportError as e:
msg = '{}{}You need to install OpenTURNS >= {}'
raise ImportError(msg.format(e, os.linesep, OPENTURNS_MIN_VERSION))
try:
import scipy
except ImportError:
......@@ -67,6 +57,7 @@ setup_requires = ['pytest-runner']
tests_require = ['pytest', 'mock', 'coverage', 'pylint']
install_requires = ['scipy>=0.15',
'numpy>=1.13',
'openturns>=1.10',
'pandas>=0.22.0',
'paramiko>=2',
'jsonschema',
......@@ -146,6 +137,7 @@ setup(
'Programming Language :: Python :: 3.4',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Topic :: Documentation :: Sphinx',
'Topic :: Software Development',
'Topic :: Scientific/Engineering',
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment