From 5c50e20d27942f9c6d6ccc0674ae1d329b9e7478 Mon Sep 17 00:00:00 2001 From: Matthias Cuntz Date: Sun, 25 Feb 2024 23:51:40 +0100 Subject: [PATCH] Finished reStructuring of code --- CHANGELOG.rst | 2 +- docs/html/.buildinfo | 2 +- docs/html/_sources/index.rst | 8 +- docs/html/_sources/userguide.rst | 1152 ++++++++++++++---------------- docs/html/contents.html | 19 +- docs/html/index.html | 18 +- docs/html/searchindex.js | 2 +- docs/html/userguide.html | 1111 ++++++++++++++-------------- docs/source/userguide.rst | 216 +++--- 9 files changed, 1242 insertions(+), 1288 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index c1ac481..dcae244 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -4,7 +4,7 @@ Changelog All notable changes after its initial development up to January 2020 (v0.2) are documented in this file. -v4.0 (??? 2024) +v4.0 (Feb 2024) * Moved all Markdown files to reStructuredText. * Moved documentation to sphinxbook. * Moved documentation to Github pages. diff --git a/docs/html/.buildinfo b/docs/html/.buildinfo index ca62b54..0421be9 100644 --- a/docs/html/.buildinfo +++ b/docs/html/.buildinfo @@ -1,4 +1,4 @@ # Sphinx build info version 1 # This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done. -config: c9609f653c1bb154fed1e5e56d75a62e +config: b75f88a65e744a9dc122a434fa2219c9 tags: 645f666f9bcd5a90fca523b33c5a78b7 diff --git a/docs/html/_sources/index.rst b/docs/html/_sources/index.rst index 47421be..9f8e36d 100644 --- a/docs/html/_sources/index.rst +++ b/docs/html/_sources/index.rst @@ -99,13 +99,13 @@ parameters :math:`a` and :math:`b` to the Ishigami-Homma function. def ishigami(x, a, b): return np.sin(x[0]) + a * np.sin(x[1])**2 + b * x[2]**4 * np.sin(x[0]) - def call_func_ab(func, a, b, x): + def call_ishigami(func, a, b, x): return func(x, a, b) # Partialise function with fixed parameters a = 0.5 b = 2.0 - func = partial(call_func_ab, ishigami, a, b) + func = partial(call_ishigami, ishigami, a, b) npars = 3 # lower boundaries @@ -117,9 +117,9 @@ parameters :math:`a` and :math:`b` to the Ishigami-Homma function. out = eee(func, lb, ub, ntfirst=10) Figuratively speaking, :py:func:`~functools.partial` passes `a` and -`b` to the function `call_func_ab` already during definition so that +`b` to the function `call_ishigami` already during definition so that ``eee`` can then simply call it as `func(x)`, where `x` is passed to -`call_func_ab` then as well. +`call_ishigami` then as well. Function wrappers diff --git a/docs/html/_sources/userguide.rst b/docs/html/_sources/userguide.rst index 1738ebd..b8da332 100644 --- a/docs/html/_sources/userguide.rst +++ b/docs/html/_sources/userguide.rst @@ -1,38 +1,28 @@ -********** User Guide -********** +========== -``pyeee`` is a Python library for performing parameter screening of computational models. It uses -Morris' method of Elementary Effects (*EE*) and also its extension of Efficient or Sequential -Elementary Effects (*EEE* or *SEE*) published by: +``pyeee`` is a Python library for performing parameter screening of +computational models. It uses an extension of Morris' method of +Elementary Effects called Efficient or Sequential Elementary Effects +published by: -Cuntz, Mai *et al.* (2015) Computationally inexpensive -identification of noninformative model parameters by sequential -screening, *Water Resources Research* 51, 6417-6441, -doi:`10.1002/2015WR016907 `_. +Cuntz, Mai `et al.` (2015) Computationally inexpensive identification +of noninformative model parameters by sequential screening, +`Water Resources Research` 51, 6417-6441, doi: +`10.1002/2015WR016907`_. -The numerical models are simply passed to functions `ee` and -:func:`~pyeee.eee.eee` to perform Elementary Effects or Efficient/Sequential Elementary Effects, -respectively. - -The numerical models must be callable as `func(x)`. Use :func:`functools.partial` from Python's -standard library to make any function callable as `func(x)`. One can use the package -:mod:`partialwrap` to use external programs with :func:`functools.partial` and hence ``pyeee``. - -The package uses several functions of the JAMS Python package - - https://github.com/mcuntz/jams_python - -The JAMS package and hesseflux are synchronised irregularly. +The numerical models must be callable as `func(x)`. Use +:func:`functools.partial` from Python's standard library to make any +function callable as `func(x)`. One can use the package +:mod:`partialwrap` to use external programs with +:func:`functools.partial` and hence ``pyeee``. Elementary Effects -================== - -Simple Python functions ------------------------ +------------------ -Consider the Ishigami-Homma function: :math:`y = \sin(x_0) + a\,\sin(x_1)^2 + b\,x_2^4\sin(x_0)`. +Consider the Ishigami-Homma function: +:math:`y = \sin(x_0) + a \sin(x_1)^2 + b x_2^4 \sin(x_0)`. Taking :math:`a = b = 1` gives: @@ -44,14 +34,16 @@ Taking :math:`a = b = 1` gives: def ishigami1(x): return np.sin(x[0]) + np.sin(x[1])**2 + x[2]**4 * np.sin(x[0]) -The three parameters :math:`x_0, x_1, x_2` follow uniform distributions between :math:`-\pi` and -:math:`+\pi`. +The three parameters :math:`x_0, x_1, x_2` follow uniform +distributions between :math:`-\pi` and :math:`+\pi`. -Elementary Effects can be calculated, using 20 trajectories, as follows: +Morris' Elementary Effects can then be calculated using, for example, +the Python library :mod:`pyjams`, giving the Elementary Effects +(:math:`\mu*`): .. code-block:: python - from pyjams import ee + from pyjams import screening # function func = ishigami1 @@ -62,120 +54,247 @@ Elementary Effects can be calculated, using 20 trajectories, as follows: # upper boundaries ub = np.ones(npars) * np.pi - # Elementary Effects - np.random.seed(seed=1023) # for reproducibility of examples - out = ee(func, lb, ub, 20) + # Elementary Effects with 20 trajectories + np.random.seed(seed=1023) # for reproducibility of examples + out = screening(func, lb, ub, 20) -:func:`ee` returns a `(npars,3)` ndarray with: + # mu* + print("{:.1f} {:.1f} {:.1f}".format(*out[:, 0])) + # gives: 72.6 0.6 14.3 - 1. (npars,0) the means of the absolute elementary effects over all trajectories (:math:`\mu*`) - 2. (npars,1) the means of the elementary effects over all nt trajectories (:math:`\mu`) - 3. (npars,2) the standard deviations of the elementary effects over all trajectories (:math:`\sigma`) +:func:`~pyjams.screening.screening` returns an `(npars, 3)` ndarray, +with `(npars, 0)` being the means of the absolute Elementary Effects +over all trajectories (:math:`\mu*`). -For Elementary Effects and its sensititvity measures, see +For Elementary Effects and its sensitivity measures, see https://en.wikipedia.org/wiki/Elementary_effects_method, or -Saltelli *et al.* (2007) -Global Sensitivity Analysis. The Primer, John Wiley & Sons Ltd, -Chichester, UK, ISBN: 978-0470-059-975, doi:`10.1002/9780470725184 -`_. +Saltelli `et al.` (2007) Global Sensitivity Analysis. The Primer, John +Wiley & Sons Ltd, Chichester, UK, ISBN: 978-0470-059-975, doi: +`10.1002/9780470725184`_. + + +Efficient/Sequential Elementary Effects +--------------------------------------- + +Morris' method of Elementary Effects is not a full sensitivity +analysis. The sensititvity measures of Elementary Effects are rather +used for preliminary screening for noninformative model parameters for +a given model output, so that fewer parameters are needed during a +full sensitivity analysis or during model optimisation. + +The numerical model `func` will be evaluated `nt * (npars + 1)` times +for calculating Elementary Effects. The user chooses the number of +trajectories `nt`. A large number of `nt` might be computationally +expensive and a small number might miss areas of the parameter space, +where certain parameters become sensitive. Typical values for `nt` in +the literature are on the order of tens to hundreds. This means that +the method of Elementary Effects needs between 500 and 5000 model +evaluations for a model with 50 parameters. + +The extension of Efficient or Sequential Elementary Effects can be +used if one uses Elementary Effects `only` to distinguish between +sensitive (informative) and insensitive (noninformative) model +parameters. It follows the idea: if one knows that a model is +sensitive to a certain parameter, this parameter does not has to be +included anymore in further screening. If a parameter has a large +Elementary Effect in one trajectory it will most probably be +influential. So one does not have to calculate another Elementary +Effect for this parameter and it can be discarded from further +trajectories, saving model evaluations. + +The method starts hence with a limited number of trajectories +`ntfirst` for all model parameters, i.e. it performs +`ntfirst * (npars + 1)` model evaluations. Further trajectories are +sampled, calculating Elementary Effects, but without the parameters +that were already found sensitive. This means that subsequent +trajectories need less and less function evaluations. The algorithm +ends if a subsequent trajectory did not yield any sensitive parameters +anymore. A last `ntlast` trajectories are finally sampled, and +Elementary Effects calculated, to assure a large sample for parameters +with little sensitivity, to minimize the possibility that the +parameters are sensitive in a small part of the parameter space, which +was missed due to a small sample. + +The call of :func:`~pyeee.eee.eee` (or the identical function +:func:`~pyeee.eee.see`) is very similar to standard Elementary effects +:func:`~pyjams.screening.screening` (or the identical function +:func:`~pyjams.screening.ee` ;-): .. code-block:: python - # mu* - print("{:.1f} {:.1f} {:.1f}".format(*out[:,0])) - # gives: 212.4 0.6 102.8 + import numpy as np + from pyeee import eee + + # Ishigami-Homma function a=b=1 + def ishigami1(x): + return np.sin(x[0]) + np.sin(x[1])**2 + x[2]**4 * np.sin(x[0]) + + func = ishigami1 + npars = 3 + + # lower boundaries + lb = np.ones(npars) * (-np.pi) + # upper boundaries + ub = np.ones(npars) * np.pi + + # Sequential Elementary Effects + np.random.seed(seed=1025) # for reproducibility of examples + out = eee(func, lb, ub, ntfirst=10) + + print(out) + # gives: [ True False True] -The numerical model `func`, lower parameter boundaries `lb`, upper parameter boundaries `ub`, and -the number of trajectories `nt` are mandatory arguments to `ee`. Further -optional arguments relevant to Elementary Effects are: +:func:`~pyeee.eee.eee` returns an include-mask, being `True` for +sensitive parameters and `False` for noninformative parameters. The +mask can be combined by `logical_and` with an incoming mask. - - `nsteps` : int - Number of steps along one trajectory (default: 6) - - `ntotal` : int - Total number of trajectories to check for the `nt` most - different trajectories (default: `max(nt**2,10*nt)`) -Note that the functions `ee` and `screening` are identical. +Check initial fit +^^^^^^^^^^^^^^^^^ + +Efficient/Sequential Elementary Effects fits a logistic function to +the output of the `ntfirst` trajectories, which determines the +threshold between informative and uninformative parameters for the +following (shorter) trajectories. One can check this initial, +important step by passing the name of an output file to +:func:`~pyeee.eee.eee` with the keyword `plotfile`: + +.. code-block:: python + + out = eee(func, lb, ub, ntfirst=10, plotfile='ishigami.png') + +Note that :mod:`matplotlib` must be installed to produce the +`plotfile`. The file format of `plotfile` is always `png` independent +on the file name. + + +Logging +^^^^^^^ + +Following the same idea, the user can also log progress and +intermediate results in a text file giving the `logfile` keyword: + +.. code-block:: python + + out = eee(func, lb, ub, ntfirst=10, plotfile='ishigami.png', + logfile='ishigami.log') Exclude parameters from calculations ------------------------------------- +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -`ee` offers the possibility to mask some model parameters so that they will -not be changed during calculation of Elementary Effects. Inital values `x0` must be given that will -be taken where `mask==False`, i.e. `mask` could be called an include-mask. Note that the size of -`x0` must be the size of `lb`, `ub` and `mask`, i.e. one has to give initial values even if an -element is included in the screening, which means `mask[i]==True`. +``eee`` offers the possibility to mask some model parameters so that +they will not be changed during calculation of Elementary +Effects. Inital values `x0` must be given that will be taken where +`mask == False`, i.e. `mask` could be called an include-mask (opposite +of the exclude-mask of numpy's masked arrays). Note that the size of +`x0` must be the size of `lb`, `ub` and `mask`, i.e. one has to give +initial values even if an element is included in the screening, which +means `mask[i] == True`. -For example, if one wants to exclude the second parameter :math:`x_1` of the above Ishigami-Homma -function in the calculation of the Elementary Effects: +For example, if one wants to exclude the second parameter :math:`x_0` +of the above Ishigami-Homma function in the calculation of the +Elementary Effects: .. code-block:: python # function - mask = np.ones(npars, dtype=bool) # True -> include - mask[1] = False # False -> exclude + mask = np.ones(npars, dtype=bool) # True -> include + mask[0] = False # False -> exclude # initial values x0 = np.ones(npars) * 0.5 - # Elementary Effects - np.random.seed(seed=1024) # for reproducibility of examples - out = ee(func, lb, ub, 10, x0=x0, mask=mask, nsteps=8, ntotal=100) + # Efficient Elementary Effects + np.random.seed(seed=1024) # for reproducibility of examples + out = eee(func, lb, ub, x0=x0, mask=mask) + print(out) + # gives: [False False True] + + mask = mask & out + print(mask) + # gives: [False False True] + + +Function with multiple outputs +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ + +The numerical model `func` might return several outputs per model run, +e.g. a time series. The Morris' sensitivity measures are calculated +hence for each output, e.g. for each point in time. Efficient/Sequential +Elementary Effects :func:`~pyeee.eee.eee` can either take the +arithmetic mean of all :math:`\mu*` or a weighted mean :math:`\mu*`, +weighted by :math:`\sigma`. + +The keyword `weight=False` is probably appropriate if each single +output is equally important. An example is river runoff where high +flows might be floods and low flows might be droughts. One might want +that the computer model reproduces both circumstances. - print("{:.1f} {:.1f} {:.1f}".format(*out[:,0])) - # gives: 114.8 0.0 26.6 +An example for `weight=True` are fluxes to and from the atmosphere +such as evapotranspiration. The atmosphere is more strongly influenced +by larger fluxes so that sensitivity measures during periods of little +atmospheric exchange are less interesting. `Cuntz, Mai et al.`_ (2015) +argued that weighting by standard deviation :math:`\sigma` is +equivalent to flux weighting because parameter variations yield larger +variances for larger fluxes than they yield for smaller fluxes in most +computer models. Parallel model evaluation -------------------------- +^^^^^^^^^^^^^^^^^^^^^^^^^ -The numerical model `func` will be evaluated `nt*(npars+1)` times, with `npars` the number of -parameters of the computational model. Multiprocessing can be used for parallel function -evaluation. Setting `processes=nprocs` evaluates `nprocs` parameter sets in parallel: +The numerical model `func` will be evaluated `npars + 1` times for +each trajectory, with `npars` the number of parameters of the +computational model. Multiprocessing can be used for parallel function +evaluation. Setting `processes=nprocs` evaluates `nprocs` parameter +sets in parallel: .. code-block:: python - # Elementary Effects using 4 parallel processes - np.random.seed(seed=1024) # for reproducibility of examples - out = ee(func, lb, ub, 10, x0=x0, mask=mask, nsteps=8, ntotal=100, - processes=4) + # Efficient Elementary Effects using 4 parallel processes + out = eee(func, lb, ub, processes=4) -``pyeee`` uses the package :mod:`schwimmbad` for parallelisation. :mod:`schwimmbad` provides a -uniform interface to parallel processing pools and enables switching easily between local -development (e.g. serial processing or :mod:`multiprocessing`) and deployment on a cluster or -supercomputer (via e.g. MPI or JobLib). +``pyeee`` uses the package :mod:`schwimmbad` for +parallelisation. :mod:`schwimmbad` provides a uniform interface to +parallel processing pools and enables switching easily between local +development (e.g. serial processing or :mod:`multiprocessing`) and +deployment on a cluster or supercomputer (e.g. via MPI or JobLib). -Consider the following code in a script (e.g. `eeetest.py`): +Consider the following Python code in a script (e.g. `eeetest.py`): .. code-block:: python # File: eeetest.py + import sys + import numpy as np + from pyeee import eee + import schwimmbad + + # Ishigami-Homma function a=b=1 + def ishigami1(x): + return np.sin(x[0]) + np.sin(x[1])**2 + x[2]**4 * np.sin(x[0]) # get number of processes - import sys if len(sys.argv) > 1: nprocs = int(sys.argv[1]) else: nprocs = 1 - # Ishigami-Homma function a=b=1 - import numpy as np - def ishigami1(x): - return np.sin(x[0]) + np.sin(x[1])**2 + x[2]**4 * np.sin(x[0]) - # mpi4py is an optional dependency of pyeee try: from mpi4py import MPI comm = MPI.COMM_WORLD csize = comm.Get_size() crank = comm.Get_rank() + if csize > 1: + nprocs = csize except ImportError: comm = None csize = 1 crank = 0 - from pyjams import ee - # function func = ishigami1 npars = 3 @@ -186,137 +305,89 @@ Consider the following code in a script (e.g. `eeetest.py`): ub = np.ones(npars) * np.pi # choose the serial or parallel pool - import schwimmbad - ipool = schwimmbad.choose_pool(mpi=False if csize==1 else True, processes=nprocs) + ipool = schwimmbad.choose_pool(mpi=False if csize==1 else True, + processes=nprocs) # Elementary Effects - np.random.seed(seed=1023) # for reproducibility of examples - out = ee(func, lb, ub, 20, processes=nprocs, pool=ipool) + np.random.seed(seed=1023) # for reproducibility of examples + out = eee(func, lb, ub, processes=nprocs, pool=ipool) if crank == 0: - print("{:.1f} {:.1f} {:.1f}".format(*out[:,0])) + print(out) ipool.close() -This script can be run serially, i.e. that all function evaluations are done one after the other: +The user gives the number of processors to use on the command line (`ncpus`). + +This script can be run in normal serial mode, i.e. all function +evaluations are done one after the other: .. code-block:: bash python eeetest.py -or +One can give explicitly that the script should run one core only: .. code-block:: bash python eeetest.py 1 -It can use Python's :mod:`multiprocessing` module, e.g. with 4 parallel processes: +Or it can use Python's :mod:`multiprocessing` module, e.g. with 4 +parallel processes: .. code-block:: bash python eeetest.py 4 -or use the Message Passing Interface (MPI), e.g. with 4 parallel processes: +or use the Message Passing Interface (MPI), e.g. with 4 parallel +processes: .. code-block:: bash - mpiexec -n 4 python eeetest.py 4 - -Note that :mod:`mpi4py` must be installed for the latter. - + mpiexec -n 4 python eeetest.py -Python functions with additional parameters -------------------------------------------- - -The function for ``pyeee`` must be of the form `func(x)`. Use Python's :func:`functools.partial` to -pass other function parameters. - -For example pass the parameters :math:`a` and :math:`b` to the Ishigami-Homma function. One needs a -wrapper function that takes the function and its parameters as arguments. The variable parameters -of the screening must be the last argument, i.e. `x` of `func(x)`: - -.. code-block:: python - - from functools import partial - - def ishigami(x, a, b): - return np.sin(x[0]) + a * np.sin(x[1])**2 + b * x[2]**4 * np.sin(x[0]) - - def call_func_ab(func, a, b, x): - return func(x, a, b) - -The parameters :math:`a` and :math:`b` are fixed parameters during -screening. They are hence already passed to `call_func_ab` with -:func:`functools.partial` before start of the screening. - -.. code-block:: python - - # Partialise function with fixed parameters a and b - a = 0.5 - b = 2.0 - func = partial(call_func_ab, ishigami, a, b) - - out = ee(func, lb, ub, 10) - -When `func` is called as `func(x)`, the call of `call_func_ab` is finished and `x`, `a` and `b` are -passed to `ishigami`. - -We recommend the package :mod:`partialwrap` that provides wrapper functions to work with -:func:`functools.partial`. `call_func_ab` can be replaced by the wrapper function of -:mod:`partialwrap`: :func:`~partialwrap.function_wrapper`: - -.. code-block:: python - - from partialwrap import function_wrapper - arg = [a, b] - kwarg = {} - func = partial(function_wrapper, ishigami, arg, kwarg) - out = ee(func, lb, ub, 10) - -where all arguments of the function but the first one must be given as a :any:`list` and keyword -arguments as a :any:`dict`. The function wrapper finally passes `x`, `arg` and `kwarg` to `func(x, -*arg, **kwarg)`. - -:mod:`partialwrap` provides also a wrapper function to work with masks as above. To exclude the -second parameter :math:`x_1` from screening of the Ishigami-Homma function, `x0` and `mask` must be -given to :func:`~partialwrap.function_mask_wrapper`. Then Elementary Effects will be calculated -only for the remaining parameters, between `lb[mask]` and `ub[mask]`. All other non-masked -parameters will be taken as `x0`. Remember that `mask` is an include-mask, i.e. all `mask==True` -will be screened and all `mask==False` will not be screened. - -.. code-block:: python - - from partialwrap import function_mask_wrapper - func = partial(function_mask_wrapper, ishigami, x0, mask, arg, kwarg) - out = ee(func, lb[mask], ub[mask], 10) +Note that :mod:`mpi4py` must be installed for the last example. Sampling parameters with other distributions than the uniform distribution --------------------------------------------------------------------------- +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -Morris' method of Elementary Effects samples parameters along trajectories through the possible -parameter space. It assumes uniformly distributed parameters between a lower bound and an upper +Morris' method of Elementary Effects samples parameters along +trajectories through the possible parameter space. It assumes +uniformly distributed parameters between a lower bound and an upper bound. -``pyeee`` allows sampling parameters from other than uniform distributions. For example, a -parameter :math:`p` might have been determined by repeated experiments. One can hence determine the -mean parameter :math:`\overline{p}` and calculate the error of the mean :math:`\epsilon_p`. This -error of the mean is actually the standard deviation of the distribution of the mean. One would -thus sample a normal distribution with mean :math:`\overline{p}` and a standard deviation -:math:`\epsilon_p` for the parameter :math:`p` for determining Morris' Elementary Effects. - -``pyeee`` allows all distributions of :mod:`scipy.stats`, given with the keyword `dist`. The -parameter of the distributions are given as tuples with the keyword `distparam`. The lower and -upper bounds change their meaning if `dist` is given for a parameter: ``pyeee`` samples uniformly -the Percent Point Function (ppf) of the distribution between lower and upper bound. The percent -point function is the inverse of the Cumulative Distribution Function (cdf). Lower and upper bound -must hence be between `0` and `1`. Note the percent point functions of most continuous -distributions will be infinite at the limits `0` and `1`. - -The three parameters :math:`x_0, x_1, x_2` of the Ishigami-Homma function follow uniform -distributions between :math:`-\pi` and :math:`+\pi`. Say that :math:`x_1` follows a Gaussian -distribution around the mean `0` with a standard deviation of 1.81. We want to sample between plus -or minus three standard deviations, which includes about 99.7\% of the total distribution. This -means that the lower bound would be 0.0015 (0.003/2.) and the upper bound 0.9985. +The implementation of Morris' Elementary Effects +:func:`~pyjams.screening.screening` in the Python library +:mod:`pyjams` allows sampling parameters from other distributions than +uniform distributions. For example, a parameter :math:`p` might have +been determined by repeated experiments. One can hence determine the +mean parameter :math:`\overline{p}` and calculate the error of the +mean :math:`\epsilon_p`. This error of the mean is actually the +standard deviation of the distribution of the mean. One would thus +sample a normal distribution with mean :math:`\overline{p}` and a +standard deviation :math:`\epsilon_p` for the parameter :math:`p` for +determining Morris' Elementary Effects. + +:func:`~pyjams.screening.screening` allows all distributions of +mod:`scipy.stats`, given with the keyword `dist`. The parameters of +the distributions are given as a list of tuples with the keyword +`distparam`. The lower and upper bounds change their meaning if `dist` +is given for a parameter: :func:`~pyjams.screening.screening` samples +uniformly the Percent Point Function (ppf) of the distribution between +lower and upper bound. The percent point function is the inverse of +the Cumulative Distribution Function (cdf). Lower and upper bounds +must hence be between `0` and `1`. Note the percent point functions of +most continuous distributions will be infinite at the limits `0` and +`1`. + +The three parameters :math:`x_0, x_1, x_2` of the Ishigami-Homma +function follow uniform distributions between :math:`-\pi` and +:math:`+\pi`. Say that :math:`x_1` follows a Gaussian distribution +around the mean :math:`0` with a standard deviation of +:math:`1.81`. We want to sample between plus or minus three standard +deviations, which includes about 99.7\% of the total +distribution. This means that the lower bound would be 0.0015 +(0.003/2.) and the upper bound 0.9985. .. code-block:: python @@ -326,527 +397,412 @@ means that the lower bound would be 0.0015 (0.003/2.) and the upper bound 0.9985 lb = [-np.pi, 0.0015, 0.] ub = [np.pi, 0.9985, 1.] - out = ee(func, lb, ub, 20, dist=dist, distparam=distparam) + out = screening(func, lb, ub, 20, dist=dist, distparam=distparam) This shows that 1. one has to give a distribution for each parameter; 2. distributions are given as :mod:`scipy.stats` distribution objects; - 3. if `dist` is None, ``pyeee`` assumes a uniform distribution and samples between lower and - upper bound; - 4. (almost) all :mod:`scipy.stats` distributions take the keywords `loc` and `scale`. Their - meaning is *NOT* mean and standard deviation in most distributions. For the uniform - distribution :any:`scipy.stats.uniform`, `loc` is the lower limit and `loc+scale` the upper - limit. This means the combination `dist=None`, `lb=a`, `ub=b` corresponds to - `dist=scipy.stats.uniform`, `distparam=[a,b-a]`, `lb=0`, `ub=1`. + 3. if `dist` is None, :func:`~pyjams.screening.screening` assumes a + uniform distribution and samples between lower and upper bound; + 4. (almost) all :mod:`scipy.stats` distributions take the keywords + `loc` and `scale`. Their meaning is *NOT* mean and standard + deviation in most distributions. For the uniform distribution + :any:`scipy.stats.uniform`, `loc` is the lower limit and + `loc + scale` the upper limit. This means the combination + `dist=None`, `distparam=None`, `lb=a`, `ub=b` corresponds to + `dist=scipy.stats.uniform`, `distparam=[a, b-a]`, `lb=0`, `ub=1`. Note also that 5. if `distparam` is None, `loc=0` and `scale=1` will be taken; - 6. `loc` and `scale` are implemented as keywords in :mod:`scipy.stats`. Other parameters such as - for example the shape parameter of the gamma distribution :any:`scipy.stats.gamma` must hence be - given first, i.e. `(shape,loc,scale)`. - -Remember that Morris' method of Elementary Effects assumes uniformly distributed parameters and -that other distributions are an extension of the original method. + 6. `loc` and `scale` are implemented as keywords in + :mod:`scipy.stats`. Other parameters such as for example the + shape parameter of the gamma distribution + :any:`scipy.stats.gamma` must hence be given first, + i.e. `(shape, loc, scale)`. +Remember that Morris' method of Elementary Effects assumes uniformly +distributed parameters and that other distributions are an extension +of the original method. -Efficient/Sequential Elementary Effects -======================================= - -Morris' method of Elementary Effects is not a full sensitivity analysis. The sensititvity measures -of Elementary Effects are rather used for preliminary screening for noninformative model parameters -for a given model output, so that fewer parameters are needed during a full sensitivity analysis or -during model optimisation. - -The numerical model `func` will be evaluated `nt*(npars+1)` times for calculating Elementary -Effects. The user chooses the number of trajectories `nt`. A large number of `nt` might be -computationally expensive and a small number might miss areas of the parameter space, where certain -parameters become sensitive. Typical values for `nt` in the literature are on the order of tens to -hundreds. This means that the method of Elementary Effects needs between 500 and 5000 model -evaluations for a model with 50 parameters. - -The extension of Efficient or Sequential Elementary Effects can be used if one uses Elementary -Effects *only* to distinguish between sensitive (informative) and insensitive (noninformative) -model parameters. It follows the idea: if one knows that a model is sensitive to a certain -parameter, this parameter does not has to be included anymore in the further screening. If a -parameter has a large Elementary Effect in one trajectory it will most probably be influential. So -one does not have to calculate another Elementary Effect for this parameter and it can be discarded -from further trajectories. - -The method starts hence with a limited number of trajectories `ntfirst` for all model parameters, -i.e. it performs `ntfirst*(npars+1)` model evaluations. Further trajectories are sampled, -calculating Elementary Effects, but without the parameters that were already found sensitive. This -means that subsequent trajectories need less and less function evaluations. The algorithm ends if a -subsequent trajectory did not yield any sensitive parameters anymore. A last `ntlast` trajectories -are finally sampled, and Elementary Effects calculated, to assure a large sample for little -sensitive parameters, to minimize the possibility that the parameters are sensitive in a small part -of the parameter space, which was missed due to a little sample. - -The call of :func:`~pyeee.screening.eee` (or the identical function :func:`~pyeee.screening.see`) -is very similar to standard Elementary effects `ee`: +``eee`` uses :func:`~pyjams.screening.screening` from :mod:`pyjams` +internally. It consequently also offers the possibility to sample +other distributions than uniform distributions with the keywords +`dist` and `distparams`. .. code-block:: python - def ishigami(x, a, b): - return np.sin(x[0]) + a * np.sin(x[1])**2 + b * x[2]**4 * np.sin(x[0]) - - from partialwrap import function_wrapper - arg = [a, b] - kwarg = {} - unc = partial(function_wrapper, ishigami, arg, kwarg) - npars = 3 - - # lower boundaries - lb = np.ones(npars) * (-np.pi) - # upper boundaries - ub = np.ones(npars) * np.pi - - # Sequential Elementary Effects - from pyeee import eee - np.random.seed(seed=1025) # for reproducibility of examples - out = eee(func, lb, ub, ntfirst=10, ntlast=5, nsteps=6, - processes=4) + out = eee(func, lb, ub, ntfirst=10, dist=dist, distparam=distparam) - print(out) - # gives: [ True False True] -:func:`~pyeee.screening.eee` returns an include-mask, being `True` for sensitive parameters and -`False` for noninformative parameters. The mask can be combined by `logical_and` with an incoming -mask. - -Note if you use :func:`~partialwrap.function_mask_wrapper`, `out` has the dimension of the -`mask==True` elements: - -.. code-block:: python +Python function with extra parameters +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ - from partialwrap import function_mask_wrapper - func = partial(function_mask_wrapper, ishigami, x0, mask, arg, kwarg) - out = eee(func, lb[mask], ub[mask]) +The function for :func:`~pyeee.eee.eee` must be of the form +`func(x)`. Use Python's :func:`functools.partial` from the Python +module :mod:`functools` to pass other function parameters. - # update mask - mask[mask] = mask[mask] & out +For example pass the parameters :math:`a` and :math:`b` to the +Ishigami-Homma function. One needs a wrapper function that takes the +function and its parameters as arguments. The variable parameters of +the screening must be the last argument, i.e. it must be `x` of +`func(x)`: -The numerical model `func` might return several outputs per model run, e.g. a time series. The -Morris' sensitivity measures are calculated hence for each output, e.g. each point in time. -Efficient/Sequential Elementary Effects :func:`~pyeee.screening.eee` can either take the arithmetic -mean of all :math:`\mu*` or a weighted mean :math:`\mu*`, weighted by :math:`\sigma`. The keyword -`weight==False` is probably appropriate if each single output is equally important. An example is -river runoff where high flows might be floods and low flows might be droughts. One might want that -the computer model reproduces both circumstances. An example for `weight==True` are fluxes to and -from the atmosphere such as evapotranspiration. The atmosphere is more strongly influenced by -larger fluxes so that sensitivity measures during periods of little atmosphere exchange are less -interesting. Cuntz *et al.* (2015) argued that weighting by standard deviation :math:`\sigma` is -equivalent to flux weighting because parameter variations yield larger variances for large fluxes -than for small fluxes in most computer models. +.. code:: python -:func:`~pyeee.screening.eee` offers the same parallel mechanism as `ee`, using the -:func:keywords `processes` and `pool`, which is again a :mod:`schwimmbad` `pool` object. - -:func:`~pyeee.screening.eee` also offers the possibility to sample parameters from different -distributions of :mod:`scipy.stats` with the keywords `dist` and `distparam`. - -One can give a `plotfile` name to check the initial fit to the `ntfirst` Elementary Effects. - -.. code-block:: python - - # Sequential Elementary Effects using all parameters and keywords - out = eee(func, lb, ub, - x0=x0, mask=mask, ntfirst=10, ntlast=10, nsteps=6, weight=True, - processes=4, seed=1025, - plotfile='ishigami.png', logfile='ishigami.log') - -Note that :mod:`matplotlib` must be installed to produce the `plotfile`. - - -External computer models -======================== - -**Note that this section is pretty much a repetition of the** `User Guide -`_ **of** :mod:`partialwrap`, **which is not -limited to be used with** ``pyeee`` **but can be used with any package that calls functions in -the form** `func(x)`. **The notions of** :mod:`partialwrap` **might be better explained in its** `user guide -`_. - -:mod:`partialwrap` provides wrapper functions to work with external executables. :mod:`partialwrap` -writes the sampled parameter sets into files that can be read by the external program. The program -writes its result to a file that will then be read by :mod:`partialwrap` in return. The processing -steps are: - -.. code-block:: python + from functools import partial - parameterwriter(parameterfile, parameters) - err = subprocess.check_output(exe) - obj = outputreader(outputfile) - os.remove(parameterfile) - os.remove(outputfile) + def ishigami(x, a, b): + return np.sin(x[0]) + a * np.sin(x[1])**2 + b * x[2]**4 * np.sin(x[0]) -That means :mod:`partialwrap` needs to have a function `parameterwriter` that writes the parameter -file `parameterfile` needed by the executable `exe`. It then needs to have a function -`outputreader` for reading the output file `outputfile` of `exe`, reading or calculating the -objective value used by Elementary Effects. + # x has to be the last argument + def call_ishigami(func, a, b, x): + return func(x, a, b) + # Partialise function with fixed parameters + a = 0.5 + b = 2.0 + func = partial(call_ishigami, ishigami, a, b) -Simple executables ------------------- + npars = 3 + lb = np.ones(npars) * (-np.pi) + ub = np.ones(npars) * np.pi + out = eee(func, lb, ub, ntfirst=10) -Consider for simplicity an external Python program (e.g. `ishiexe.py`) -that calculates the Ishigami-Homma function with :math:`a = b = 1`, -reading in the three parameters :math:`x_0, x_1, x_2` from a -`parameterfile = params.txt` and writing its output into an -`outputfile = obj.txt`: +The parameters :math:`a` and :math:`b` are fixed parameters during +screening. Figuratively speaking, :func:`functools.partial` passes +:math:`a` and :math:`b` to the function `call_ishigami` already during +definition. :func:`~pyeee.eee.eee` can then simply call it as +`func(x)`, where `x` is passed to `call_ishigami` then as well. This +"finishes" the call of `call_ishigami` and `x`, `a` and `b` are passed +to `ishigami`. + + +Screening of external computer models +------------------------------------- + +**Note: this section is pretty much a repetition of the** `User +Guide`_ **of** :mod:`partialwrap`, **which itself is not limited to be +used with** ``pyeee`` **but can be used with any package that calls +functions in the form** `func(x)`. **The finer notions of** +:mod:`partialwrap` **might be better explained in its** `User Guide`_. + +``pyeee`` can be used to screen parameters from external computer +models written in any (compiled) language such as C, Fortran or +similar. We use our package :mod:`partialwrap` for this. +:mod:`partialwrap` provides wrapper functions that basically launch +external executables using Python's :mod:`subprocess` module, while +providing functionality to write parameter files for the external +executables and read in output from the executables in return. + +This means that the wrappers of :mod:`partialwrap` need a function +`parameterwriter` that writes the parameters in the parameter file(s) +`parameterfile`. The wrappers also need to read model output from +`outputfile` with the function `outputreader`. The latter can also do +further calculations such as calculating an objective function from +the model output. + +Take an external program that calculates the Ishigami-Homma function +with :math:`a = b = 1`, reading in the parameters :math:`x_0, x_1, +x_2` from a `parameterfile = params.txt` and writing its output into +an `outputfile = out.txt`. Take for simplicity a Python program first +(e.g. `ishigami1.py`): .. code-block:: python - # File: ishiexe.py + # File: ishigami1.py + import numpy as np # Ishigami-Homma function a=b=1 - import numpy as np def ishigami1(x): return np.sin(x[0]) + np.sin(x[1])**2 + x[2]**4 * np.sin(x[0]) # read parameters - from partialwrap import standard_parameter_reader - pfile = 'params.txt' - x = standard_parameter_reader(pfile) + x = np.loadtxt('params.txt') # calc function y = ishigami1(x) - # write objective - ofile = 'obj.txt' - with open(ofile, 'w') as ff: - print(y, file=ff) + # write output file + np.savetxt('out.txt', y) -This program can be called on the command line with: - -.. code-block:: bash - - python ishiexe.py - -The external program can be used in ``pyeee`` with :func:`functools.partial` and the -wrapper function :func:`~partialwrap.exe_wrapper`: +The external program, which is in full `python3 ishigami1.py`, can be +used with the wrapper function +:func:`~partialwrap.wrappers.exe_wrapper` of :mod:`partialwrap`: .. code-block:: python from functools import partial - from partialwrap import exe_wrapper, standard_parameter_writer, standard_output_reader - - ishi = ['python', 'ishiexe.py'] - parameterfile = 'params.txt' - outputfile = 'obj.txt' - func = partial(exe_wrapper, ishi, - parameterfile, standard_parameter_writer, - outputfile, standard_output_reader, {}) + import numpy as np + import scipy.optimize as opt + from partialwrap import exe_wrapper + from pyeee import eee + + ishigami1_exe = ['python3', 'ishigami1.py'] + parameterfile = 'params.txt' + parameterwriter = np.savetxt + outputfile = 'out.txt' + outputreader = np.loadtxt + ishigami1_wrap = partial(exe_wrapper, ishigami1_exe, + parameterfile, parameterwriter, + outputfile, outputreader, {}) npars = 3 lb = np.ones(npars) * (-np.pi) ub = np.ones(npars) * np.pi + out = eee(ishigami1_wrap, lb, ub, ntfirst=10) - from pyjams import ee - out = ee(func, lb, ub, 10) - -:func:`~partialwrap.standard_parameter_reader` and `~partialwrap.standard_parameter_writer` are -convenience functions that read and write one parameter per line in a file without a header. The -function :func:`~partialwrap.standard_output_reader` simply reads one value from a file without -header. The empty dictionary at the end will be explained below at `Further arguments of -wrappers`_. - -One can easily imagine to replace the python program `ishiexe.py` by any compiled executable from -C, Fortran or alike. - - -Exclude parameters from screening ---------------------------------- - -Similar to :func:`~partialwrap.function_mask_wrapper`, there is also a wrapper to work with masks -and external executables: :func:`~partialwrap.exe_mask_wrapper`. To exclude the second parameter -:math:`x_1` from screening of the Ishigami-Homma function, `x0` and `mask` must be given to -:func:`~partialwrap.exe_mask_wrapper` as well. Remember that `mask` is an include-mask, i.e. all -`mask==True` will be screened and all `mask==False` will not be screened: - -.. code-block:: python - - mask = np.ones(npars, dtype=bool) # True -> include - mask[1] = False # False -> exclude - x0 = np.ones(npars) * 0.5 - func = partial(exe_mask_wrapper, ishi, x0, mask, - parameterfile, standard_parameter_writer, - outputfile, standard_output_reader, {}) - out = ee(func, lb[mask], ub[mask], 10) - -:math:`x_1` will then always be the second element of `x0`. - - -Additional arguments for external executables ---------------------------------------------- - -Further arguments to the external executable can be given simply by adding it to the call string. -For example, if :math:`a` and :math:`b` were command line arguments to `ishiexe.py`, they could -simply be given in the function name: - -.. code-block:: python - - ishi = ['python3', 'ishiexe.py', '-a '+str(a), '-b '+str(b)] - - -Further arguments of wrappers ------------------------------ - -The user can pass further arguments to :func:`~partialwrap.exe_wrapper` and -:func:`~partialwrap.exe_mask_wrapper` via a dictionary at the end of the call. Setting the key -`shell` to `True` passes `shell=True` to :func:`subprocess.check_output`, which makes -:func:`subprocess.check_output` open a shell for running the external executable. Note that the -`args` in :mod:`subprocess` must be a string if `shell=True` and a list if `shell=False`. Setting -the key `debug` to `True` uses :func:`subprocess.check_call` so that any output of the external -executable will be written to the screen (precisely :any:`subprocess.STDOUT`). This especially -prints out also any errors that might have occured during execution: - -.. code-block:: python - - ishi = 'python ishiexe.py' - func = partial(exe_wrapper, ishi, - parameterfile, standard_parameter_writer, - outputfile, standard_output_reader, - {'shell':True, 'debug':True}) - out = ee(func, lb, ub, 10) - -This mechanism allows passing also additional arguments and keyword arguments to the -`parameterwriter`. Setting `pargs` to a list of arguments and `pkwargs` to a dictionary with -keyword arguments passes them to the `parameterwriter` as: - -.. code-block:: python - - parameterwriter(parameterfile, x, *pargs, **pkwargs) - -Say an external program uses a `parameterfile` that has five -informations per line: 1. identifier, 2. current parameter value, 3. minimum -parameter value, 4. maximum parameter value, 5. parameter mask, e.g.: - -.. code-block:: none - - # value min max mask - 1 0.5 -3.1415 3.1415 1 - 2 0.0 -3.1415 3.1415 0 - 3 1.0 -3.1415 3.1415 1 +The empty dictionary at the end of the partial statement is explained +below. -One can use :func:`~partialwrap.standard_parameter_reader_bounds_mask` in this case. Parameter -bounds and mask can be passed via `pargs`: +One can see that the external Ishigami-Homma program could have been +written in a compiled language such as C, Fortran or similar, and then +used with ``pyeee``. A Fortran program could look like this: -.. code-block:: python - - from partialwrap import standard_parameter_reader_bounds_mask - - ishi = ['python', 'ishiexe.py'] - func = partial(exe_wrapper, ishi, - parameterfile, standard_parameter_reader_bounds_mask, - outputfile, standard_output_reader, - {'pargs':[lb,ub,mask]}) - out = ee(func, lb, ub, 10) - -Or in case of exclusion of :math:`x_1`: +.. code-block:: fortran -.. code-block:: python - - from partialwrap import standard_parameter_reader_bounds_mask - func = partial(exe_mask_wrapper, ishi, x0, mask, - parameterfile, standard_parameter_reader_bounds_mask, - outputfile, standard_output_reader, - {'pargs':[lb,ub,mask]}) - out = ee(func, lb[mask], ub[mask], 10) + program ishigami1 -Another common case is that the parameters are given in the form `parameter = value`, e.g. in -Fortran namelists. :mod:`partialwrap` provides a function that searches parameter names on the -left-hand-side of an equal sign and replaces the values on the right-hand-side of the equal sign -with the sampled parameter values. The `parameterfile` might look like: + implicit none -.. code-block:: Fortran + integer, parameter :: dp = kind(1.0d0) - ¶ms - x0 = 0.5 - x1 = 0.0 - x2 = 1.0 - / + character(len=*), parameter :: pfile = 'params.txt' + character(len=*), parameter :: ofile = 'out.txt' -The function :func:`~partialwrap.sub_params_names` (which is identical to -:func:`~partialwrap.sub_params_names_ignorecase`) can be used and parameter names are passed via -`pargs`: + integer, parameter :: punit = 99 + integer, parameter :: ounit = 101 -.. code-block:: python + real(dp), dimension(3) :: x ! parameters x_0, x_1, x_2 + real(dp) :: out ! output value + integer :: n - from partialwrap import sub_params_names + integer :: ios - pnames = ['x0', 'x1', 'x2'] - func = partial(exe_wrapper, ishi, - parameterfile, sub_params_names, - outputfile, standard_output_reader, - {'pargs':[pnames], 'pid':True}) - out = ee(func, lb, ub, 10) + ! read parameters + open(punit, file=pfile, status='old', action='read') + ios = 0 + n = 1 + do while (ios==0) + read(punit, fmt=*, iostat=ios) x(n) + n = n + 1 + end do + n = n - 2 + close(punit) -`parameterfile` can be a list of parameterfiles in case of :func:`~partialwrap.sub_params_names`. -`pid` will be explained in the next section. Note that `pargs` is set to `[pnames]`. Setting -`'pargs':pnames` would give `*pnames` to the `parameterwriter`, that means each parameter name as -an individual argument, which would be wrong because :func:`~partialwrap.sub_params_names` wants to -have a list of parameter names. The docstring of :func:`~partialwrap.exe_wrapper` states: + ! calc function + out = sin(x(1)) + sin(x(2))**2 + x(3)**4 * sin(x(1)) -.. code-block:: none + ! write output file + open(ounit, file=ofile) + write(ounit,*) out + close(ounit) - Wrapper function for external programs using a `parameterwriter` and `outputreader` - with the interfaces: - `parameterwriter(parameterfile, x, *pargs, **pkwargs)` - `outputreader(outputfile, *oargs, **okwargs)` - or if `pid==True`: - `parameterwriter(parameterfile, x, *pargs, pid=pid, **pkwargs)` - `outputreader(outputfile, *oargs, pid=pid, **okwargs)` + end program ishigami1 -And the definition of :func:`~partialwrap.sub_params_names` is: +This program can be compiled like: -.. code-block:: python - - def sub_params_names_ignorecase(files, params, names, pid=None): +.. code-block:: bash -This means that `*pargs` passes `*[pnames]`, which is `pnames`, as an argument after the -parameters `x` to :func:`~partialwrap.sub_params_names`. + gfortran -o ishigami1.exe ishigami1.f90 -Excluding :math:`x_1` would then be achieved by simply excluding `x1` from `pnames`: +and used in Python: .. code-block:: python - from partialwrap import sub_params_names - - pnames = ['x0', 'x2'] - func = partial(exe_wrapper, ishi, - parameterfile, sub_params_names, - outputfile, standard_output_reader, - {'pargs':[pnames], 'pid':True}) - out = ee(func, lb[mask], ub[mask], 10) - - -Parallel processing of external executables -------------------------------------------- + from functools import partial + import numpy as np + import scipy.optimize as opt + from partialwrap import exe_wrapper + from pyeee import eee + + ishigami1_exe = ['ishigami1.exe'] + parameterfile = 'params.txt' + parameterwriter = np.savetxt + outputfile = 'out.txt' + outputreader = np.loadtxt + ishigami1_wrap = partial(exe_wrapper, ishigami1_exe, + parameterfile, parameterwriter, + outputfile, outputreader, {}) -Elementary Effects run the computational model `nt*(npars+1)` times. All model runs are independent -and can be executated at the same time if computing ressources permit. Even simple personal -computers have several computing cores nowadays. If the computational model is run several times in the -same directory at the same time, all model runs would read the same parameter file and overwrite -the output of each other. + npars = 3 + lb = np.ones(npars) * (-np.pi) + ub = np.ones(npars) * np.pi + out = eee(ishigami1_wrap, lb, ub, ntfirst=10) -:func:`~partialwrap.exe_wrapper` concatenates an individual integer number to the function string -(or list, see :mod:`subprocess`), adds the integer to call of `parameterwrite` and of -`outputreader`, like: +Where the only difference to the Python version is that +`ishigami1_exe = ['./ishigami1.exe']` instead of +`ishigami1_exe = ['python3', 'ishigami1.py']`. -.. code-block:: python - pid = str(randst.randint()) - parameterwriter(parameterfile, x, *pargs, pid=pid, **pkwargs) - err = subprocess.check_output([func, pid]) - obj = outputreader(outputfile, *oargs, pid=pid, **okwargs) - os.remove(parameterfile+'.'+pid) - os.remove(outputfile+'.'+pid) +Parallel evaluation of external executables +^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ -The `parameterwriter` is assumed to write `parameterfile.pid` and the external model is assumed to -write `outputfile.pid`. Only these filenames are cleaned up by :func:`~partialwrap.exe_wrapper`. If -different filenames are used, the user has to clean up herself. +Elementary Effects run the computational model `nt * (npars + 1)` +times. All model runs are independent and can be executated at the +same time if computing ressources permit. Even simple personal +computers have several computing cores nowadays. -`ishiexe.py` would hence need to read the number from the command line: +However, using 4 worker with `processes=4`, for example, writes 4 +times `parameterfile = params.txt` thus overwriting itself. Here the +`pid` keyword of :mod:`partialwrap` comes in handy. Each invocation +would have its own random number `pid` associated, writing +`parameterfile.pid` and reading `outfile.pid`. The Ishigami-Homma +program would need to be changed to (the Python version here): .. code-block:: python - # File: ishiexe1.py - - # read pid if given - import sys - pid = None - if len(sys.argv) > 1: - pid = sys.argv[1] + # File: ishigami1_pid.py + import numpy as np + from partialwrap import standard_parameter_reader, standard_parameter_writer # Ishigami-Homma function a=b=1 - import numpy as np def ishigami1(x): return np.sin(x[0]) + np.sin(x[1])**2 + x[2]**4 * np.sin(x[0]) + # get pid + if len(sys.argv) > 1: + pid = int(sys.argv[1]) + else: + pid = None + # read parameters - from partialwrap import standard_parameter_reader - pfile = 'params.txt' - x = standard_parameter_reader(pfile, pid=pid) + x = standard_parameter_reader('params.txt', pid=pid) # calc function y = ishigami1(x) - # write objective - ofile = 'obj.txt' - if pid: - ofile = ofile+'.'+pid - with open(ofile, 'w') as ff: - print(y, file=ff) + # write output file + standard_parameter_writer('out.txt', pid=pid) -:func:`~partialwrap.exe_wrapper` would then be used with `'pid':True` and one can use several -parallel processes: +:func:`~partialwrap.std_io.standard_parameter_reader` and +:func:`~partialwrap.std_io.standard_parameter_writer` are convenience +functions that reads and writes parameters from a file just like +:func:`numpy.loadtxt` and :func:`numpy.savetxt`. The difference the +functions support the `pid` keyword. If `True`, +:func:`~partialwrap.std_io.standard_parameter_reader` reads from files +such as `params.txt.158398716` rather than from `params.txt`. To achieve this, the +`pid` keyword simply has to be set to *True* in the call of `partial`: .. code-block:: python - from partialwrap import exe_wrapper, standard_parameter_writer, standard_output_reader + from functools import partial + import numpy as np + import scipy.optimize as opt + from partialwrap import exe_wrapper + from partialwrap import standard_parameter_reader, standard_parameter_writer + from pyeee import eee + + ishigami1_exe = ['python3', 'ishigami1.py'] + parameterfile = 'params.txt' + parameterwriter = standard_parameter_writer + outputfile = 'out.txt' + outputreader = standard_parameter_reader + ishigami1_wrap = partial(exe_wrapper, ishigami1_exe, + parameterfile, parameterwriter, + outputfile, outputreader, + {'pid': True}) - ishi = ['python3', 'ishiexe1.py'] - parameterfile = 'params.txt' - outputfile = 'obj.txt' - func = partial(exe_wrapper, ishi, - parameterfile, standard_parameter_writer, - outputfile, standard_output_reader, {'pid':True}) npars = 3 - lb = np.ones(npars) * (-np.pi) - ub = np.ones(npars) * np.pi - out = ee(func, lb, ub, 10, processes=8) + lb = np.ones(npars) * (-np.pi) + ub = np.ones(npars) * np.pi + out = eee(ishigami1_wrap, lb, ub, ntfirst=10. processes=4) -If you cannot change your computational model, you can use, for example, a bash script that -launches each model run in a separate directory, like: -.. code-block:: bash +Using launch scripts +^^^^^^^^^^^^^^^^^^^^ - #!/bin/bash +If you cannot change your computational model to deal with `pid`, you +can use, for example, a `bash` script or a Python script that launches +each model run in a separate directory. A bash script would be +appropriate on Linux, of course, but a Python script work on Windows +as well. Here we give a Python script as an example but look at the +`User Guide`_ of :mod:`partialwrap` for an example of a `bash` script: - # File: ishiexe.sh +.. code-block:: python + + # File: run_ishigami1.py + import os + import shutil + import subprocess + import sys # get pid - pid=${1} + if len(sys.argv) > 1: + pid = sys.argv[1] + else: + pid = None + + exe = 'ishigami1.py' + pfile = 'params.txt' + ofile = 'out.txt' # make individual run directory - mkdir tmp.${pid} + if pid is None: + rundir = 'tmp' + else: + rundir = f'tmp.{pid}' + os.mkdir(rundir) - # run in individual directory - cp ishiexe.py tmp.${pid}/ - mv params.txt.${pid} tmp.${pid}/params.txt - cd tmp.${pid} - python ishiexe.py + # copy individual parameter file + if pid is None: + os.rename(f'{pfile}', f'{rundir}/{pfile}') + else: + os.rename(f'{pfile}.{pid}', f'{rundir}/{pfile}') - # make output available to pyeee - mv obj.txt ../obj.txt.${pid} + # run in individual directory + shutil.copyfile(exe, f'{rundir}/{exe}') + os.chdir(rundir) + err = subprocess.check_output(['python3', exe], + stderr=subprocess.STDOUT) + + # make output available to exe_wrapper + if pid is None: + os.rename(ofile, f'../{ofile}') + else: + os.rename(ofile, f'../{ofile}.{pid}') # clean up - cd .. - rm -r tmp.${pid} + os.chdir('..') + shutil.rmtree(rundir) -which would then be used: +Note: `exe = 'ishigami1.py'` rather than `exe = ishigami1_pid.py` here +because this example assumes that the executable cannot account for +the `pid` keyword. This Python script can be used with ``pyeee`` +exactly like all the scripts above: .. code-block:: python from functools import partial - from partialwrap import exe_wrapper, standard_parameter_writer, standard_output_reader - - ishi = './ishiexe.sh' - parameterfile = 'params.txt' - outputfile = 'obj.txt' - func = partial(exe_wrapper, ishi, - parameterfile, standard_parameter_writer, - outputfile, standard_output_reader, - {'pid':True, 'shell':True}) + import numpy as np + import scipy.optimize as opt + from partialwrap import exe_wrapper + from partialwrap import standard_parameter_reader, standard_parameter_writer + from pyeee import eee + + ishigami1_exe = ['python3', 'run_ishigami1.py'] + parameterfile = 'params.txt' + parameterwriter = standard_parameter_writer + outputfile = 'out.txt' + outputreader = standard_parameter_reader + ishigami1_wrap = partial(exe_wrapper, ishigami1_exe, + parameterfile, parameterwriter, + outputfile, outputreader, + {'pid': True}) + npars = 3 lb = np.ones(npars) * (-np.pi) ub = np.ones(npars) * np.pi - from pyjams import ee - out = ee(func, lb, ub, 10, processes=8) - -The `User Guide `_ of -:mod:`partialwrap` gives a similar script written in Python, which could be used if the bash shell is not available, for example on Windows. + out = eee(ishigami1_wrap, lb, ub, ntfirst=10. processes=4) That's all Folks! + + +.. _10.1002/2015WR016907: http://doi.org/10.1002/2015WR016907 +.. _10.1002/9780470725184: http://doi.org/10.1002/9780470725184 +.. _Cuntz, Mai et al.: http://doi.org/10.1002/2015WR016907 +.. _LICENSE: https://github.com/mcuntz/pyeee/LICENSE +.. _Sebastian Müller: https://github.com/MuellerSeb +.. _template: https://github.com/MuellerSeb/template +.. _User Guide: https://mcuntz.github.io/partialwrap/html/userguide.html diff --git a/docs/html/contents.html b/docs/html/contents.html index 87d7965..64b2e94 100644 --- a/docs/html/contents.html +++ b/docs/html/contents.html @@ -393,21 +393,20 @@

