Welcome to idmtools_calibra¶
idmtools_calibra is a collection of Python scripts and utilities to aid in model calibration. The idmtools package should be used for streamlining the process of running disease modeling simulations. Additional information can be found at Welcome to idmtools.
See Welcome to idmtools for a diagram showing how idmtools and each of the related packages are used in an end-to-end workflow using EMOD as the disease transmission model.
idmtools_calibra installation¶
Follow the steps below to install idmtools_calibra.
Prerequisites¶
First, ensure the following prerequisites are met.
Windows 10 Pro or Enterprise, Linux, or Mac
Python 3.6.2 or 3.7 64-bit (https://www.python.org/downloads/release)
A file that indicates the pip index-url:
Windows
Linux
In C:\Users\Username\pip\pip.ini, containing the following:
[global] index-url = https://packages.idmod.org/api/pypi/pypi-production/simple
In $HOME/.config/pip/pip.conf, containing the following:
[global] index-url = https://packages.idmod.org/api/pypi/pypi-production/simple
Installation instructions¶
Open a command prompt and create a virtual environment in any directory you choose. The command below names the environment “v-calibra”, but you may use any desired name:
python -m venv v-calibra
Activate the virtual environment:
Windows
Linux
Enter the following:
v-calibra\Scripts\activate
Enter the following:
source v-calibra/bin/activate
Install idmtools_calibra packages:
pip install idmtools_calibra
If you are on Python 3.6, also run:
pip install dataclasses
If you are on Linux, also run:
pip install keyrings.alt
When you are finished, deactivate the virtual environment by entering the following at a command prompt:
deactivate
idmtools_calibra overview¶
Add overview of library here
idmtools_calibra¶
idmtools_calibra package¶
Subpackages¶
idmtools_calibra.algorithms package¶
Subpackages¶
idmtools_calibra.algorithms.pbnb package¶
Submodules¶
idmtools_calibra.algorithms.pbnb.c_sub_region module¶
Created on Fri Jun 23 14:21:27 2017
@author: TingYu Ho
idmtools_calibra.algorithms.pbnb.fun_pbnb_support_functions module¶
- idmtools_calibra.algorithms.pbnb.fun_pbnb_support_functions.fun_sample_points_generator_deterministic(l_subr, i_n_sampling, i_n_rep, s_stage, l_para)[source]¶
- idmtools_calibra.algorithms.pbnb.fun_pbnb_support_functions.fun_sample_points_generator_noise(l_subr, i_n_sampling, i_n_rep, s_stage, l_para)[source]¶
- idmtools_calibra.algorithms.pbnb.fun_pbnb_support_functions.fun_results_organizer_deterministic(l_subr, df_testing_samples, params)[source]¶
- idmtools_calibra.algorithms.pbnb.fun_pbnb_support_functions.fun_results_organizer_noise(l_subr, df_testing_samples, i_n_k, i_n_elite_worst, s_stage, params)[source]¶
- idmtools_calibra.algorithms.pbnb.fun_pbnb_support_functions.fun_replication_update(l_subr, i_n_rep, f_alpha)[source]¶
- idmtools_calibra.algorithms.pbnb.fun_pbnb_support_functions.fun_pruning_indicator(l_subr, f_CI_u)[source]¶
- idmtools_calibra.algorithms.pbnb.fun_pbnb_support_functions.fun_maintaining_indicator(l_subr, f_CI_l)[source]¶
- idmtools_calibra.algorithms.pbnb.fun_pbnb_support_functions.fun_elite_indicator(l_subr, f_CI_l)[source]¶
- idmtools_calibra.algorithms.pbnb.fun_pbnb_support_functions.fun_worst_indicator(l_subr, f_CI_u)[source]¶
- idmtools_calibra.algorithms.pbnb.fun_pbnb_support_functions.fun_quantile_update(l_subr, f_delta)[source]¶
- idmtools_calibra.algorithms.pbnb.fun_pbnb_support_functions.fun_ci_builder(l_subr, pd_order_z, f_delta_k, f_alpha_k, f_epsilon)[source]¶
- idmtools_calibra.algorithms.pbnb.fun_pbnb_support_functions.fun_maintaining_labeler(l_subr)[source]¶
idmtools_calibra.algorithms.pbnb.m_intial_paramters_setting module¶
Created on Fri Jun 23 22:15:00 2017
@author: TingYu Ho
idmtools_calibra.algorithms.pbnb.optim_tool_pbnb module¶
- class idmtools_calibra.algorithms.pbnb.optim_tool_pbnb.OptimToolPBnB(params, s_running_file_name, s_problem_type, constrain_sample_fn=<function OptimToolPBnB.<lambda>>, f_delta=0.6, f_alpha=0.5, i_k_b=3, i_n_branching=4, i_c=120, i_replication=1, i_stopping_max_k=10, i_max_num_simulation_per_run=1500, f_elite_worst_sampling_para=4e-05)[source]¶
Bases:
NextPointAlgorithm
Submodules¶
idmtools_calibra.algorithms.fisher_inf_matrix module¶
- idmtools_calibra.algorithms.fisher_inf_matrix.perturbed_points(center, xmin, xmax, m=10, n=5, sample_size=1, resolution_raw=None)[source]¶
Having the estimated optimal point (θ*), the next step is generating a set of perturbed points (samples). At this step, you can specify the size of perturbation (resolution). In case you do not input the perturbation size (resolution_raw=None), the script will pick a perturbation using the given range for each parameter (Xmin-Xmax). You need to allocate per-realization (M) and cross-realization (N). Note that \(M>p^2\), where p is the number of parameters (size of θ). The number of cross-realization (N) should be set depending on the uncertainty of the model at the given final point (θ*). To choose N, you can use Chebyshev’s inequality.
You can allocate number of replicates of the model (n). The log-likelihood at each point obtains from n replicates of the model with different run numbers. Then these n replicates are used to compute the likelihood at that point. When we have a model with high uncertainty, the easiest way to compute the likelihood might be taking average of the multiple (n) replicates of the model run to compute the likelihood. Note that the algorithm only accepts n=1 now. But the Cramer Rao script has the potential to accept higher n, whenever a smoothing technique which requires multiple replicates of the model for computing the likelihood be added to the Analyzers.
- Parameters:
center – center point 1xp nparray
xmin – minimum of parameters 1xp nparray
xmax – maximum of parameters 1xp nparray
m – number of Hessian estimates scalar-positive integer
n – number of pseudodata vectors scalar-positive integer
sample_size – sample size scalar-positive integer
resolution_raw – minimum meaningful perturbation for each parameter 1xp nparray
- Returns:
perturbed points (4MNn x 4+p) nparray
- Return type:
X_perturbed
- idmtools_calibra.algorithms.fisher_inf_matrix.compute_fisher_inf_matrix(center_point, df_ll_points, data_columns)[source]¶
Compute the Fisher Information matrix using the LL of perturbed points
Computation of the Fisher information matrix (covariance matrix) This step returns a p×p covariance matrix, called Σ.
Atiye Alaeddini, 12/15/2017
- Parameters:
center_point – center point (1 x p) nparray
df_ll_points – Log Likelihood of points DataFrame
data_columns – List of columns to filter points with
- Returns:
Fisher Information matrix (p x p) np array
- Return type:
Fisher
- idmtools_calibra.algorithms.fisher_inf_matrix.sample_cov_ellipse(cov, pos, num_of_pts=10)[source]¶
Sample ‘num_of_pts’ points from the specified covariance matrix (cov).
- Parameters:
cov – 2-D array_like, The covariance matrix (inverse of fisher matrix). It must be symmetric and positive-semidefinite for proper sampling.
pos – 1-D array_like, The location of the center of the ellipse, Mean of the multi variate distribution
num_of_pts – The number of sample points.
- Returns:
ndarray of the drawn samples, of shape (num_of_pts,).
- idmtools_calibra.algorithms.fisher_inf_matrix.trunc_gauss(mu, sigma, low_bound, high_bound, num_of_pts, batch_size=100)[source]¶
idmtools_calibra.algorithms.generic_iterative_next_point module¶
- class idmtools_calibra.algorithms.generic_iterative_next_point.GenericIterativeNextPoint(initial_state)[source]¶
Bases:
NextPointAlgorithm
Represents a Generic Next Point allowing thew Calibtool to function as a more generic iterative process. Here a dictionary needs to be passed as the state. For example:
initial_state = [{ 'Run_Number': rn } for rn in range(2)]
Then the results of the analyzers are stored in the self.data associating iteration with results. Both the initial state and the results are stored there allowing to easily refer to it:
self.data = [ { 'Run_Number': 1 'results':{ 'what_comes_from_analyzers':{} }, ... ]
Note that the results needs to be contained in a Dictionary. If you want to leverage pandas.DataFrame instead, you should use OptimTool.
- prep_for_dict(df)[source]¶
Utility function allowing to transform a DataFrame into a dict removing null values
idmtools_calibra.algorithms.gpc module¶
idmtools_calibra.algorithms.imis module¶
- class idmtools_calibra.algorithms.imis.IMIS(Incremental Mixture Importance Sampling)[source]¶
Bases:
NextPointAlgorithm
Algorithm ported from R code: http://cran.r-project.org/web/packages/IMIS
Full description from Adrian Raftery and Le Bao (2009): http://www.stat.washington.edu/research/reports/2009/tr560.pdf
The basic idea of IMIS is that points with high importance weights are in areas where the target density is underrepresented by the importance sampling distribution. At each iteration, a multivariate normal distribution centered at the point with the highest importance weight is added to the current importance sampling distribution, which thus becomes a mixture of such functions and of the prior. In this way underrepresented parts of the parameter space are successively identified and are given representation, ending up with an iteratively constructed importance sampling distribution that covers the target distribution well.
- validate_parameters()[source]¶
Ensure valid parameter ranges: ‘samples_per_iteration’ is used to select N-closest points to maximum-weight sample, so it can’t exceed ‘n_initial_samples’. It is also used to estimate weighted covariance, so it cannot be smaller than the dimensionality of the samples.
- set_initial_samples()[source]¶
Set the initial samples points for the algorithm. If initial_samples parameter is an array, use those values as initial samples. Otherwise, if initial_samples parameter is a number, draw the specified number randomly from the prior distribution.
- update_iteration(iteration)[source]¶
Initial Stage (iteration: k = 0)
Sample N inputs \(\theta_1, \theta_2, ... , \theta_N\) from the prior distribution \(p(\theta)\).
For each \(\theta_i\), calculate the likelihood \(L_i\), and form the importance weights: \(w^{(0)}_i = L_i / sum(L_j)\).
Importance Sampling Stage (iteration: k > 0; samples_per_iteration: B)
Calculate the likelihood of the new inputs and combine the new inputs with the previous ones. Form the importance weights: \(w^{(k)_i} = c * L_i * p(\theta_i) / q^{(k)}(\theta_i)\), where c is chosen so that the weights add to 1, \(q^{(k)}\) is the mixture sampling distribution: \(q^{(k)} = (N_0/N_k) * p + (B/N_k) * sum(H_s)\) where \(H_s\) is the Sth multivariate normal distribution, and \(N_k = N_0 + B_k\) is the total number of inputs up to iteration k.
- update_gaussian()[source]¶
Importance Sampling Stage (iteration: k > 0; samples_per_iteration: B)
Choose the current maximum weight input as the center \(\theta^{(k)}\). Estimate \(\Sigma^{(k)}\) from the weighted covariance of the B inputs with the smallest Mahalanobis distances to \(\theta^{(k)}\), where the distances are calculated with respect to the covariance of the prior distribution and the weights are taken to be proportional to the average of the importance weights and \(1/N_k\).
Sample ‘samples_per_iteration’ new inputs from a multivariate Gaussian distribution \(H_k\) with covariance matrix \(\Sigma^{(k)}\).
- update_gaussian_center()[source]¶
Choose the current maximum weight input as the center point for the next iteration of multivariate-normal sampling.
- weighted_distances_from_center()[source]¶
Calculate the covariance-weighted distances from the current maximum-weight sample. N.B. Using normalized Euclid instead of Mahalanobis if we’re just going to diagonalize anyways.
- update_gaussian_covariance(distances)[source]¶
Calculate the covariance of the next-iteration of multivariate-normal sampling from the “samples_per_iteration” closest samples.
- verify_valid_samples(next_samples)[source]¶
Resample from next-point function until all samples have non-zero prior.
- next_point_fn()[source]¶
IMIS next-point sampling from multivariate normal centered on the maximum weight.
- update_gaussian_probabilities(iteration)[source]¶
Calculate the probabilities of all sample points as estimated from the multivariate-normal probability distribution function centered on the maximum weight and with covariance fitted from the most recent iteration.
- calculate_weighted_covariance(samples, weights, center)[source]¶
A weighted covariance of sample points. N.B. The weights are normalized as in the R function “cov.wt”
- end_condition()[source]¶
- Stopping Criterion:
The algorithm ends when the importance sampling weights are reasonably uniform. Specifically, we end the algorithm when the expected fraction of unique points in the resample is at least (1 - 1/e) = 0.632. This is the expected fraction when the importance sampling weights are all equal, which is the case when the importance sampling function is the same as the target distribution.
idmtools_calibra.algorithms.next_point_algorithm module¶
- class idmtools_calibra.algorithms.next_point_algorithm.NextPointAlgorithm[source]¶
Bases:
object
- prep_for_dict(df)[source]¶
Utility function allowing to transform a DataFrame into a dict removing null values
idmtools_calibra.algorithms.optim_tool module¶
- class idmtools_calibra.algorithms.optim_tool.OptimTool(params, constrain_sample_fn=<function OptimTool.<lambda>>, mu_r=0.1, sigma_r=0.02, center_repeats=2, samples_per_iteration=100.0, rsquared_thresh=0.5)[source]¶
Bases:
NextPointAlgorithm
The basic idea of OptimTool is
idmtools_calibra.algorithms.optim_tools_pspo module¶
- class idmtools_calibra.algorithms.optim_tools_pspo.OptimToolPSPO(params, constrain_sample_fn, comps_per_iteration=10)[source]¶
Bases:
NextPointAlgorithm
OptimTool
The basic idea of OptimTool is
idmtools_calibra.algorithms.optim_tools_spsa module¶
- class idmtools_calibra.algorithms.optim_tools_spsa.OptimToolSPSA(params, constrain_sample_fn, comps_per_iteration=10)[source]¶
Bases:
NextPointAlgorithm
The basic idea of OptimToolSPSA is
idmtools_calibra.algorithms.separatrix_bhm module¶
- class idmtools_calibra.algorithms.separatrix_bhm.SeparatrixBHM(params, constrain_sample_fn=<function SeparatrixBHM.<lambda>>, implausibility_threshold=3, target_success_probability=0.7, num_past_iterations_to_include_in_metamodel=3, samples_per_iteration=32, samples_final_iteration=128, max_iterations=10, training_frac=0.8)[source]¶
Bases:
NextPointAlgorithm
Separatrix using Bayesian History Matching
The basic idea of Separatrix is that each simulation results in a success (+1) or a failure (-1), and the success probability varies as a function of the input parameters. We seek an isocline of the the latent success probability function.
idmtools_calibra.analyzers package¶
Submodules¶
idmtools_calibra.analyzers.base_calibration_analyzer module¶
idmtools_calibra.analyzers.rmse_analyzer module¶
- class idmtools_calibra.analyzers.rmse_analyzer.RMSEAnalyzer(site, dependent_column, independent_column, output_filename='output.csv')[source]¶
Bases:
BaseCalibrationAnalyzer
- map(data, item)[source]¶
In parallel for each simulation/work item, consume raw data from filenames and emit selected data.
- Parameters:
data – A dictionary associating filename with content for simulation data.
item –
IItem
object that the passed data is associated with.
- Returns:
Selected data for the given simulation/work item.
idmtools_calibra.cli package¶
Submodules¶
idmtools_calibra.output package¶
Submodules¶
idmtools_calibra.plotters package¶
Submodules¶
idmtools_calibra.plotters.base_plotter module¶
- class idmtools_calibra.plotters.base_plotter.BasePlotter(combine_sites=True)[source]¶
Bases:
object
- property all_results¶
- static combine_by_site(site_name, analyzer_names, results)[source]¶
Sum the result values over analyzers performed on the specified site and add SITE_total to results :param site_name: The name of the CalibSite :param analyzer_names: A list of CalibAnalyzer names corresponding to the site :param results: A pandas.DataFrame of results into which to add a combined site-analyzer-result column :return: None
idmtools_calibra.plotters.likelihood_plotter module¶
idmtools_calibra.plotters.optim_tool_pbnb_plotter module¶
idmtools_calibra.plotters.optim_tool_plotter module¶
- class idmtools_calibra.plotters.optim_tool_plotter.OptimToolPlotter[source]¶
Bases:
BasePlotter
idmtools_calibra.plotters.optim_tool_spsa_plotter module¶
idmtools_calibra.plotters.separatrix_bhm_plotter module¶
- class idmtools_calibra.plotters.separatrix_bhm_plotter.SeparatrixBHMPlotter[source]¶
Bases:
BasePlotter
idmtools_calibra.plotters.site_data_plotter module¶
- class idmtools_calibra.plotters.site_data_plotter.SiteDataPlotter(combine_sites=True, num_to_plot=5, ll_all_name: str = 'LL_all.csv')[source]¶
Bases:
BasePlotter
- property directory¶
- cleanup_plot_by_analyzers(site, analyzers, samples)[source]¶
cleanup the existing plots :param site: :param analyzers: :param samples: :return:
- cleanup_plot_for_best(site_analyzer, samples)[source]¶
cleanup the existing plots :param site_analyzer: :param samples: :return:
idmtools_calibra.resamplers package¶
Submodules¶
idmtools_calibra.resamplers.base_resampler module¶
idmtools_calibra.resamplers.calibration_point module¶
- class idmtools_calibra.resamplers.calibration_point.CalibrationPoint(parameters=None, likelihood=None)[source]¶
Bases:
object
- DYNAMIC = 'dynamic'¶
- STATIC = 'static'¶
- ALL = 'all'¶
- PARAMETER_TYPES = ['dynamic', 'static', 'all']¶
- LIST = 'list'¶
- SERIES = 'series'¶
- NUMPY = 'numpy'¶
- to_value_dict(parameter_type=None, include_likelihood=False)[source]¶
Return the dict of dict containing {parameter_name:value} for this CalibrationPoint
- get_attribute(key, parameter_type=None, as_type=None)[source]¶
Returns the specified attribute of each CalibrationParameter as a list, ordered by parameter
- Parameters:
key –
parameter_type –
as_type –
Returns:
- property parameter_names¶
- get_parameter(name)[source]¶
Relies on their being exactly one parameter with the given name.
- Parameters:
name –
Returns:
- to_dict()[source]¶
Converts CalibrationPoint objects to a dictionary. Useful e.g. for dumping to a json file.
- Returns:
a dict containing all needed information for recreating a CalibrationPoint object via from_dict()
- class idmtools_calibra.resamplers.calibration_point.CalibrationParameter(name, min, max, value, mapTo, dynamic, guess)[source]¶
Bases:
object
idmtools_calibra.resamplers.calibration_points module¶
idmtools_calibra.resamplers.cramer_rao_resampler module¶
- class idmtools_calibra.resamplers.cramer_rao_resampler.CramerRaoResampler(calib_manager=None, **kwargs)[source]¶
Bases:
BaseResampler
- resample(calibrated_points, selection_values, initial_calibration_points)[source]¶
Takes in a list of 1+ Point objects and returns method-specific resampled points as a list of Point objects The resultant Point objects should be copies of the input Points BUT with Value overridden on each, e.g.:
new_point = Point.copy(one_of_the_input_calibrated_points) for param in new_point.list_params(): new_point.set_param_value(param, value=SOME_NEW_VALUE)
- Parameters:
calibrated_points – input points for this resampling method
- Returns:
A list of resampled Point objects
idmtools_calibra.resamplers.random_perturbation_resampler module¶
- class idmtools_calibra.resamplers.random_perturbation_resampler.RandomPerturbationResampler(calib_manager=None, **kwargs)[source]¶
Bases:
BaseResampler
- resample(calibrated_points, selection_values, initial_calibration_points)[source]¶
Takes in a list of 1+ Point objects and returns method-specific resampled points as a list of Point objects The resultant Point objects should be copies of the input Points BUT with Value overridden on each, e.g.:
new_point = Point.copy(one_of_the_input_calibrated_points) for param in new_point.list_params(): new_point.set_param_value(param, value=SOME_NEW_VALUE)
- Parameters:
calibrated_points – input points for this resampling method
selection_values –
initial_calibration_points –
- Returns:
A list of resampled Point objects
idmtools_calibra.utilities package¶
Subpackages¶
idmtools_calibra.utilities.parsers package¶
Submodules¶
idmtools_calibra.utilities.parsers.JSON module¶
idmtools_calibra.utilities.parsers.bin2np module¶
idmtools_calibra.utilities.parsers.dict2pd module¶
idmtools_calibra.utilities.parsers.malaria_summary module¶
- idmtools_calibra.utilities.parsers.malaria_summary.summary_channel_to_pandas(data, channel)[source]¶
A function to return a hierarchical binned pandas.Series for a specified MalariaSummaryReport.json channel :param data: parsed data from summary report :param channel: channel in summary report :return: pd.Series with MultiIndex binning taken from summary metadata
- idmtools_calibra.utilities.parsers.malaria_summary.json_to_pandas(channel_data, bins, channel=None)[source]¶
A function to convert nested array channel data from a json file to a pandas.Series with the specified MultiIndex binning.
- idmtools_calibra.utilities.parsers.malaria_summary.get_grouping_for_summary_channel(data, channel)[source]¶
A function to find the grouping to which a channel belongs in MalariaSummaryReport.json :param data: parsed data from summary report :param channel: channel to find :return: grouping or exception if not found
Example:
>>> get_grouping_for_summary_channel(data, channel='Average Population by Age Bin') 'DataByTimeAndAgeBins'
- idmtools_calibra.utilities.parsers.malaria_summary.get_bins_for_summary_grouping(data, grouping)[source]¶
A function to get the dimensions and binning of data for a specified MalariaSummaryReport.json grouping :param data: parsed data from summary report :param grouping: group name :return: an OrderedDict of dimensions and bins
Example:
>>> get_bins_for_summary_grouping(data, grouping='DataByTimeAndAgeBins') OrderedDict([('Time', [31, 61, 92, ..., 1095]), ('Age Bin', [0, 10, 20, ..., 1000])])
idmtools_calibra.utilities.parsers.np2json module¶
- class idmtools_calibra.utilities.parsers.np2json.NumpyAwareJSONEncoder(*, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, sort_keys=False, indent=None, separators=None, default=None)[source]¶
Bases:
JSONEncoder
- default(obj)[source]¶
Implement this method in a subclass such that it returns a serializable object for
o
, or calls the base implementation (to raise aTypeError
).For example, to support arbitrary iterators, you could implement default like this:
def default(self, o): try: iterable = iter(o) except TypeError: pass else: return list(iterable) # Let the base class default method raise the TypeError return JSONEncoder.default(self, o)
idmtools_calibra.utilities.parsers.np2pd module¶
idmtools_calibra.utilities.parsers.pd2csv module¶
Submodules¶
idmtools_calibra.utilities.display module¶
idmtools_calibra.utilities.distro module¶
The distro
package (distro
stands for Linux Distribution) provides
information about the Linux distribution it runs on, such as a reliable
machine-readable distro ID, or version information.
It is the recommended replacement for Python’s original
platform.linux_distribution()
function, but it provides much more
functionality. An alternative implementation became necessary because Python
3.5 deprecated this function, and Python 3.8 will remove it altogether.
Its predecessor function platform.dist()
was already
deprecated since Python 2.6 and will also be removed in Python 3.8.
Still, there are many cases in which access to OS distribution information
is needed. See Python issue 1322 for
more information.
- idmtools_calibra.utilities.distro.NORMALIZED_OS_ID = {}¶
Translation table for normalizing the “ID” attribute defined in os-release files, for use by the
distro.id()
method.Key: Value as defined in the os-release file, translated to lower case, with blanks translated to underscores.
Value: Normalized value.
- idmtools_calibra.utilities.distro.NORMALIZED_LSB_ID = {'enterpriseenterprise': 'oracle', 'redhatenterpriseserver': 'rhel', 'redhatenterpriseworkstation': 'rhel'}¶
Translation table for normalizing the “Distributor ID” attribute returned by the lsb_release command, for use by the
distro.id()
method.Key: Value as returned by the lsb_release command, translated to lower case, with blanks translated to underscores.
Value: Normalized value.
- idmtools_calibra.utilities.distro.NORMALIZED_DISTRO_ID = {'redhat': 'rhel'}¶
Translation table for normalizing the distro ID derived from the file name of distro release files, for use by the
distro.id()
method.Key: Value as derived from the file name of a distro release file, translated to lower case, with blanks translated to underscores.
Value: Normalized value.
- idmtools_calibra.utilities.distro.linux_distribution(full_distribution_name=True)[source]¶
Return information about the current OS distribution as a tuple
(id_name, version, codename)
with items as follows:id_name
: If full_distribution_name is false, the result ofdistro.id()
. Otherwise, the result ofdistro.name()
.version
: The result ofdistro.version()
.codename
: The result ofdistro.codename()
.
The interface of this function is compatible with the original
platform.linux_distribution()
function, supporting a subset of its parameters.The data it returns may not exactly be the same, because it uses more data sources than the original function, and that may lead to different data if the OS distribution is not consistent across multiple data sources it provides (there are indeed such distributions …).
Another reason for differences is the fact that the
distro.id()
method normalizes the distro ID string to a reliable machine-readable value for a number of popular OS distributions.
- idmtools_calibra.utilities.distro.id()[source]¶
Return the distro ID of the current distribution, as a machine-readable string.
For a number of OS distributions, the returned distro ID value is reliable, in the sense that it is documented and that it does not change across releases of the distribution.
This package maintains the following reliable distro ID values:
Distro ID
Distribution
“ubuntu”
Ubuntu
“debian”
Debian
“rhel”
RedHat Enterprise Linux
“centos”
CentOS
“fedora”
Fedora
“sles”
SUSE Linux Enterprise Server
“opensuse”
openSUSE
“amazon”
Amazon Linux
“arch”
Arch Linux
“cloudlinux”
CloudLinux OS
“exherbo”
Exherbo Linux
“gentoo”
GenToo Linux
“ibm_powerkvm”
IBM PowerKVM
“kvmibm”
KVM for IBM z Systems
“linuxmint”
Linux Mint
“mageia”
Mageia
“mandriva”
Mandriva Linux
“parallels”
Parallels
“pidora”
Pidora
“raspbian”
Raspbian
“oracle”
Oracle Linux (and Oracle Enterprise Linux)
“scientific”
Scientific Linux
“slackware”
Slackware
“xenserver”
XenServer
“openbsd”
OpenBSD
“netbsd”
NetBSD
“freebsd”
FreeBSD
If you have a need to get distros for reliable IDs added into this set, or if you find that the
distro.id()
function returns a different distro ID for one of the listed distros, please create an issue in the distro issue tracker.Lookup hierarchy and transformations:
First, the ID is obtained from the following sources, in the specified order. The first available and non-empty value is used:
the value of the “ID” attribute of the os-release file,
the value of the “Distributor ID” attribute returned by the lsb_release command,
the first part of the file name of the distro release file,
The so determined ID value then passes the following transformations, before it is returned by this method:
it is translated to lower case,
blanks (which should not be there anyway) are translated to underscores,
a normalization of the ID is performed, based upon normalization tables. The purpose of this normalization is to ensure that the ID is as reliable as possible, even across incompatible changes in the OS distributions. A common reason for an incompatible change is the addition of an os-release file, or the addition of the lsb_release command, with ID values that differ from what was previously determined from the distro release file name.
- idmtools_calibra.utilities.distro.name(pretty=False)[source]¶
Return the name of the current OS distribution, as a human-readable string.
If pretty is false, the name is returned without version or codename. (e.g. “CentOS Linux”)
If pretty is true, the version and codename are appended. (e.g. “CentOS Linux 7.1.1503 (Core)”)
Lookup hierarchy:
The name is obtained from the following sources, in the specified order. The first available and non-empty value is used:
If pretty is false:
the value of the “NAME” attribute of the os-release file,
the value of the “Distributor ID” attribute returned by the lsb_release command,
the value of the “<name>” field of the distro release file.
If pretty is true:
the value of the “PRETTY_NAME” attribute of the os-release file,
the value of the “Description” attribute returned by the lsb_release command,
the value of the “<name>” field of the distro release file, appended with the value of the pretty version (“<version_id>” and “<codename>” fields) of the distro release file, if available.
- idmtools_calibra.utilities.distro.version(pretty=False, best=False)[source]¶
Return the version of the current OS distribution, as a human-readable string.
If pretty is false, the version is returned without codename (e.g. “7.0”).
If pretty is true, the codename in parenthesis is appended, if the codename is non-empty (e.g. “7.0 (Maipo)”).
Some distributions provide version numbers with different precisions in the different sources of distribution information. Examining the different sources in a fixed priority order does not always yield the most precise version (e.g. for Debian 8.2, or CentOS 7.1).
The best parameter can be used to control the approach for the returned version:
If best is false, the first non-empty version number in priority order of the examined sources is returned.
If best is true, the most precise version number out of all examined sources is returned.
Lookup hierarchy:
In all cases, the version number is obtained from the following sources. If best is false, this order represents the priority order:
the value of the “VERSION_ID” attribute of the os-release file,
the value of the “Release” attribute returned by the lsb_release command,
the version number parsed from the “<version_id>” field of the first line of the distro release file,
the version number parsed from the “PRETTY_NAME” attribute of the os-release file, if it follows the format of the distro release files.
the version number parsed from the “Description” attribute returned by the lsb_release command, if it follows the format of the distro release files.
- idmtools_calibra.utilities.distro.version_parts(best=False)[source]¶
Return the version of the current OS distribution as a tuple
(major, minor, build_number)
with items as follows:major
: The result ofdistro.major_version()
.minor
: The result ofdistro.minor_version()
.build_number
: The result ofdistro.build_number()
.
For a description of the best parameter, see the
distro.version()
method.
- idmtools_calibra.utilities.distro.major_version(best=False)[source]¶
Return the major version of the current OS distribution, as a string, if provided. Otherwise, the empty string is returned. The major version is the first part of the dot-separated version string.
For a description of the best parameter, see the
distro.version()
method.
- idmtools_calibra.utilities.distro.minor_version(best=False)[source]¶
Return the minor version of the current OS distribution, as a string, if provided. Otherwise, the empty string is returned. The minor version is the second part of the dot-separated version string.
For a description of the best parameter, see the
distro.version()
method.
- idmtools_calibra.utilities.distro.build_number(best=False)[source]¶
Return the build number of the current OS distribution, as a string, if provided. Otherwise, the empty string is returned. The build number is the third part of the dot-separated version string.
For a description of the best parameter, see the
distro.version()
method.
- idmtools_calibra.utilities.distro.like()[source]¶
Return a space-separated list of distro IDs of distributions that are closely related to the current OS distribution in regards to packaging and programming interfaces, for example distributions the current distribution is a derivative from.
Lookup hierarchy:
This information item is only provided by the os-release file. For details, see the description of the “ID_LIKE” attribute in the os-release man page.
- idmtools_calibra.utilities.distro.codename()[source]¶
Return the codename for the release of the current OS distribution, as a string.
If the distribution does not have a codename, an empty string is returned.
Note that the returned codename is not always really a codename. For example, openSUSE returns “x86_64”. This function does not handle such cases in any special way and just returns the string it finds, if any.
Lookup hierarchy:
the codename within the “VERSION” attribute of the os-release file, if provided,
the value of the “Codename” attribute returned by the lsb_release command,
the value of the “<codename>” field of the distro release file.
- idmtools_calibra.utilities.distro.info(pretty=False, best=False)[source]¶
Return certain machine-readable information items about the current OS distribution in a dictionary, as shown in the following example:
{ 'id': 'rhel', 'version': '7.0', 'version_parts': { 'major': '7', 'minor': '0', 'build_number': '' }, 'like': 'fedora', 'codename': 'Maipo' }
The dictionary structure and keys are always the same, regardless of which information items are available in the underlying data sources. The values for the various keys are as follows:
id
: The result ofdistro.id()
.version
: The result ofdistro.version()
.version_parts -> major
: The result ofdistro.major_version()
.version_parts -> minor
: The result ofdistro.minor_version()
.version_parts -> build_number
: The result ofdistro.build_number()
.like
: The result ofdistro.like()
.codename
: The result ofdistro.codename()
.
For a description of the pretty and best parameters, see the
distro.version()
method.
- idmtools_calibra.utilities.distro.os_release_info()[source]¶
Return a dictionary containing key-value pairs for the information items from the os-release file data source of the current OS distribution.
See os-release file for details about these information items.
- idmtools_calibra.utilities.distro.lsb_release_info()[source]¶
Return a dictionary containing key-value pairs for the information items from the lsb_release command data source of the current OS distribution.
See lsb-release command output for details about these information items.
- idmtools_calibra.utilities.distro.distro_release_info()[source]¶
Return a dictionary containing key-value pairs for the information items from the distro release file data source of the current OS distribution.
See distro release file for details about these information items.
- idmtools_calibra.utilities.distro.uname_info()[source]¶
Return a dictionary containing key-value pairs for the information items from the distro release file data source of the current OS distribution.
- idmtools_calibra.utilities.distro.os_release_attr(attribute)[source]¶
Return a single named information item from the os-release file data source of the current OS distribution.
Parameters:
attribute
(string): Key of the information item.
Returns:
(string): Value of the information item, if the item exists. The empty string, if the item does not exist.
See os-release file for details about these information items.
- idmtools_calibra.utilities.distro.lsb_release_attr(attribute)[source]¶
Return a single named information item from the lsb_release command output data source of the current OS distribution.
Parameters:
attribute
(string): Key of the information item.
Returns:
(string): Value of the information item, if the item exists. The empty string, if the item does not exist.
See lsb-release command output for details about these information items.
- idmtools_calibra.utilities.distro.distro_release_attr(attribute)[source]¶
Return a single named information item from the distro release file data source of the current OS distribution.
Parameters:
attribute
(string): Key of the information item.
Returns:
(string): Value of the information item, if the item exists. The empty string, if the item does not exist.
See distro release file for details about these information items.
- idmtools_calibra.utilities.distro.uname_attr(attribute)[source]¶
Return a single named information item from the distro release file data source of the current OS distribution.
Parameters:
attribute
(string): Key of the information item.
Returns:
- (string): Value of the information item, if the item exists.
The empty string, if the item does not exist.
- class idmtools_calibra.utilities.distro.cached_property(f)[source]¶
Bases:
object
A version of @property which caches the value. On access, it calls the underlying function and sets the value in __dict__ so future accesses will not re-call the property.
- class idmtools_calibra.utilities.distro.LinuxDistribution(include_lsb=True, os_release_file='', distro_release_file='', include_uname=True)[source]¶
Bases:
object
Provides information about a OS distribution.
This package creates a private module-global instance of this class with default initialization arguments, that is used by the consolidated accessor functions and single source accessor functions. By using default initialization arguments, that module-global instance returns data about the current OS distribution (i.e. the distro this package runs on).
Normally, it is not necessary to create additional instances of this class. However, in situations where control is needed over the exact data sources that are used, instances of this class can be created with a specific distro release file, or a specific os-release file, or without invoking the lsb_release command.
- linux_distribution(full_distribution_name=True)[source]¶
Return information about the OS distribution that is compatible with Python’s
platform.linux_distribution()
, supporting a subset of its parameters.For details, see
distro.linux_distribution()
.
- id()[source]¶
Return the distro ID of the OS distribution, as a string.
For details, see
distro.id()
.
- name(pretty=False)[source]¶
Return the name of the OS distribution, as a string.
For details, see
distro.name()
.
- version(pretty=False, best=False)[source]¶
Return the version of the OS distribution, as a string.
For details, see
distro.version()
.
- version_parts(best=False)[source]¶
Return the version of the OS distribution, as a tuple of version numbers.
For details, see
distro.version_parts()
.
- major_version(best=False)[source]¶
Return the major version number of the current distribution.
For details, see
distro.major_version()
.
- minor_version(best=False)[source]¶
Return the minor version number of the current distribution.
For details, see
distro.minor_version()
.
- build_number(best=False)[source]¶
Return the build number of the current distribution.
For details, see
distro.build_number()
.
- like()[source]¶
Return the IDs of distributions that are like the OS distribution.
For details, see
distro.like()
.
- info(pretty=False, best=False)[source]¶
Return certain machine-readable information about the OS distribution.
For details, see
distro.info()
.
- os_release_info()[source]¶
Return a dictionary containing key-value pairs for the information items from the os-release file data source of the OS distribution.
For details, see
distro.os_release_info()
.
- lsb_release_info()[source]¶
Return a dictionary containing key-value pairs for the information items from the lsb_release command data source of the OS distribution.
For details, see
distro.lsb_release_info()
.
- distro_release_info()[source]¶
Return a dictionary containing key-value pairs for the information items from the distro release file data source of the OS distribution.
For details, see
distro.distro_release_info()
.
- uname_info()[source]¶
Return a dictionary containing key-value pairs for the information items from the uname command data source of the OS distribution.
For details, see
distro.uname_info()
.
- os_release_attr(attribute)[source]¶
Return a single named information item from the os-release file data source of the OS distribution.
For details, see
distro.os_release_attr()
.
- lsb_release_attr(attribute)[source]¶
Return a single named information item from the lsb_release command output data source of the OS distribution.
For details, see
distro.lsb_release_attr()
.
idmtools_calibra.utilities.encoding module¶
- class idmtools_calibra.utilities.encoding.NumpyEncoder(*, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, sort_keys=False, indent=None, separators=None, default=None)[source]¶
Bases:
JSONEncoder
- class idmtools_calibra.utilities.encoding.GeneralEncoder(*, skipkeys=False, ensure_ascii=True, check_circular=True, allow_nan=True, sort_keys=False, indent=None, separators=None, default=None)[source]¶
Bases:
NumpyEncoder
idmtools_calibra.utilities.helper module¶
idmtools_calibra.utilities.ll_all_generator module¶
idmtools_calibra.utilities.ll_calculators module¶
- idmtools_calibra.utilities.ll_calculators.beta_binomial(raw_nobs, sim_nobs, raw_data, sim_data, return_mean=True)[source]¶
idmtools_calibra.utilities.mod_fn module¶
idmtools_calibra.utilities.parameter_set module¶
- exception idmtools_calibra.utilities.parameter_set.NaNDetectedError[source]¶
Bases:
ValueError
idmtools_calibra.utilities.prior module¶
- class idmtools_calibra.utilities.prior.SampleRange(range_type, range_min, range_max)[source]¶
Bases:
object
Container for min, max of a range and a type of sampling to use
- Parameters:
range_type – Type of sampling within range. Supported values: linear, log, linear_int
range_min – Minimum of sampling range.
range_max – Maximum of sampling range.
- class idmtools_calibra.utilities.prior.SampleFunctionContainer(function, sample_range=None)[source]¶
Bases:
object
Container for a frozen function and optionally its associated sample-range properties
- class idmtools_calibra.utilities.prior.MultiVariatePrior(functions, params=[], ranges=[], name=None)[source]¶
Bases:
object
Multi-variate wrapper exposing same interfaces as scipy.stats functions, i.e. pdf and rvs
Different dimensions are drawn independently from the univariate distributions.
- Parameters:
sample_functions – list of scipy.stats frozen functions
params – list of parameter names associated with functions (optional)
ranges – list of SampleRange objects associated with functions (optional)
name – name of MultiVariatePrior object (optional)
- property functions¶
- property params¶
- property ndim¶
- classmethod by_range(**param_sample_ranges)[source]¶
Builds multi-variate wrapper from keyword arguments of parameter names to SampleRange (min, max, type)
- Parameters:
param_sample_ranges – keyword arguments of parameter names to SampleRange tuple
- Returns:
MultiVariatePrior instance
An example usage:
> prior = MultiVariatePrior.by_range( MSP1_Merozoite_Kill_Fraction=('linear', 0.4, 0.7), Max_Individual_Infections=('linear_int', 3, 8), Base_Gametocyte_Production_Rate=('log', 0.001, 0.5))
- classmethod by_param(**param_sample_functions)[source]¶
Builds multi-variate wrapper from keyword arguments of parameter names to univariate frozen functions
- Parameters:
param_sample_functions – keyword arguments of parameter names to univariate object supporting pdf and rvs interfaces
- Returns:
MultiVariatePrior instance
An example usage:
> from scipy.stats import uniform > prior = MultiVariatePrior.by_param( MSP1_Merozoite_Kill_Fraction=uniform(loc=0.4, scale=0.3), # from 0.4 to 0.7 Nonspecific_Antigenicity_Factor=uniform(loc=0.1, scale=0.8)) # from 0.1 to 0.9
- pdf(X)[source]¶
Returns product of individual component function PDFs at each input point.
- Parameters:
X – array of points, where each point is an array of correct dimension.
- rvs(size=1)[source]¶
Returns an array of random points, where each point is sampled randomly in its component dimensions.
- Parameters:
size – the number of random points to sample.
- lhs(size=1)[source]¶
Returns a Latin Hypercube sample, drawn from the sampling ranges of the component dimensions :param size: the number of random points to sample
idmtools_calibra.utilities.resume_manager module¶
- idmtools_calibra.utilities.resume_manager.status_to_iter_step(status: StatusPoint)[source]¶
- class idmtools_calibra.utilities.resume_manager.ResumeManager(calib_manager: CalibManager, iteration: int | None = None, iter_step: str | None = None, max_iterations: int | None = None, loop: bool = True, backup: bool = False, dry_run: bool = False)[source]¶
Bases:
object
Manages the creation, execution, and resumption of multi-iteration a calibration suite. Each iteration spawns a new ExperimentManager to configure and commission either local or HPC simulations for a set of random seeds, sample points, and site configurations.
- initialize()[source]¶
- prepare calib_manager and iteration state for resume
restore calib_manager
restore iteration state
validate iteration
validate iter_step
Submodules¶
idmtools_calibra.calib_base_app module¶
- idmtools_calibra.calib_base_app.constrain_sample(sample)[source]¶
This function is called on every samples and allow the user to edit them before they are passed to the map_sample_to_model_input function. It is useful to round some parameters as demonstrated below. #Can do much more here, e.g. for Clinical Fever Threshold High < MSP1 Merozoite Kill Fraction if ‘Clinical Fever Threshold High’ and “MSP1 Merozoite Kill Fraction” in sample: sample[‘Clinical Fever Threshold High’] = min( sample[‘Clinical Fever Threshold High’], sample[‘MSP1 Merozoite Kill Fraction’] ). You can omit this function by not specifying it in the OptimTool constructor call below. :param sample: The sample coming from the next point algorithm
Returns: The sample with constrained values
- idmtools_calibra.calib_base_app.map_sample_to_model_input(simulation, sample)[source]¶
This method maps the samples generated by the next point algorithm to the model inputs (via the simulation object). All parameters specified for dynamic calibration (above) that do not have a MapTo value must have associated mapping logic in this method. :param simulation: idmtools simulation :param sample: The sample containing a values for all the params. e.g. {‘Clinical Fever Threshold High’:1, … }
Returns: A dictionary containing the tags that will be attached to the simulation
idmtools_calibra.calib_manager module¶
- idmtools_calibra.calib_manager.set_parameter_sweep_callback(simulation: Simulation, param: str, value: Any) Dict[str, Any] [source]¶
Convenience callback for sweeps
- Parameters:
simulation – Simulation we are updating
param – Parameter
value – Value
- Returns:
Tags to set on simulation
- class idmtools_calibra.calib_manager.SampleIndexWrapper(map_sample_to_model_input_fn)[source]¶
Bases:
object
Wrapper for a SimConfigBuilder-modifying function to add metadata on sample-point index when called in a iteration over sample points
- class idmtools_calibra.calib_manager.CalibManager(task: ITask, map_sample_to_model_input_fn, sites: List[CalibSite], next_point: NextPointAlgorithm, platform: IPlatform | None = None, name: str = 'calib_test', sim_runs_per_param_set: int = 1, max_iterations: int = 5, plotters: List[BasePlotter] | None = None, map_replicates_callback=None, directory='.')[source]¶
Bases:
object
Manages the creation, execution, and resumption of multi-iteration a calibration suite. Each iteration spawns a new ExperimentManager to configure and commission either local or HPC simulations for a set of random seeds, sample points, and site configurations.
- property suite_id¶
- property iteration¶
- run_calibration(**kwargs)[source]¶
Create and run a complete multi-iteration calibration suite. kwargs supports the following optional parameters: :param resume: bool, default=False, flag required for calibration resume :param iteration: int, default=None, from which iteration to resume :param iter_step: str, default=None, from which calibration step to resume. support values: ‘commission’, ‘analyze’, plot’ and ‘next_point’ :param loop: bool, default=True, if like to continue to next iteration :param max_iterations, int, default=None, user can override the max_iterations defined in calib_manager: :param backup: bool, default=False, if like to backup Calibration.json :param dry_run: bool, default=False, if like to really execute resume action :param directory: str, default=None, calibration directory
Returns: None
- run_iterations(iteration: int = 0, max_iterations: int | None = None, loop: bool = True)[source]¶
Run iterations in a loop :param iteration: the # of iterations :param max_iterations: max iterations :param loop: if or not continue iteration loop
Returns: None
- set_experiment_builder_function(exp_builder_function)[source]¶
Set the experiment builder to a predefined one, such that exp_builder_func will return it :param exp_builder_function: an experiment builder object
Returns: None
- set_map_replicates_callback(map_replicates_callback)[source]¶
This sets the maps replicate callback. This callback should take a value parameter that is the value of the replicate.
Normally you would want to map this to a value in the config :param map_replicates_callback:
Returns:
- default_experiment_builder_function(next_params, n_replicates: int | None = None) SimulationBuilder [source]¶
Defines the function that builds the experiment for each iteration of a calibration run
- Parameters:
next_params – The next parameters to run
n_replicates – Number of replicates
- Returns:
Simulation Builder
- create_iteration_state(iteration)[source]¶
Create iteration state :param iteration: the # of the iteration
Returns: created IterationState
- create_calibration()[source]¶
Create the working directory for a new calibration. Cache the relevant suite-level information to allow re-initializing this instance.
- cache_calibration(**kwargs)[source]¶
Cache information about the CalibManager that is needed to resume after an interruption. N.B. This is not currently the complete state, some of which relies on nested and frozen functions. As such, the ‘resume’ logic relies on the existence of the original configuration script. :param **kwargs: extra info
Returns: None
- cleanup()[source]¶
Cleanup the current calibration - Delete the result directory - If LOCAL -> also delete the simulations
- property calibration_path¶
- property analyzer_list¶
- property required_components¶
idmtools_calibra.calib_site module¶
- class idmtools_calibra.calib_site.SiteFunctions(name, setup_functions, verbose=False)[source]¶
Bases:
object
A helper to take a set of bare SimConfigBuilder-modifying functions and combine them into a single function of the same format
- class idmtools_calibra.calib_site.CalibSite(name)[source]¶
Bases:
object
A class to represent the base behavior of a calibration site
- abstract get_reference_data(reference_type)[source]¶
Callback function for derived classes to pass site-specific reference data that is requested by analyzers by the relevant reference_type.
idmtools_calibra.iteration_state module¶
- class idmtools_calibra.iteration_state.IterationState(**kwargs)[source]¶
Bases:
object
Holds the settings, parameters, simulation state, analysis results, etc. for one calibtool iteration.
Allows for the resumption or extension of existing CalibManager instances from an arbitrary point in the iterative process.
- property status¶
- restore_results(iteration)[source]¶
Restore summary results from serialized state. :param iteration: the # of iteration
Returns:
- commission_iteration(next_params)[source]¶
Commission an experiment of simulations constructed from a list of combinations of random seeds, calibration sites, and the next sample points. Cache the relevant experiment and simulation information to the IterationState. :param next_params: the next sample
Returns: None
- analyze_iteration()[source]¶
Analyze the output of completed simulations by using the relevant analyzers by site. Cache the results that are returned by those analyzers.
- property iteration_directory¶
- property iteration_file¶
- property param_names¶
idmtools_calibra.process_state module¶
idmtools_calibra.resample_manager module¶
- class idmtools_calibra.resample_manager.ResampleManager(steps, calibration_manager: CalibManager, restart_at_step=None)[source]¶
Bases:
object
idmtools_calibra.rmse_site module¶
- class idmtools_calibra.rmse_site.RMSESiteSingleChannel(name, reference_sources={'just_one': 'reference/output.csv'})[source]¶
Bases:
CalibSite
- get_reference_data(reference_type=None)[source]¶
Callback function for derived classes to pass site-specific reference data that is requested by analyzers by the relevant reference_type.
idmtools_calibra.singularity_json_python_task module¶
- class idmtools_calibra.singularity_json_python_task.SingularityJSONConfiguredPythonTask(command: Union[str, idmtools.entities.command_line.CommandLine] = <property object at 0x7f827dad8f40>, platform_requirements: Set[idmtools.entities.platform_requirements.PlatformRequirements] = <factory>, _ITask__pre_creation_hooks: List[Callable[[Union[ForwardRef('Simulation'), ForwardRef('IWorkflowItem')], ForwardRef('IPlatform')], NoReturn]] = <factory>, _ITask__post_creation_hooks: List[Callable[[Union[ForwardRef('Simulation'), ForwardRef('IWorkflowItem')], ForwardRef('IPlatform')], NoReturn]] = <factory>, common_assets: idmtools.assets.asset_collection.AssetCollection = <factory>, transient_assets: idmtools.assets.asset_collection.AssetCollection = <factory>, script_path: str = None, python_path: str = 'python', parameters: dict = <factory>, envelope: str = None, config_file_name: str = 'config.json', is_config_common: bool = False, configfile_argument: Optional[str] = '--config', command_line_argument_no_filename: bool = False, provided_command: Optional[idmtools.entities.command_line.CommandLine] = <factory>)[source]¶
Bases:
JSONConfiguredPythonTask
- provided_command: CommandLine | None¶
- pre_creation(parent, platform)[source]¶
Pre-creation.
- Parameters:
parent – Parent of task
platform – Platform Python Script is being executed on
- Returns:
None