Contents
  • User Guide
      -
    • Elementary Effects
      diff --git a/docs/html/searchindex.js b/docs/html/searchindex.js index 091811e..33a2e57 100644 --- a/docs/html/searchindex.js +++ b/docs/html/searchindex.js @@ -1 +1 @@ -Search.setIndex({"docnames": ["authors", "changelog", "contents", "eee", "index", "package", "userguide"], "filenames": ["authors.rst", "changelog.rst", "contents.rst", "eee.rst", "index.rst", "package.rst", "userguide.rst"], "titles": ["Authors", "Changelog", "Contents", "pyeee.eee", "Quickstart", "pyeee API", "User Guide"], "terms": {"creat": 0, "octob": 0, "2019": [0, 4, 5], "matthia": [0, 3, 4, 5], "cuntz": [0, 3, 4, 5, 6], "It": [0, 4, 6], "i": [0, 1, 3, 4, 5, 6], "distribut": [0, 1, 2, 3, 4, 5], "under": [0, 3, 4], "mit": [0, 3, 4, 5], "licens": [0, 2, 3, 5], "see": [0, 1, 2, 3, 4, 5, 6], "file": [0, 1, 3, 4, 5, 6], "copyright": [0, 3, 4, 5], "c": [0, 3, 4, 6], "2024": [0, 1, 4, 5], "julian": [0, 4, 5], "mai": [0, 3, 4, 5, 6], "contributor": 0, "e": [0, 1, 3, 6], "mail": 0, "mc": [0, 3, 5], "macu": [0, 3, 5], "dot": [0, 1, 3, 5], "de": [0, 3, 5], "all": [1, 3, 5, 6], "notabl": 1, "chang": [1, 6], "after": [1, 6], "its": [1, 6], "initi": [1, 5, 6], "develop": [1, 6], "up": [1, 6], "januari": 1, "2020": [1, 3, 5], "v0": [1, 5], "2": [1, 3, 4, 5, 6], "ar": [1, 3, 6], "document": [1, 5], "thi": [1, 3, 6], "v4": [1, 5], "0": [1, 3, 4, 5, 6], "move": 1, "markdown": 1, "restructuredtext": 1, "sphinxbook": 1, "github": 1, "page": 1, "action": 1, "new": 1, "pip": [1, 4], "structur": [1, 4, 5], "us": [1, 3, 4, 5, 6], "pyproject": 1, "toml": 1, "v3": [1, 5], "oct": [1, 3, 5], "2021": [1, 3, 5], "pyjam": [1, 3, 4, 5, 6], "packag": [1, 3, 4, 5, 6], "remov": [1, 5, 6], "modul": [1, 3, 4, 5, 6], "function": [1, 2, 3, 5], "test": [1, 5], "doc": 1, "routin": 1, "now": 1, "from": [1, 2, 3, 4, 5], "travi": 1, "ci": 1, "org": [1, 6], "com": 1, "v2": [1, 5], "1": [1, 3, 4, 5, 6], "sep": [1, 5], "includ": [1, 3, 5, 6], "subpackag": [1, 2], "const": [1, 5], "automat": [1, 3], "build": 1, "pure": 1, "python": [1, 2, 3], "wheel": 1, "without": [1, 6], "cibuildwheel": 1, "jun": [1, 5], "partialwrap": [1, 3, 4, 5, 6], "docstr": [1, 3, 6], "util": [1, 5], "directori": [1, 5, 6], "tee": 1, "py": [1, 5, 6], "directli": 1, "pyeee": [1, 2, 6], "sync": 1, "jam": [1, 5, 6], "generalis": 1, "setup": [1, 5], "onli": [1, 3, 5, 6], "linux": 1, "travisci": [1, 5], "becaus": [1, 6], "were": [1, 6], "done": [1, 6], "v1": [1, 5], "apr": [1, 5], "sampl": [1, 2, 3, 5], "uniform": [1, 2, 3, 4, 5], "allow": [1, 3, 4, 5, 6], "scipi": [1, 3, 4, 5, 6], "stat": [1, 3, 5, 6], "morris_sampl": 1, "screen": [1, 2, 3, 4, 5], "eee": [1, 2, 4, 5, 6], "feb": [1, 3, 5], "make": [1, 3, 6], "number": [1, 3, 5, 6], "final": [1, 5, 6], "trajectori": [1, 3, 5, 6], "an": [1, 3, 6], "argument": [1, 2, 3, 5], "instead": [1, 5], "keyword": [1, 3, 5, 6], "ee": [1, 3, 4, 6], "default": [1, 3, 6], "10": [1, 3, 4, 6], "morri": [1, 3, 4, 5, 6], "method": [1, 3, 4, 5, 6], "restructur": [1, 5], "9": [1, 5], "ad": [1, 3, 5, 6], "mention": 1, "templat": [1, 4], "sebastian": [1, 4], "mueller": 1, "readm": 1, "md": 1, "renam": [1, 3, 5], "morris_method": [1, 5], "adjust": 1, "name": [1, 3, 5, 6], "elementary_effect": 1, "consist": [1, 3], "rest": 1, "8": [1, 5, 6], "split": [1, 5], "individu": [1, 5, 6], "one": [1, 3, 6], "per": [1, 5, 6], "valueerror": 1, "typeerror": 1, "given": [1, 3, 6], "ex": [1, 5, 6], "wrapper": [1, 2, 3, 5], "inputerror": 1, "doe": [1, 6], "exist": 1, "assertrais": 1, "check": [1, 3, 6], "error": [1, 5, 6], "handl": [1, 3, 5], "plot": [1, 3], "diagnost": 1, "figur": [1, 4], "png": [1, 6], "matplotlib": [1, 6], "instal": [1, 2, 6], "coverag": 1, "maximum": [1, 6], "except": [1, 6], "7": [1, 4, 5, 6], "systemat": [1, 5], "function_p": 1, "version": [1, 5], "logist": [1, 3], "deriv": 1, "keep": [1, 5], "format": [1, 4, 5, 6], "space": [1, 6], "sub_names_param": 1, "close": [1, 3, 6], "input": [1, 3], "befor": [1, 6], "rais": 1, "standard_parameter_reader_bounds_mask": [1, 6], "miss": [1, 6], "function_wrapp": [1, 3, 4, 6], "std_io": 1, "sa_test_funct": 1, "general_funct": 1, "6": [1, 3, 4, 5, 6], "did": [1, 6], "work": [1, 6], "put": 1, "pythonpath": 1, "shell": [1, 6], "script": [1, 6], "standard": [1, 6], "io": 1, "5": [1, 3, 4, 5, 6], "gener": [1, 3], "elementari": [1, 2, 3, 4, 5], "effect": [1, 2, 3, 4, 5], "sa": 1, "increas": 1, "ntstep": [1, 3], "nstep": [1, 3, 6], "logfil": [1, 3, 6], "string": [1, 3, 6], "rather": [1, 3, 6], "than": [1, 2], "independ": [1, 6], "replac": [1, 6], "kwarg": [1, 3, 4, 5, 6], "pop": 1, "mechan": [1, 6], "subsequ": [1, 6], "call": [1, 3, 4, 6], "4": [1, 3, 4, 5, 6], "jan": [1, 3, 5], "second": [1, 5, 6], "releas": [1, 3, 5], "onlin": 1, "simpli": [1, 4, 6], "trigger": [1, 5], "zenodo": [1, 5], "first": [1, 3, 5, 6], "numpi": [1, 3, 4, 5, 6], "matrix": 1, "arithmet": [1, 3, 6], "ndarrai": [1, 3, 4, 6], "deprec": [1, 5], "warn": [1, 5], "anymor": [1, 6], "3": [1, 3, 4, 5, 6], "sever": [1, 3, 4, 6], "process": [1, 2, 3], "seed": [1, 3, 4, 6], "distinguish": [1, 3, 4, 6], "iter": [1, 3], "array_lik": [1, 3], "paramet": [1, 2, 3, 5], "type": [1, 3], "verbos": [1, 3], "quick": [1, 2], "usag": [1, 2], "guid": [1, 2], "correct": 1, "descript": 1, "set": [1, 6], "statu": 1, "beta": 1, "pypi": [1, 5], "quickstart": 2, "about": [2, 6], "simpl": 2, "extra": 2, "requir": [2, 3], "index": 2, "tabl": 2, "user": [2, 4], "exclud": [2, 3], "calcul": [2, 4], "parallel": [2, 4], "model": [2, 3, 4, 5], "evalu": [2, 3, 4], "addit": 2, "other": [2, 3, 4], "effici": [2, 3, 4, 5], "sequenti": [2, 3, 4, 5], "extern": [2, 4], "comput": [2, 4, 5], "execut": [2, 3, 4], "further": 2, "api": 2, "purpos": 2, "changelog": 2, "author": [2, 5], "extens": [3, 4, 5, 6], "et": [3, 4, 5, 6], "al": [3, 4, 5, 6], "water": [3, 4, 5, 6], "re": [3, 4, 5], "research": [3, 4, 5, 6], "2015": [3, 4, 5, 6], "wa": [3, 6], "written": [3, 5, 6], "while": 3, "institut": 3, "nation": 3, "recherch": 3, "pour": 3, "l": 3, "agricultur": 3, "aliment": 3, "environn": 3, "inra": 3, "nanci": 3, "franc": 3, "2017": 3, "detail": [3, 4, 5], "The": [3, 4, 6], "follow": [3, 4, 6], "provid": [3, 4, 5, 6], "histori": [3, 5], "nov": 3, "weight": [3, 6], "option": [3, 6], "2018": 3, "plotfil": [3, 6], "made": 3, "sphinx": 3, "compat": 3, "x0": [3, 6], "thean": 3, "mar": 3, "flake8": 3, "func": [3, 4, 6], "arg": [3, 4, 5, 6], "sourc": 3, "note": [3, 6], "must": [3, 4, 6], "callabl": [3, 6], "x": [3, 4, 6], "lb": [3, 4, 6], "lower": [3, 4, 6], "bound": [3, 6], "fraction": 3, "percent": [3, 6], "point": [3, 6], "ppf": [3, 6], "Be": 3, "awar": 3, "most": [3, 6], "continu": [3, 6], "infinit": [3, 6], "ub": [3, 4, 6], "upper": [3, 4, 6], "valu": [3, 6], "mask": [3, 6], "true": [3, 4, 6], "fals": [3, 4, 6], "ntfirst": [3, 4, 6], "int": [3, 6], "step": [3, 6], "ntlast": [3, 6], "last": [3, 6], "interv": 3, "each": [3, 6], "dist": [3, 6], "list": [3, 6], "none": [3, 6], "object": [3, 6], "factor": 3, "have": [3, 5, 6], "invers": [3, 6], "cdf": [3, 6], "If": [3, 6], "loc": [3, 6], "scale": [3, 6], "distparam": [3, 6], "mean": [3, 6], "b": [3, 4, 6], "correspond": [3, 6], "tupl": [3, 6], "locat": 3, "least": 3, "implement": [3, 6], "shape": [3, 6], "gamma": [3, 6], "henc": [3, 6], "g": [3, 6], "ignor": 3, "like": [3, 6], "boolean": 3, "mu": [3, 4, 6], "ha": [3, 6], "multipl": 3, "output": [3, 6], "time": [3, 4, 6], "seri": [3, 6], "return": [3, 4, 6], "sd": 3, "": [3, 4, 6], "random": [3, 4, 6], "optin": 3, "constraint": 3, "pool": [3, 6], "schwimmbad": [3, 4, 6], "map": 3, "which": [3, 4, 6], "serial": [3, 6], "multiprocessor": 3, "mpi": [3, 4, 6], "chosen": 3, "choose_pool": [3, 6], "can": [3, 4, 6], "open": [3, 6], "onc": 3, "you": [3, 6], "want": [3, 6], "program": [3, 4, 6], "choos": [3, 6], "pass": [3, 4, 6], "later": 3, "print": [3, 4, 6], "progress": 3, "report": 3, "dure": [3, 4, 6], "possibl": [3, 6], "log": [3, 6], "fit": [3, 6], "produc": [3, 6], "len": [3, 6], "inform": [3, 4, 6], "uninform": [3, 4], "exampl": [3, 4, 6], "functool": [3, 4, 6], "import": [3, 4, 6], "partial": [3, 4, 6], "np": [3, 4, 6], "1234": 3, "npar": [3, 4, 6], "param": [3, 6], "78": 3, "12": 3, "97": 3, "33": 3, "obj": [3, 6], "zero": 3, "ones": [3, 4, 6], "out": [3, 4, 6], "where": [3, 4, 6], "librari": [4, 6], "perform": [4, 6], "so": [4, 6], "publish": [4, 6], "computation": [4, 6], "inexpens": [4, 6], "identif": [4, 6], "noninform": [4, 6], "resourc": [4, 6], "51": [4, 6], "6417": [4, 6], "6441": [4, 6], "doi": [4, 6], "1002": [4, 6], "2015wr016907": [4, 6], "also": [4, 6], "multiprocess": [4, 6], "via": [4, 6], "messag": [4, 6], "interfac": [4, 6], "mpi4pi": [4, 6], "consid": [4, 6], "ishigami": [4, 6], "homma": [4, 6], "y": [4, 6], "sin": [4, 6], "x_0": [4, 6], "x_1": [4, 6], "x_2": [4, 6], "take": [4, 5, 6], "give": [4, 6], "def": [4, 6], "ishigami1": [4, 6], "three": [4, 6], "paramt": 4, "between": [4, 6], "pi": [4, 6], "boundari": [4, 6], "1023": [4, 6], "reproduc": [4, 6], "1f": [4, 6], "173": 4, "61": 4, "logic": 4, "form": [4, 6], "For": [4, 6], "call_func_ab": [4, 6], "partialis": [4, 6], "fix": [4, 5, 6], "speak": 4, "alreadi": [4, 6], "definit": [4, 6], "well": [4, 6], "we": [4, 6], "recommend": [4, 6], "our": 4, "easi": 4, "A": [4, 6], "trivial": 4, "abov": [4, 6], "wrap": 4, "func_wrapp": 4, "easiest": 4, "wai": 4, "project": 4, "base": 4, "m\u00fcller": 4, "rst": 5, "commit": 5, "clean": [5, 6], "minor": 5, "todo": 5, "bug": 5, "logistic_p": 5, "substitut": 5, "small": [5, 6], "adapt": 5, "common": [5, 6], "o": [5, 6], "modernis": 5, "code": [5, 6], "numer": 6, "respect": 6, "ani": 6, "One": 6, "mcuntz": 6, "jams_python": 6, "hesseflux": 6, "synchronis": 6, "irregularli": 6, "20": 6, "absolut": 6, "over": 6, "nt": 6, "deviat": 6, "sigma": 6, "sensititv": 6, "measur": 6, "http": 6, "en": 6, "wikipedia": 6, "wiki": 6, "elementary_effects_method": 6, "saltelli": 6, "2007": 6, "global": 6, "sensit": 6, "analysi": 6, "primer": 6, "john": 6, "wilei": 6, "son": 6, "ltd": 6, "chichest": 6, "uk": 6, "isbn": 6, "978": 6, "0470": 6, "059": 6, "975": 6, "9780470725184": 6, "212": 6, "102": 6, "mandatori": 6, "relev": 6, "along": 6, "ntotal": 6, "total": 6, "differ": 6, "max": 6, "ident": 6, "offer": 6, "some": 6, "thei": 6, "init": 6, "taken": 6, "could": 6, "size": 6, "even": 6, "element": 6, "dtype": 6, "bool": 6, "1024": 6, "100": 6, "114": 6, "26": 6, "nproc": 6, "parallelis": 6, "enabl": 6, "switch": 6, "easili": 6, "local": 6, "deploy": 6, "cluster": 6, "supercomput": 6, "joblib": 6, "eeetest": 6, "get": 6, "sy": 6, "argv": 6, "els": 6, "depend": 6, "try": 6, "comm": 6, "comm_world": 6, "csize": 6, "get_siz": 6, "crank": 6, "get_rank": 6, "importerror": 6, "ipool": 6, "run": 6, "mpiexec": 6, "n": 6, "latter": 6, "need": 6, "variabl": 6, "start": 6, "when": 6, "finish": 6, "dict": 6, "To": 6, "function_mask_wrapp": 6, "Then": 6, "remain": 6, "non": 6, "rememb": 6, "through": 6, "assum": 6, "uniformli": 6, "p": 6, "might": 6, "been": 6, "determin": 6, "repeat": 6, "experi": 6, "overlin": 6, "epsilon_p": 6, "actual": 6, "would": 6, "thu": 6, "normal": 6, "cumul": 6, "limit": 6, "sai": 6, "gaussian": 6, "around": 6, "81": 6, "plu": 6, "minu": 6, "99": 6, "0015": 6, "003": 6, "9985": 6, "norm": 6, "show": 6, "almost": 6, "Their": 6, "NOT": 6, "combin": 6, "origin": 6, "full": 6, "preliminari": 6, "fewer": 6, "optimis": 6, "larg": 6, "expens": 6, "area": 6, "certain": 6, "becom": 6, "typic": 6, "literatur": 6, "order": 6, "ten": 6, "hundr": 6, "500": 6, "5000": 6, "50": 6, "insensit": 6, "idea": 6, "know": 6, "probabl": 6, "influenti": 6, "anoth": 6, "discard": 6, "found": 6, "less": 6, "algorithm": 6, "end": 6, "yield": 6, "assur": 6, "littl": 6, "minim": 6, "part": 6, "due": 6, "veri": 6, "similar": 6, "unc": 6, "1025": 6, "being": 6, "logical_and": 6, "incom": 6, "dimens": 6, "updat": 6, "either": 6, "appropri": 6, "singl": 6, "equal": 6, "river": 6, "runoff": 6, "high": 6, "flow": 6, "flood": 6, "low": 6, "drought": 6, "both": 6, "circumst": 6, "flux": 6, "atmospher": 6, "evapotranspir": 6, "more": 6, "strongli": 6, "influenc": 6, "larger": 6, "period": 6, "exchang": 6, "interest": 6, "argu": 6, "equival": 6, "variat": 6, "varianc": 6, "same": 6, "again": 6, "section": 6, "pretti": 6, "much": 6, "repetit": 6, "notion": 6, "better": 6, "explain": 6, "write": 6, "read": 6, "result": 6, "parameterwrit": 6, "parameterfil": 6, "err": 6, "subprocess": 6, "check_output": 6, "outputread": 6, "outputfil": 6, "That": 6, "simplic": 6, "ishiex": 6, "txt": 6, "standard_parameter_read": 6, "pfile": 6, "calc": 6, "ofil": 6, "w": 6, "ff": 6, "command": 6, "line": 6, "exe_wrapp": 6, "standard_parameter_writ": 6, "standard_output_read": 6, "ishi": 6, "conveni": 6, "header": 6, "empti": 6, "dictionari": 6, "below": 6, "imagin": 6, "compil": 6, "fortran": 6, "alik": 6, "exe_mask_wrapp": 6, "alwai": 6, "python3": 6, "str": 6, "kei": 6, "debug": 6, "check_cal": 6, "precis": 6, "stdout": 6, "especi": 6, "occur": 6, "parg": 6, "pkwarg": 6, "them": 6, "five": 6, "identifi": 6, "current": 6, "minimum": 6, "min": 6, "1415": 6, "case": 6, "Or": 6, "exclus": 6, "namelist": 6, "search": 6, "left": 6, "hand": 6, "side": 6, "sign": 6, "right": 6, "look": 6, "x1": 6, "x2": 6, "sub_params_nam": 6, "sub_params_names_ignorecas": 6, "pname": 6, "pid": 6, "next": 6, "wrong": 6, "state": 6, "oarg": 6, "okwarg": 6, "And": 6, "achiev": 6, "ressourc": 6, "permit": 6, "person": 6, "core": 6, "nowadai": 6, "overwrit": 6, "concaten": 6, "integ": 6, "add": 6, "randst": 6, "randint": 6, "filenam": 6, "herself": 6, "ishiexe1": 6, "cannot": 6, "your": 6, "bash": 6, "launch": 6, "separ": 6, "bin": 6, "sh": 6, "mkdir": 6, "tmp": 6, "cp": 6, "mv": 6, "cd": 6, "avail": 6, "rm": 6, "r": 6, "window": 6, "folk": 6}, "objects": {"": [[5, 0, 0, "-", "pyeee"]], "pyeee": [[3, 0, 0, "-", "eee"]], "pyeee.eee": [[3, 1, 1, "", "eee"], [3, 1, 1, "", "see"]]}, "objtypes": {"0": "py:module", "1": "py:function"}, "objnames": {"0": ["py", "module", "Python module"], "1": ["py", "function", "Python function"]}, "titleterms": {"author": 0, "changelog": 1, "content": 2, "pyeee": [3, 4, 5], "eee": 3, "quickstart": 4, "about": 4, "quick": 4, "usag": 4, "guid": [4, 6], "simpl": [4, 6], "python": [4, 6], "function": [4, 6], "extra": 4, "paramet": [4, 6], "wrapper": [4, 6], "instal": 4, "requir": 4, "licens": 4, "index": 4, "tabl": 4, "api": 5, "purpos": 5, "subpackag": 5, "user": 6, "elementari": 6, "effect": 6, "exclud": 6, "from": 6, "calcul": 6, "parallel": 6, "model": 6, "evalu": 6, "addit": 6, "sampl": 6, "other": 6, "distribut": 6, "than": 6, "uniform": 6, "effici": 6, "sequenti": 6, "extern": 6, "comput": 6, "execut": 6, "screen": 6, "argument": 6, "further": 6, "process": 6}, "envversion": {"sphinx.domains.c": 3, "sphinx.domains.changeset": 1, "sphinx.domains.citation": 1, "sphinx.domains.cpp": 9, "sphinx.domains.index": 1, "sphinx.domains.javascript": 3, "sphinx.domains.math": 2, "sphinx.domains.python": 4, "sphinx.domains.rst": 2, "sphinx.domains.std": 2, "sphinx.ext.intersphinx": 1, "sphinx.ext.viewcode": 1, "sphinx": 60}, "alltitles": {"Authors": [[0, "authors"]], "Changelog": [[1, "changelog"]], "Contents": [[2, "contents"]], "pyeee.eee": [[3, "module-pyeee.eee"]], "Quickstart": [[4, "quickstart"]], "About pyeee": [[4, "about-pyeee"]], "Quick usage guide": [[4, "quick-usage-guide"]], "Simple Python function": [[4, "simple-python-function"]], "Python function with extra parameters": [[4, "python-function-with-extra-parameters"]], "Function wrappers": [[4, "function-wrappers"]], "Installation": [[4, "installation"]], "Requirements": [[4, "requirements"]], "License": [[4, "license"]], "Index and Tables": [[4, "index-and-tables"]], "pyeee API": [[5, "module-pyeee"]], "Purpose": [[5, "purpose"]], "Subpackages": [[5, "subpackages"]], "User Guide": [[6, "user-guide"]], "Elementary Effects": [[6, "elementary-effects"]], "Simple Python functions": [[6, "simple-python-functions"]], "Exclude parameters from calculations": [[6, "exclude-parameters-from-calculations"]], "Parallel model evaluation": [[6, "parallel-model-evaluation"]], "Python functions with additional parameters": [[6, "python-functions-with-additional-parameters"]], "Sampling parameters with other distributions than the uniform distribution": [[6, "sampling-parameters-with-other-distributions-than-the-uniform-distribution"]], "Efficient/Sequential Elementary Effects": [[6, "efficient-sequential-elementary-effects"]], "External computer models": [[6, "external-computer-models"]], "Simple executables": [[6, "simple-executables"]], "Exclude parameters from screening": [[6, "exclude-parameters-from-screening"]], "Additional arguments for external executables": [[6, "additional-arguments-for-external-executables"]], "Further arguments of wrappers": [[6, "further-arguments-of-wrappers"]], "Parallel processing of external executables": [[6, "parallel-processing-of-external-executables"]]}, "indexentries": {"eee() (in module pyeee.eee)": [[3, "pyeee.eee.eee"]], "module": [[3, "module-pyeee.eee"], [5, "module-pyeee"]], "pyeee.eee": [[3, "module-pyeee.eee"]], "see() (in module pyeee.eee)": [[3, "pyeee.eee.see"]], "pyeee": [[5, "module-pyeee"]]}}) \ No newline at end of file +Search.setIndex({"docnames": ["authors", "changelog", "contents", "eee", "index", "package", "userguide"], "filenames": ["authors.rst", "changelog.rst", "contents.rst", "eee.rst", "index.rst", "package.rst", "userguide.rst"], "titles": ["Authors", "Changelog", "Contents", "pyeee.eee", "Quickstart", "pyeee API", "User Guide"], "terms": {"creat": 0, "octob": 0, "2019": [0, 4, 5], "matthia": [0, 3, 4, 5], "cuntz": [0, 3, 4, 5, 6], "It": [0, 4, 6], "i": [0, 1, 3, 4, 5, 6], "distribut": [0, 1, 2, 3, 4, 5], "under": [0, 3, 4], "mit": [0, 3, 4, 5], "licens": [0, 2, 3, 5], "see": [0, 1, 2, 3, 4, 5, 6], "file": [0, 1, 3, 4, 5, 6], "copyright": [0, 3, 4, 5], "c": [0, 3, 4, 6], "2024": [0, 1, 4, 5], "julian": [0, 4, 5], "mai": [0, 3, 4, 5, 6], "contributor": 0, "e": [0, 1, 3, 6], "mail": 0, "mc": [0, 3, 5], "macu": [0, 3, 5], "dot": [0, 1, 3, 5], "de": [0, 3, 5], "all": [1, 3, 5, 6], "notabl": 1, "chang": [1, 6], "after": [1, 6], "its": [1, 6], "initi": [1, 2, 5], "develop": [1, 6], "up": [1, 6], "januari": 1, "2020": [1, 3, 5], "v0": [1, 5], "2": [1, 3, 4, 5, 6], "ar": [1, 3, 6], "document": [1, 5], "thi": [1, 3, 6], "v4": [1, 5], "0": [1, 3, 4, 5, 6], "move": 1, "markdown": 1, "restructuredtext": 1, "sphinxbook": 1, "github": 1, "page": 1, "action": [1, 6], "new": 1, "pip": [1, 4], "structur": [1, 4, 5], "us": [1, 2, 3, 4, 5], "pyproject": 1, "toml": 1, "v3": [1, 5], "oct": [1, 3, 5], "2021": [1, 3, 5], "pyjam": [1, 3, 4, 5, 6], "packag": [1, 3, 4, 5, 6], "remov": [1, 5], "modul": [1, 3, 4, 5, 6], "function": [1, 2, 3, 5], "test": [1, 5], "doc": 1, "routin": 1, "now": 1, "from": [1, 2, 3, 4, 5], "travi": 1, "ci": 1, "org": [1, 6], "com": 1, "v2": [1, 5], "1": [1, 3, 4, 5, 6], "sep": [1, 5], "includ": [1, 3, 5, 6], "subpackag": [1, 2], "const": [1, 5], "automat": [1, 3], "build": 1, "pure": 1, "python": [1, 2, 3], "wheel": 1, "without": [1, 6], "cibuildwheel": 1, "jun": [1, 5], "partialwrap": [1, 3, 4, 5, 6], "docstr": [1, 3], "util": [1, 5], "directori": [1, 5, 6], "tee": 1, "py": [1, 5, 6], "directli": 1, "pyeee": [1, 2, 6], "sync": 1, "jam": [1, 5], "generalis": 1, "setup": [1, 5], "onli": [1, 3, 5, 6], "linux": [1, 6], "travisci": [1, 5], "becaus": [1, 6], "were": [1, 6], "done": [1, 6], "v1": [1, 5], "apr": [1, 5], "sampl": [1, 2, 3, 5], "uniform": [1, 2, 3, 4, 5], "allow": [1, 3, 4, 5, 6], "scipi": [1, 3, 4, 5, 6], "stat": [1, 3, 5, 6], "morris_sampl": 1, "screen": [1, 2, 3, 4, 5], "eee": [1, 2, 4, 5, 6], "feb": [1, 3, 5], "make": [1, 3, 6], "number": [1, 3, 5, 6], "final": [1, 5, 6], "trajectori": [1, 3, 5, 6], "an": [1, 3, 6], "argument": [1, 3, 5, 6], "instead": [1, 5, 6], "keyword": [1, 3, 5, 6], "ee": [1, 3, 4, 6], "default": [1, 3], "10": [1, 3, 4, 6], "morri": [1, 3, 4, 5, 6], "method": [1, 3, 4, 5, 6], "restructur": [1, 5], "9": [1, 5], "ad": [1, 3, 5], "mention": 1, "templat": [1, 4], "sebastian": [1, 4], "mueller": 1, "readm": 1, "md": 1, "renam": [1, 3, 5, 6], "morris_method": [1, 5], "adjust": 1, "name": [1, 3, 5, 6], "elementary_effect": 1, "consist": [1, 3], "rest": 1, "8": [1, 5], "split": [1, 5], "individu": [1, 5, 6], "one": [1, 3, 6], "per": [1, 5, 6], "valueerror": 1, "typeerror": 1, "given": [1, 3, 6], "ex": [1, 5, 6], "wrapper": [1, 2, 3, 5, 6], "inputerror": 1, "doe": [1, 6], "exist": 1, "assertrais": 1, "check": [1, 2, 3], "error": [1, 5, 6], "handl": [1, 3, 5], "plot": [1, 3], "diagnost": 1, "figur": [1, 4, 6], "png": [1, 6], "matplotlib": [1, 6], "instal": [1, 2, 6], "coverag": 1, "maximum": 1, "except": [1, 6], "7": [1, 4, 5, 6], "systemat": [1, 5], "function_p": 1, "version": [1, 5, 6], "logist": [1, 3, 6], "deriv": 1, "keep": [1, 5], "format": [1, 4, 5, 6], "space": [1, 6], "sub_names_param": 1, "close": [1, 3, 6], "input": [1, 3], "befor": 1, "rais": 1, "standard_parameter_reader_bounds_mask": 1, "miss": [1, 6], "function_wrapp": [1, 3, 4], "std_io": 1, "sa_test_funct": 1, "general_funct": 1, "6": [1, 3, 4, 5, 6], "did": [1, 6], "work": [1, 6], "put": 1, "pythonpath": 1, "shell": 1, "script": [1, 2], "standard": [1, 6], "io": [1, 6], "5": [1, 3, 4, 5, 6], "gener": [1, 3], "elementari": [1, 2, 3, 4, 5], "effect": [1, 2, 3, 4, 5], "sa": 1, "increas": 1, "ntstep": [1, 3], "nstep": [1, 3], "logfil": [1, 3, 6], "string": [1, 3], "rather": [1, 3, 6], "than": [1, 2], "independ": [1, 6], "replac": 1, "kwarg": [1, 3, 4, 5], "pop": 1, "mechan": 1, "subsequ": [1, 6], "call": [1, 3, 4, 6], "4": [1, 3, 4, 5, 6], "jan": [1, 3, 5], "second": [1, 5, 6], "releas": [1, 3, 5], "onlin": 1, "simpli": [1, 4, 6], "trigger": [1, 5], "zenodo": [1, 5], "first": [1, 3, 5, 6], "numpi": [1, 3, 4, 5, 6], "matrix": 1, "arithmet": [1, 3, 6], "ndarrai": [1, 3, 4, 6], "deprec": [1, 5], "warn": [1, 5], "anymor": [1, 6], "3": [1, 3, 4, 5, 6], "sever": [1, 3, 4, 6], "process": [1, 3, 6], "seed": [1, 3, 4, 6], "distinguish": [1, 3, 4, 6], "iter": [1, 3], "array_lik": [1, 3], "paramet": [1, 2, 3, 5], "type": [1, 3], "verbos": [1, 3], "quick": [1, 2], "usag": [1, 2], "guid": [1, 2], "correct": 1, "descript": 1, "set": [1, 6], "statu": [1, 6], "beta": 1, "pypi": [1, 5], "quickstart": 2, "about": [2, 6], "simpl": [2, 6], "extra": 2, "requir": [2, 3], "index": 2, "tabl": 2, "user": [2, 4], "effici": [2, 3, 4, 5], "sequenti": [2, 3, 4, 5], "fit": [2, 3], "log": [2, 3], "exclud": [2, 3], "calcul": [2, 4], "multipl": [2, 3], "output": [2, 3], "parallel": [2, 4], "model": [2, 3, 4, 5], "evalu": [2, 3, 4], "other": [2, 3, 4], "extern": [2, 4], "comput": [2, 4, 5], "execut": [2, 3, 4], "launch": 2, "api": 2, "purpos": 2, "changelog": 2, "author": [2, 5], "extens": [3, 4, 5, 6], "et": [3, 4, 5, 6], "al": [3, 4, 5, 6], "water": [3, 4, 5, 6], "re": [3, 4, 5], "research": [3, 4, 5, 6], "2015": [3, 4, 5, 6], "wa": [3, 6], "written": [3, 5, 6], "while": [3, 6], "institut": 3, "nation": 3, "recherch": 3, "pour": 3, "l": 3, "agricultur": 3, "aliment": 3, "environn": 3, "inra": 3, "nanci": 3, "franc": 3, "2017": 3, "detail": [3, 4, 5], "The": [3, 4, 6], "follow": [3, 4, 6], "provid": [3, 4, 5, 6], "histori": [3, 5], "nov": 3, "weight": [3, 6], "option": [3, 6], "2018": 3, "plotfil": [3, 6], "made": 3, "sphinx": 3, "compat": 3, "x0": [3, 6], "thean": 3, "mar": 3, "flake8": 3, "func": [3, 4, 6], "arg": [3, 4, 5], "sourc": 3, "note": [3, 6], "must": [3, 4, 6], "callabl": [3, 6], "x": [3, 4, 6], "lb": [3, 4, 6], "lower": [3, 4, 6], "bound": [3, 6], "fraction": 3, "percent": [3, 6], "point": [3, 6], "ppf": [3, 6], "Be": 3, "awar": 3, "most": [3, 6], "continu": [3, 6], "infinit": [3, 6], "ub": [3, 4, 6], "upper": [3, 4, 6], "valu": [3, 6], "mask": [3, 6], "true": [3, 4, 6], "fals": [3, 4, 6], "ntfirst": [3, 4, 6], "int": [3, 6], "step": [3, 6], "ntlast": [3, 6], "last": [3, 6], "interv": 3, "each": [3, 6], "dist": [3, 6], "list": [3, 6], "none": [3, 6], "object": [3, 6], "factor": 3, "have": [3, 5, 6], "invers": [3, 6], "cdf": [3, 6], "If": [3, 6], "loc": [3, 6], "scale": [3, 6], "distparam": [3, 6], "mean": [3, 6], "b": [3, 4, 6], "correspond": [3, 6], "tupl": [3, 6], "locat": 3, "least": 3, "implement": [3, 6], "shape": [3, 6], "gamma": [3, 6], "henc": [3, 6], "g": [3, 6], "ignor": 3, "like": [3, 6], "boolean": 3, "mu": [3, 4, 6], "ha": [3, 6], "time": [3, 4, 6], "seri": [3, 6], "return": [3, 4, 6], "sd": 3, "": [3, 4, 6], "random": [3, 4, 6], "optin": 3, "constraint": 3, "pool": [3, 6], "schwimmbad": [3, 4, 6], "map": 3, "which": [3, 4, 6], "serial": [3, 6], "multiprocessor": 3, "mpi": [3, 4, 6], "chosen": 3, "choose_pool": [3, 6], "can": [3, 4, 6], "open": [3, 6], "onc": 3, "you": [3, 6], "want": [3, 6], "program": [3, 4, 6], "choos": [3, 6], "pass": [3, 4, 6], "later": 3, "print": [3, 4, 6], "progress": [3, 6], "report": 3, "dure": [3, 4, 6], "possibl": [3, 6], "produc": [3, 6], "len": [3, 6], "inform": [3, 4, 6], "uninform": [3, 4, 6], "exampl": [3, 4, 6], "functool": [3, 4, 6], "import": [3, 4, 6], "partial": [3, 4, 6], "np": [3, 4, 6], "1234": 3, "npar": [3, 4, 6], "param": [3, 6], "78": 3, "12": 3, "97": 3, "33": 3, "obj": 3, "zero": 3, "ones": [3, 4, 6], "out": [3, 4, 6], "where": [3, 4, 6], "librari": [4, 6], "perform": [4, 6], "so": [4, 6], "publish": [4, 6], "computation": [4, 6], "inexpens": [4, 6], "identif": [4, 6], "noninform": [4, 6], "resourc": [4, 6], "51": [4, 6], "6417": [4, 6], "6441": [4, 6], "doi": [4, 6], "1002": [4, 6], "2015wr016907": [4, 6], "also": [4, 6], "multiprocess": [4, 6], "via": [4, 6], "messag": [4, 6], "interfac": [4, 6], "mpi4pi": [4, 6], "consid": [4, 6], "ishigami": [4, 6], "homma": [4, 6], "y": [4, 6], "sin": [4, 6], "x_0": [4, 6], "x_1": [4, 6], "x_2": [4, 6], "take": [4, 5, 6], "give": [4, 6], "def": [4, 6], "ishigami1": [4, 6], "three": [4, 6], "paramt": 4, "between": [4, 6], "pi": [4, 6], "boundari": [4, 6], "1023": [4, 6], "reproduc": [4, 6], "1f": [4, 6], "173": 4, "61": 4, "logic": 4, "form": [4, 6], "For": [4, 6], "call_ishigami": [4, 6], "partialis": [4, 6], "fix": [4, 5, 6], "speak": [4, 6], "alreadi": [4, 6], "definit": [4, 6], "well": [4, 6], "we": [4, 6], "recommend": 4, "our": [4, 6], "easi": 4, "A": [4, 6], "trivial": 4, "abov": [4, 6], "wrap": 4, "func_wrapp": 4, "easiest": 4, "wai": 4, "project": 4, "base": 4, "m\u00fcller": 4, "rst": 5, "commit": 5, "clean": [5, 6], "minor": 5, "todo": 5, "bug": 5, "logistic_p": 5, "substitut": 5, "small": [5, 6], "adapt": 5, "common": 5, "o": [5, 6], "modernis": 5, "code": [5, 6], "numer": 6, "ani": 6, "One": 6, "20": 6, "72": 6, "14": 6, "being": 6, "absolut": 6, "over": 6, "sensit": 6, "measur": 6, "http": 6, "en": 6, "wikipedia": 6, "wiki": 6, "elementary_effects_method": 6, "saltelli": 6, "2007": 6, "global": 6, "analysi": 6, "primer": 6, "john": 6, "wilei": 6, "son": 6, "ltd": 6, "chichest": 6, "uk": 6, "isbn": 6, "978": 6, "0470": 6, "059": 6, "975": 6, "9780470725184": 6, "full": 6, "sensititv": 6, "preliminari": 6, "fewer": 6, "need": 6, "optimis": 6, "nt": 6, "larg": 6, "might": 6, "expens": 6, "area": 6, "certain": 6, "becom": 6, "typic": 6, "literatur": 6, "order": 6, "ten": 6, "hundr": 6, "500": 6, "5000": 6, "50": 6, "insensit": 6, "idea": 6, "know": 6, "further": 6, "probabl": 6, "influenti": 6, "anoth": 6, "discard": 6, "save": 6, "start": 6, "limit": 6, "found": 6, "less": 6, "algorithm": 6, "end": 6, "yield": 6, "assur": 6, "littl": 6, "minim": 6, "part": 6, "due": 6, "ident": 6, "veri": 6, "similar": 6, "1025": 6, "combin": 6, "logical_and": 6, "incom": 6, "determin": 6, "threshold": 6, "shorter": 6, "alwai": 6, "same": 6, "intermedi": 6, "result": 6, "text": 6, "offer": 6, "some": 6, "thei": 6, "init": 6, "taken": 6, "could": 6, "opposit": 6, "arrai": 6, "size": 6, "even": 6, "element": 6, "dtype": 6, "bool": 6, "1024": 6, "run": 6, "either": 6, "sigma": 6, "appropri": 6, "singl": 6, "equal": 6, "river": 6, "runoff": 6, "high": 6, "flow": 6, "flood": 6, "low": 6, "drought": 6, "both": 6, "circumst": 6, "flux": 6, "atmospher": 6, "evapotranspir": 6, "more": 6, "strongli": 6, "influenc": 6, "larger": 6, "period": 6, "exchang": 6, "interest": 6, "argu": 6, "deviat": 6, "equival": 6, "variat": 6, "varianc": 6, "smaller": 6, "nproc": 6, "parallelis": 6, "enabl": 6, "switch": 6, "easili": 6, "local": 6, "deploy": 6, "cluster": 6, "supercomput": 6, "joblib": 6, "eeetest": 6, "sy": 6, "get": 6, "argv": 6, "els": 6, "depend": 6, "try": 6, "comm": 6, "comm_world": 6, "csize": 6, "get_siz": 6, "crank": 6, "get_rank": 6, "importerror": 6, "ipool": 6, "processor": 6, "command": 6, "line": 6, "ncpu": 6, "normal": 6, "mode": 6, "explicitli": 6, "should": 6, "core": 6, "Or": 6, "mpiexec": 6, "n": 6, "along": 6, "through": 6, "assum": 6, "uniformli": 6, "p": 6, "been": 6, "repeat": 6, "experi": 6, "overlin": 6, "epsilon_p": 6, "actual": 6, "would": 6, "thu": 6, "mod": 6, "cumul": 6, "sai": 6, "gaussian": 6, "around": 6, "81": 6, "plu": 6, "minu": 6, "99": 6, "total": 6, "0015": 6, "003": 6, "9985": 6, "norm": 6, "show": 6, "almost": 6, "Their": 6, "NOT": 6, "rememb": 6, "origin": 6, "intern": 6, "consequ": 6, "variabl": 6, "finish": 6, "section": 6, "pretti": 6, "much": 6, "repetit": 6, "itself": 6, "finer": 6, "notion": 6, "better": 6, "explain": 6, "compil": 6, "languag": 6, "fortran": 6, "basic": 6, "subprocess": 6, "write": 6, "read": 6, "parameterwrit": 6, "parameterfil": 6, "outputfil": 6, "outputread": 6, "latter": 6, "do": 6, "txt": 6, "simplic": 6, "loadtxt": 6, "calc": 6, "savetxt": 6, "python3": 6, "exe_wrapp": 6, "optim": 6, "opt": 6, "ishigami1_ex": 6, "ishigami1_wrap": 6, "empti": 6, "dictionari": 6, "statement": 6, "below": 6, "look": 6, "implicit": 6, "integ": 6, "dp": 6, "kind": 6, "0d0": 6, "charact": 6, "pfile": 6, "ofil": 6, "punit": 6, "ounit": 6, "101": 6, "real": 6, "dimens": 6, "old": 6, "fmt": 6, "iostat": 6, "gfortran": 6, "f90": 6, "differ": 6, "ressourc": 6, "permit": 6, "person": 6, "nowadai": 6, "howev": 6, "worker": 6, "overwrit": 6, "here": 6, "pid": 6, "come": 6, "handi": 6, "invoc": 6, "own": 6, "associ": 6, "outfil": 6, "ishigami1_pid": 6, "standard_parameter_read": 6, "standard_parameter_writ": 6, "conveni": 6, "just": 6, "support": 6, "158398716": 6, "To": 6, "achiev": 6, "cannot": 6, "your": 6, "deal": 6, "bash": 6, "separ": 6, "cours": 6, "window": 6, "run_ishigami1": 6, "shutil": 6, "rundir": 6, "tmp": 6, "f": 6, "mkdir": 6, "copi": 6, "copyfil": 6, "chdir": 6, "err": 6, "check_output": 6, "stderr": 6, "stdout": 6, "avail": 6, "rmtree": 6, "account": 6, "exactli": 6, "That": 6, "folk": 6}, "objects": {"": [[5, 0, 0, "-", "pyeee"]], "pyeee": [[3, 0, 0, "-", "eee"]], "pyeee.eee": [[3, 1, 1, "", "eee"], [3, 1, 1, "", "see"]]}, "objtypes": {"0": "py:module", "1": "py:function"}, "objnames": {"0": ["py", "module", "Python module"], "1": ["py", "function", "Python function"]}, "titleterms": {"author": 0, "changelog": 1, "content": 2, "pyeee": [3, 4, 5], "eee": 3, "quickstart": 4, "about": 4, "quick": 4, "usag": 4, "guid": [4, 6], "simpl": 4, "python": [4, 6], "function": [4, 6], "extra": [4, 6], "paramet": [4, 6], "wrapper": 4, "instal": 4, "requir": 4, "licens": 4, "index": 4, "tabl": 4, "api": 5, "purpos": 5, "subpackag": 5, "user": 6, "elementari": 6, "effect": 6, "effici": 6, "sequenti": 6, "check": 6, "initi": 6, "fit": 6, "log": 6, "exclud": 6, "from": 6, "calcul": 6, "multipl": 6, "output": 6, "parallel": 6, "model": 6, "evalu": 6, "sampl": 6, "other": 6, "distribut": 6, "than": 6, "uniform": 6, "screen": 6, "extern": 6, "comput": 6, "execut": 6, "us": 6, "launch": 6, "script": 6}, "envversion": {"sphinx.domains.c": 3, "sphinx.domains.changeset": 1, "sphinx.domains.citation": 1, "sphinx.domains.cpp": 9, "sphinx.domains.index": 1, "sphinx.domains.javascript": 3, "sphinx.domains.math": 2, "sphinx.domains.python": 4, "sphinx.domains.rst": 2, "sphinx.domains.std": 2, "sphinx.ext.intersphinx": 1, "sphinx.ext.viewcode": 1, "sphinx": 60}, "alltitles": {"Authors": [[0, "authors"]], "Changelog": [[1, "changelog"]], "Contents": [[2, "contents"]], "pyeee.eee": [[3, "module-pyeee.eee"]], "Quickstart": [[4, "quickstart"]], "About pyeee": [[4, "about-pyeee"]], "Quick usage guide": [[4, "quick-usage-guide"]], "Simple Python function": [[4, "simple-python-function"]], "Python function with extra parameters": [[4, "python-function-with-extra-parameters"], [6, "python-function-with-extra-parameters"]], "Function wrappers": [[4, "function-wrappers"]], "Installation": [[4, "installation"]], "Requirements": [[4, "requirements"]], "License": [[4, "license"]], "Index and Tables": [[4, "index-and-tables"]], "pyeee API": [[5, "module-pyeee"]], "Purpose": [[5, "purpose"]], "Subpackages": [[5, "subpackages"]], "User Guide": [[6, "user-guide"]], "Elementary Effects": [[6, "elementary-effects"]], "Efficient/Sequential Elementary Effects": [[6, "efficient-sequential-elementary-effects"]], "Check initial fit": [[6, "check-initial-fit"]], "Logging": [[6, "logging"]], "Exclude parameters from calculations": [[6, "exclude-parameters-from-calculations"]], "Function with multiple outputs": [[6, "function-with-multiple-outputs"]], "Parallel model evaluation": [[6, "parallel-model-evaluation"]], "Sampling parameters with other distributions than the uniform distribution": [[6, "sampling-parameters-with-other-distributions-than-the-uniform-distribution"]], "Screening of external computer models": [[6, "screening-of-external-computer-models"]], "Parallel evaluation of external executables": [[6, "parallel-evaluation-of-external-executables"]], "Using launch scripts": [[6, "using-launch-scripts"]]}, "indexentries": {"eee() (in module pyeee.eee)": [[3, "pyeee.eee.eee"]], "module": [[3, "module-pyeee.eee"], [5, "module-pyeee"]], "pyeee.eee": [[3, "module-pyeee.eee"]], "see() (in module pyeee.eee)": [[3, "pyeee.eee.see"]], "pyeee": [[5, "module-pyeee"]]}}) \ No newline at end of file diff --git a/docs/html/userguide.html b/docs/html/userguide.html index 8883d5b..548d02a 100644 --- a/docs/html/userguide.html +++ b/docs/html/userguide.html @@ -374,21 +374,20 @@

      Contents