diff --git a/docs-out/_build/doctrees/PyCTBN.PyCTBN.structure_graph.doctree b/docs-out/_build/doctrees/PyCTBN.PyCTBN.structure_graph.doctree index 0b47057..ff37c2f 100644 Binary files a/docs-out/_build/doctrees/PyCTBN.PyCTBN.structure_graph.doctree and b/docs-out/_build/doctrees/PyCTBN.PyCTBN.structure_graph.doctree differ diff --git a/docs-out/_build/doctrees/PyCTBN.PyCTBN.utility.doctree b/docs-out/_build/doctrees/PyCTBN.PyCTBN.utility.doctree index 164c20f..42ffafe 100644 Binary files a/docs-out/_build/doctrees/PyCTBN.PyCTBN.utility.doctree and b/docs-out/_build/doctrees/PyCTBN.PyCTBN.utility.doctree differ diff --git a/docs-out/_build/doctrees/PyCTBN.doctree b/docs-out/_build/doctrees/PyCTBN.doctree index dc97e78..ce192eb 100644 Binary files a/docs-out/_build/doctrees/PyCTBN.doctree and b/docs-out/_build/doctrees/PyCTBN.doctree differ diff --git a/docs-out/_build/doctrees/PyCTBN.tests.structure_graph.doctree b/docs-out/_build/doctrees/PyCTBN.tests.structure_graph.doctree index 07fd39e..68a2fee 100644 Binary files a/docs-out/_build/doctrees/PyCTBN.tests.structure_graph.doctree and b/docs-out/_build/doctrees/PyCTBN.tests.structure_graph.doctree differ diff --git a/docs-out/_build/doctrees/environment.pickle b/docs-out/_build/doctrees/environment.pickle index 072d2a5..1749403 100644 Binary files a/docs-out/_build/doctrees/environment.pickle and b/docs-out/_build/doctrees/environment.pickle differ diff --git a/docs-out/_build/doctrees/example.doctree b/docs-out/_build/doctrees/example.doctree new file mode 100644 index 0000000..cc7921e Binary files /dev/null and b/docs-out/_build/doctrees/example.doctree differ diff --git a/docs-out/_build/doctrees/modules.doctree b/docs-out/_build/doctrees/modules.doctree index 1338171..7725a08 100644 Binary files a/docs-out/_build/doctrees/modules.doctree and b/docs-out/_build/doctrees/modules.doctree differ diff --git a/docs-out/_build/html/PyCTBN.PyCTBN.html b/docs-out/_build/html/PyCTBN.PyCTBN.html index bd6313d..29ef30a 100644 --- a/docs-out/_build/html/PyCTBN.PyCTBN.html +++ b/docs-out/_build/html/PyCTBN.PyCTBN.html @@ -142,18 +142,22 @@
PyCTBN.PyCTBN.structure_graph.conditional_intensity_matrix.
ConditionalIntensityMatrix
(state_residence_times: numpy.array, state_transition_matrix: numpy.array)¶PyCTBN.PyCTBN.structure_graph.conditional_intensity_matrix.
ConditionalIntensityMatrix
(state_residence_times: numpy.array = None, state_transition_matrix: numpy.array = None, cim: numpy.array = None)¶
Bases: object
Abstracts the Conditional Intesity matrix of a node as aggregation of the state residence times vector and state transition matrix and the actual CIM matrix.
@@ -163,6 +163,83 @@ The class member_c
PyCTBN.PyCTBN.structure_graph.network_generator.
NetworkGenerator
(labels, vals)¶Bases: object
Provides the methods to generate a network graph and the CIMs related to it +Items in _labels, _vals and _indxs are related, and therefore respect the same order
+_labels (List) – List of variables labels that will be part of the network
_vals (List) – List of cardinalities of the variables in network (defined in the same order as _labels)
_indxs (List) – List of the nodes indexes
_cims (Dict) – It contains, for each variable label (the key), the SetOfCims object related to it
_graph (NetworkGraph) – The NetworkGraph object representing the generated structure
cims
¶dyn_str
¶generate_cims
(min_val, max_val)¶(actually generated by private method __generate_cim) according to parents possibles states of every node. +This method must obviously be executed after the graph has been generated.
+min_val (float) – Minimum value allowed for the coefficients in the CIMs
max_val (float) – Maximum value allowed for the coefficients in the CIMs
generate_graph
(density, fixed: bool = False)¶to represent the network
+density (float) – Probability of an edge between two nodes to exist
fixed (bool) – Specifies whether the required density is mandatory or it’s just a probability
graph
¶variables
¶<
PyCTBN.PyCTBN.structure_graph.set_of_cims module¶
-
-class
PyCTBN.PyCTBN.structure_graph.set_of_cims.
SetOfCims
(node_id: str, parents_states_number: List, node_states_number: int, p_combs: numpy.ndarray)¶
+class PyCTBN.PyCTBN.structure_graph.set_of_cims.
SetOfCims
(node_id: str, parents_states_number: List, node_states_number: int, p_combs: numpy.ndarray, cims: numpy.ndarray = None)¶
Bases: object
Aggregates all the CIMS of the node identified by the label _node_id.
@@ -780,6 +857,77 @@ The class member _t
+
PyCTBN.PyCTBN.structure_graph.trajectory_generator.
TrajectoryGenerator
(importer: PyCTBN.PyCTBN.utility.abstract_importer.AbstractImporter = None, variables: pandas.core.frame.DataFrame = None, dyn_str: pandas.core.frame.DataFrame = None, dyn_cims: dict = None)¶Bases: object
Provides the methods to generate a trajectory basing on the network defined +in the importer.
+_importer (AbstractImporter) – the Importer object which contains the imported and processed data
_vnames (List) – List of the variables labels that belong to the network
_parents (Dict) – It contains, for each variable label (the key), the list of related parents labels
_cims (Dict) – It contains, for each variable label (the key), the SetOfCims object related to it
_generated_trajectory (pandas.DataFrame) – Result of the execution of CTBN_Sample, contains the output trajectory
CTBN_Sample
(t_end=- 1, max_tr=- 1)¶on the coefficients defined in the CIMs. +The variables are initialized with value 0, and the method takes care of adding the +conventional last row made up of -1.
+t_end (float) – If defined, the sampling ends when end time is reached
max_tr (int) – Parameter taken in consideration in case that t_end isn’t defined. It specifies the number of transitions to execute
multi_trajectory
(t_ends: list = None, max_trs: list = None)¶Generate n trajectories in parallel, where n is the number of items in +t_ends, if defined, or the number of items in max_trs otherwise
+t_ends (list) – List of t_end values for the trajectories that will be generated
max_trs (list) – List of max_tr values for the trajectories that will be generated
worker
(t_end, max_tr, trajectories)¶Single process that will be executed in parallel in order to generate one trajectory.
+t_end (float) – If defined, the sampling ends when end time is reached
max_tr (int) – Parameter taken in consideration in case that t_end isn’t defined. It specifies the number of transitions to execute
trajectories (list) – Shared list that contains to which the generated trajectory is added
PyCTBN.PyCTBN.utility.abstract_exporter.
AbstractExporter
(variables: pandas.core.frame.DataFrame = None, dyn_str: pandas.core.frame.DataFrame = None, dyn_cims: dict = None)¶Bases: abc.ABC
Abstract class that exposes the methods to save in json format a network information +along with one or more trajectories generated basing on it
+_variables (pandas.DataFrame) – Dataframe containing the nodes labels and cardinalities
_dyn_str (pandas.DataFrame) – Dataframe containing the structure of the network (edges)
_dyn_cims (dict) – It contains, for every variable (label is the key), the SetOfCims object related to it
_trajectories (List) – List of trajectories, that can be added subsequently
add_trajectory
(trajectory: list)¶Add a new trajectory to the current list
+trajectory (pandas.DataFrame) – The trajectory to add
+out_file
(filename)¶(variables, dyn_str, dyn_cims and trajectories)
+filename (string) – Name of the output file (it must include json extension)
+PyCTBN.PyCTBN.utility.json_exporter.
JsonExporter
(variables: pandas.core.frame.DataFrame = None, dyn_str: pandas.core.frame.DataFrame = None, dyn_cims: dict = None)¶Bases: PyCTBN.PyCTBN.utility.abstract_exporter.AbstractExporter
Provides the methods to save in json format a network information +along with one or more trajectories generated basing on it
+_variables (pandas.DataFrame) – Dataframe containing the nodes labels and cardinalities
_dyn_str (pandas.DataFrame) – Dataframe containing the structure of the network (edges)
_dyn_cims (dict) – It contains, for every variable (label is the key), the SetOfCims object related to it
_trajectories (List) – List of trajectories, that can be added subsequently
cims_to_json
() → dict¶out_file
(filename)¶(variables, dyn_str, dyn_cims and trajectories)
+filename (string) – Name of the output file (it must include json extension)
+PyCTBN.PyCTBN.utility.json_importer.
JsonImporter
(file_path: str, samples_label: str, structure_label: str, variables_label: str, time_key: str, variables_key: str)¶PyCTBN.PyCTBN.utility.json_importer.
JsonImporter
(file_path: str, samples_label: str, structure_label: str, variables_label: str, time_key: str, variables_key: str, cims_label: str = None)¶
Bases: PyCTBN.PyCTBN.utility.abstract_importer.AbstractImporter
Implements the abstracts methods of AbstractImporter and adds all the necessary methods to process and prepare the data in json extension.
diff --git a/docs-out/_build/html/PyCTBN.html b/docs-out/_build/html/PyCTBN.html index 8f6f17f..c4d5c15 100644 --- a/docs-out/_build/html/PyCTBN.html +++ b/docs-out/_build/html/PyCTBN.html @@ -142,18 +142,22 @@PyCTBN.tests.structure_graph.test_networkgenerator.
TestNetworkGenerator
(methodName='runTest')¶Bases: unittest.case.TestCase
test_generate_cims
()¶test_generate_graph
()¶PyCTBN.tests.structure_graph.test_trajectorygenerator.
TestTrajectoryGenerator
(methodName='runTest')¶Bases: unittest.case.TestCase
setUpClass
() → None¶Hook method for setting up class fixture before running tests in the class.
+test_generated_trajectory
()¶test_generated_trajectory_max_tr
()¶test_init
()¶test_multi_trajectory
()¶
|
@@ -699,6 +748,13 @@
+ |
PyCTBN.PyCTBN.structure_graph.conditional_intensity_matrix
PyCTBN.PyCTBN.structure_graph.network_generator
PyCTBN.PyCTBN.structure_graph.trajectory
PyCTBN.PyCTBN.structure_graph.trajectory_generator
PyCTBN.PyCTBN.utility
PyCTBN.PyCTBN.utility.abstract_exporter
PyCTBN.PyCTBN.utility.cache
PyCTBN.PyCTBN.utility.json_exporter
PyCTBN.tests.structure_graph.test_cim
PyCTBN.tests.structure_graph.test_networkgenerator
PyCTBN.tests.structure_graph.test_trajectory
PyCTBN.tests.structure_graph.test_trajectorygenerator
PyCTBN.PyCTBN.estimators.fam_score_calculator.
FamScoreCalculator
¶Bases: object
Has the task of calculating the FamScore of a node by using a Bayesian score function
get_fam_score
(cims: numpy.array, tau_xu: float = 0.1, alpha_xu: float = 1)¶Calculate the FamScore value of the node
marginal_likelihood_q
(cims: numpy.array, tau_xu: float = 0.1, alpha_xu: float = 1)¶Calculate the value of the marginal likelihood over q of the node identified by the label node_id
marginal_likelihood_theta
(cims: PyCTBN.PyCTBN.structure_graph.conditional_intensity_matrix.ConditionalIntensityMatrix, alpha_xu: float, alpha_xxu: float)¶Calculate the FamScore value of the node identified by the label node_id
single_cim_xu_marginal_likelihood_q
(M_xu_suff_stats: float, T_xu_suff_stats: float, tau_xu: float = 0.1, alpha_xu: float = 1)¶Calculate the marginal likelihood on q of the node when assumes a specif value and a specif parents’s assignment
single_cim_xu_marginal_likelihood_theta
(index: int, cim: PyCTBN.PyCTBN.structure_graph.conditional_intensity_matrix.ConditionalIntensityMatrix, alpha_xu: float, alpha_xxu: float)¶Calculate the marginal likelihood on q of the node when assumes a specif value and a specif parents’s assignment
single_internal_cim_xxu_marginal_likelihood_theta
(M_xxu_suff_stats: float, alpha_xxu: float = 1)¶Calculate the second part of the marginal likelihood over theta formula
variable_cim_xu_marginal_likelihood_q
(cim: PyCTBN.PyCTBN.structure_graph.conditional_intensity_matrix.ConditionalIntensityMatrix, tau_xu: float = 0.1, alpha_xu: float = 1)¶Calculate the value of the marginal likelihood over q given a cim
variable_cim_xu_marginal_likelihood_theta
(cim: PyCTBN.PyCTBN.structure_graph.conditional_intensity_matrix.ConditionalIntensityMatrix, alpha_xu: float, alpha_xxu: float)¶Calculate the value of the marginal likelihood over theta given a cim
PyCTBN.PyCTBN.estimators.parameters_estimator.
ParametersEstimator
(trajectories: PyCTBN.PyCTBN.structure_graph.trajectory.Trajectory, net_graph: PyCTBN.PyCTBN.structure_graph.network_graph.NetworkGraph)¶Bases: object
Has the task of computing the cims of particular node given the trajectories and the net structure
in the graph _net_graph
.
_net_g
compute_parameters_for_node
(node_id: str) → PyCTBN.PyCTBN.structure_graph.set_of_cims.SetOfCims¶Compute the CIMS of the node identified by the label node_id
.
_net_g
compute_state_res_time_for_node
(times: numpy.ndarray, trajectory: numpy.ndarray, cols_filter: numpy.ndarray, scalar_indexes_struct: numpy.ndarray, T: numpy.ndarray) → None¶Compute the state residence times for a node and fill the matrix T
with the results
_net_g
compute_state_transitions_for_a_node
(node_indx: int, trajectory: numpy.ndarray, cols_filter: numpy.ndarray, scalar_indexing: numpy.ndarray, M: numpy.ndarray) → None¶Compute the state residence times for a node and fill the matrices M
with the results.
_net_g
fast_init
(node_id: str) → None¶Initializes all the necessary structures for the parameters estimation for the node node_id
.
_net_g
PyCTBN.PyCTBN.estimators.structure_constraint_based_estimator module¶
--
-class PyCTBN.PyCTBN.estimators.structure_constraint_based_estimator.StructureConstraintBasedEstimator(sample_path: PyCTBN.PyCTBN.structure_graph.sample_path.SamplePath, exp_test_alfa: float, chi_test_alfa: float, known_edges: List = [], thumb_threshold: int = 25)¶
+-
+class
PyCTBN.PyCTBN.estimators.structure_constraint_based_estimator.
StructureConstraintBasedEstimator
(sample_path: PyCTBN.PyCTBN.structure_graph.sample_path.SamplePath, exp_test_alfa: float, chi_test_alfa: float, known_edges: List = [], thumb_threshold: int = 25)¶
Bases: PyCTBN.PyCTBN.estimators.structure_estimator.StructureEstimator
Has the task of estimating the network structure given the trajectories in samplepath by using a constraint-based approach.
@@ -424,8 +420,8 @@ in the graph _net_g
--
-complete_test(test_parent: str, test_child: str, parent_set: List, child_states_numb: int, tot_vars_count: int, parent_indx, child_indx) → bool¶
+-
+
complete_test
(test_parent: str, test_child: str, parent_set: List, child_states_numb: int, tot_vars_count: int, parent_indx, child_indx) → bool¶
Performs a complete independence test on the directed graphs G1 = {test_child U parent_set}
G2 = {G1 U test_parent} (added as an additional parent of the test_child).
Generates all the necessary structures and datas to perform the tests.
@@ -449,8 +445,8 @@ Generates all the necessary structures and datas to perform the tests.
--
-compute_thumb_value(parent_val, child_val, parent_set_vals)¶
+-
+
compute_thumb_value
(parent_val, child_val, parent_set_vals)¶
Compute the value to test against the thumb_threshold.
- Parameters
@@ -470,10 +466,8 @@ Generates all the necessary structures and datas to perform the tests.
-
-
ctpc_algorithm
(disable_multiprocessing: bool = False, processes_number: int = None)¶
-
Compute the CTPC algorithm over the entire net.
- Parameters
@@ -488,11 +482,9 @@ Generates all the necessary structures and datas to perform the tests.
-
-
estimate_structure
(disable_multiprocessing: bool = False, processes_number: int = None)¶
Compute the constraint-based algorithm to find the optimal structure
-
- Parameters
@@ -506,8 +498,8 @@ Generates all the necessary structures and datas to perform the tests.
--
-independence_test(child_states_numb: int, cim1: PyCTBN.PyCTBN.structure_graph.conditional_intensity_matrix.ConditionalIntensityMatrix, cim2: PyCTBN.PyCTBN.structure_graph.conditional_intensity_matrix.ConditionalIntensityMatrix, thumb_value: float, parent_indx, child_indx) → bool¶
+-
+
independence_test
(child_states_numb: int, cim1: PyCTBN.PyCTBN.structure_graph.conditional_intensity_matrix.ConditionalIntensityMatrix, cim2: PyCTBN.PyCTBN.structure_graph.conditional_intensity_matrix.ConditionalIntensityMatrix, thumb_value: float, parent_indx, child_indx) → bool¶
Compute the actual independence test using two cims.
It is performed first the exponential test and if the null hypothesis is not rejected,
it is performed also the chi_test.
@@ -529,8 +521,8 @@ it is performed also the chi_test.
--
-one_iteration_of_CTPC_algorithm(var_id: str, tot_vars_count: int) → List¶
+-
+
one_iteration_of_CTPC_algorithm
(var_id: str, tot_vars_count: int) → List¶
Performs an iteration of the CTPC algorithm using the node var_id
as test_child
.
- Parameters
@@ -545,8 +537,8 @@ it is performed also the chi_test.
PyCTBN.PyCTBN.estimators.structure_estimator module¶
--
-class PyCTBN.PyCTBN.estimators.structure_estimator.StructureEstimator(sample_path: PyCTBN.PyCTBN.structure_graph.sample_path.SamplePath, known_edges: Optional[List] = None)¶
+-
+class
PyCTBN.PyCTBN.estimators.structure_estimator.
StructureEstimator
(sample_path: PyCTBN.PyCTBN.structure_graph.sample_path.SamplePath, known_edges: List = None)¶
Bases: object
Has the task of estimating the network structure given the trajectories in samplepath
.
@@ -570,8 +562,8 @@ it is performed also the chi_test.
--
-adjacency_matrix() → numpy.ndarray¶
+-
+
adjacency_matrix
() → numpy.ndarray¶
Converts the estimated structure _complete_graph
to a boolean adjacency matrix representation.
- Returns
@@ -584,8 +576,8 @@ it is performed also the chi_test.
--
-static build_complete_graph(node_ids: List) → networkx.classes.digraph.DiGraph¶
+-
+static
build_complete_graph
(node_ids: List) → networkx.classes.digraph.DiGraph¶
Builds a complete directed graph (no self loops) given the nodes labels in the list node_ids
:
- Parameters
@@ -601,8 +593,8 @@ it is performed also the chi_test.
--
-build_removable_edges_matrix(known_edges: List)¶
+-
+
build_removable_edges_matrix
(known_edges: List)¶
Builds a boolean matrix who shows if a edge could be removed or not, based on prior knowledge given:
- Parameters
@@ -618,8 +610,8 @@ it is performed also the chi_test.
--
-abstract estimate_structure() → List¶
+-
+abstract
estimate_structure
() → List¶
Abstract method to estimate the structure
- Returns
@@ -632,8 +624,8 @@ it is performed also the chi_test.
--
-static generate_possible_sub_sets_of_size(u: List, size: int, parent_label: str)¶
+-
+static
generate_possible_sub_sets_of_size
(u: List, size: int, parent_label: str)¶
Creates a list containing all possible subsets of the list u
of size size
,
that do not contains a the node identified by parent_label
.
@@ -654,11 +646,9 @@ that do not contains a the node identified by
-
-
save_plot_estimated_structure_graph
(file_path: str) → None¶
Plot the estimated structure in a graphical model style, use .png extension.
-
- Parameters
file_path – path to save the file to
@@ -670,8 +660,8 @@ that do not contains a the node identified by
--
-save_results(file_path: str) → None¶
+-
+
save_results
(file_path: str) → None¶
Save the estimated Structure to a .json file in file_path.
- Parameters
@@ -681,8 +671,8 @@ that do not contains a the node identified by
--
-spurious_edges() → List¶
+-
+
spurious_edges
() → List¶
- Return the spurious edges present in the estimated structure, if a prior net structure is present in
_sample_path.structure
.
@@ -703,8 +693,8 @@ that do not contains a the node identified by
PyCTBN.PyCTBN.estimators.structure_score_based_estimator module¶
--
-class PyCTBN.PyCTBN.estimators.structure_score_based_estimator.StructureScoreBasedEstimator(sample_path: PyCTBN.PyCTBN.structure_graph.sample_path.SamplePath, tau_xu: int = 0.1, alpha_xu: int = 1, known_edges: List = [])¶
+-
+class
PyCTBN.PyCTBN.estimators.structure_score_based_estimator.
StructureScoreBasedEstimator
(sample_path: PyCTBN.PyCTBN.structure_graph.sample_path.SamplePath, tau_xu: int = 0.1, alpha_xu: int = 1, known_edges: List = [])¶
Bases: PyCTBN.PyCTBN.estimators.structure_estimator.StructureEstimator
Has the task of estimating the network structure given the trajectories in samplepath by
using a score based approach and differt kinds of optimization algorithms.
@@ -719,8 +709,8 @@ using a score based approach and differt kinds of optimization algorithms.
--
-estimate_parents(node_id: str, max_parents: Optional[int] = None, iterations_number: int = 40, patience: int = 10, tabu_length: Optional[int] = None, tabu_rules_duration: int = 5, optimizer: str = 'hill')¶
+-
+
estimate_parents
(node_id: str, max_parents: int = None, iterations_number: int = 40, patience: int = 10, tabu_length: int = None, tabu_rules_duration: int = 5, optimizer: str = 'hill')¶
Use the FamScore of a node in order to find the best parent nodes
- Parameters
@@ -744,10 +734,8 @@ using a score based approach and differt kinds of optimization algorithms.
-
-
estimate_structure
(max_parents: int = None, iterations_number: int = 40, patience: int = None, tabu_length: int = None, tabu_rules_duration: int = None, optimizer: str = 'tabu', disable_multiprocessing: bool = False, processes_number: int = None)¶
-
Compute the score-based algorithm to find the optimal structure
- Parameters
@@ -768,8 +756,8 @@ using a score based approach and differt kinds of optimization algorithms.
--
-get_score_from_graph(graph: PyCTBN.PyCTBN.structure_graph.network_graph.NetworkGraph, node_id: str)¶
+-
+
get_score_from_graph
(graph: PyCTBN.PyCTBN.structure_graph.network_graph.NetworkGraph, node_id: str)¶
Get the FamScore of a node
- Parameters
@@ -832,9 +820,6 @@ using a score based approach and differt kinds of optimization algorithms.
FILE_SUFFIX:'.html',
HAS_SOURCE: true
};
-
-
+
diff --git a/docs/PyCTBN.PyCTBN.html b/docs/PyCTBN.PyCTBN.html
index 17c42b8..29ef30a 100644
--- a/docs/PyCTBN.PyCTBN.html
+++ b/docs/PyCTBN.PyCTBN.html
@@ -19,10 +19,6 @@
-
-
-
-
@@ -212,9 +208,6 @@
FILE_SUFFIX:'.html',
HAS_SOURCE: true
};
-
-
+
diff --git a/docs/PyCTBN.PyCTBN.optimizers.html b/docs/PyCTBN.PyCTBN.optimizers.html
index 94e6d69..58423f2 100644
--- a/docs/PyCTBN.PyCTBN.optimizers.html
+++ b/docs/PyCTBN.PyCTBN.optimizers.html
@@ -19,10 +19,6 @@
-
-
-
-
@@ -127,8 +123,8 @@
PyCTBN.PyCTBN.optimizers.constraint_based_optimizer module¶
--
-class PyCTBN.PyCTBN.optimizers.constraint_based_optimizer.ConstraintBasedOptimizer(node_id: str, structure_estimator: PyCTBN.PyCTBN.estimators.structure_estimator.StructureEstimator, tot_vars_count: int)¶
+-
+class
PyCTBN.PyCTBN.optimizers.constraint_based_optimizer.
ConstraintBasedOptimizer
(node_id: str, structure_estimator: PyCTBN.PyCTBN.estimators.structure_estimator.StructureEstimator, tot_vars_count: int)¶
Bases: PyCTBN.PyCTBN.optimizers.optimizer.Optimizer
Optimizer class that implement a CTPC Algorithm
@@ -141,8 +137,8 @@
--
-optimize_structure()¶
+-
+
optimize_structure
()¶
Compute Optimization process for a structure_estimator by using a CTPC Algorithm
- Returns
@@ -160,8 +156,8 @@
PyCTBN.PyCTBN.optimizers.hill_climbing_search module¶
--
-class PyCTBN.PyCTBN.optimizers.hill_climbing_search.HillClimbing(node_id: str, structure_estimator: PyCTBN.PyCTBN.estimators.structure_estimator.StructureEstimator, max_parents: Optional[int] = None, iterations_number: int = 40, patience: Optional[int] = None)¶
+-
+class
PyCTBN.PyCTBN.optimizers.hill_climbing_search.
HillClimbing
(node_id: str, structure_estimator: PyCTBN.PyCTBN.estimators.structure_estimator.StructureEstimator, max_parents: int = None, iterations_number: int = 40, patience: int = None)¶
Bases: PyCTBN.PyCTBN.optimizers.optimizer.Optimizer
Optimizer class that implement Hill Climbing Search
@@ -176,8 +172,8 @@
--
-optimize_structure() → List¶
+-
+
optimize_structure
() → List¶
Compute Optimization process for a structure_estimator by using a Hill Climbing Algorithm
- Returns
@@ -195,8 +191,8 @@
PyCTBN.PyCTBN.optimizers.optimizer module¶
--
-class PyCTBN.PyCTBN.optimizers.optimizer.Optimizer(node_id: str, structure_estimator: PyCTBN.PyCTBN.estimators.structure_estimator.StructureEstimator)¶
+-
+class
PyCTBN.PyCTBN.optimizers.optimizer.
Optimizer
(node_id: str, structure_estimator: PyCTBN.PyCTBN.estimators.structure_estimator.StructureEstimator)¶
Bases: abc.ABC
Interface class for all the optimizer’s child PyCTBN
@@ -208,8 +204,8 @@
--
-abstract optimize_structure() → List¶
+-
+abstract
optimize_structure
() → List¶
Compute Optimization process for a structure_estimator
- Returns
@@ -227,8 +223,8 @@
PyCTBN.PyCTBN.optimizers.tabu_search module¶
--
-class PyCTBN.PyCTBN.optimizers.tabu_search.TabuSearch(node_id: str, structure_estimator: PyCTBN.PyCTBN.estimators.structure_estimator.StructureEstimator, max_parents: Optional[int] = None, iterations_number: int = 40, patience: Optional[int] = None, tabu_length: Optional[int] = None, tabu_rules_duration=None)¶
+-
+class
PyCTBN.PyCTBN.optimizers.tabu_search.
TabuSearch
(node_id: str, structure_estimator: PyCTBN.PyCTBN.estimators.structure_estimator.StructureEstimator, max_parents: int = None, iterations_number: int = 40, patience: int = None, tabu_length: int = None, tabu_rules_duration=None)¶
Bases: PyCTBN.PyCTBN.optimizers.optimizer.Optimizer
Optimizer class that implement Tabu Search
@@ -245,8 +241,8 @@
--
-optimize_structure() → List¶
+-
+
optimize_structure
() → List¶
Compute Optimization process for a structure_estimator by using a Hill Climbing Algorithm
- Returns
@@ -303,9 +299,6 @@
FILE_SUFFIX:'.html',
HAS_SOURCE: true
};
-
-
+
diff --git a/docs/PyCTBN.PyCTBN.structure_graph.html b/docs/PyCTBN.PyCTBN.structure_graph.html
index 6f9561a..4739196 100644
--- a/docs/PyCTBN.PyCTBN.structure_graph.html
+++ b/docs/PyCTBN.PyCTBN.structure_graph.html
@@ -19,10 +19,6 @@
-
-
-
-
@@ -127,8 +123,8 @@
PyCTBN.PyCTBN.structure_graph.conditional_intensity_matrix module¶
--
-class PyCTBN.PyCTBN.structure_graph.conditional_intensity_matrix.ConditionalIntensityMatrix(state_residence_times: Optional[numpy.array] = None, state_transition_matrix: Optional[numpy.array] = None, cim: Optional[numpy.array] = None)¶
+-
+class
PyCTBN.PyCTBN.structure_graph.conditional_intensity_matrix.
ConditionalIntensityMatrix
(state_residence_times: numpy.array = None, state_transition_matrix: numpy.array = None, cim: numpy.array = None)¶
Bases: object
Abstracts the Conditional Intesity matrix of a node as aggregation of the state residence times vector
and state transition matrix and the actual CIM matrix.
@@ -143,36 +139,36 @@ and state transition matrix and the actual CIM matrix.
the actual cim of the node
-
-
-
+
+
PyCTBN.PyCTBN.structure_graph.network_generator module¶
--
-class PyCTBN.PyCTBN.structure_graph.network_generator.NetworkGenerator(labels, vals)¶
+-
+class
PyCTBN.PyCTBN.structure_graph.network_generator.
NetworkGenerator
(labels, vals)¶
Bases: object
Provides the methods to generate a network graph and the CIMs related to it
Items in _labels, _vals and _indxs are related, and therefore respect the same order
@@ -187,19 +183,19 @@ Items in _labels, _vals and _indxs are related, and therefore respect the same o
-
--
-property cims: dict¶
+
+-
+property
cims
¶
-
--
-property dyn_str: list¶
+
+-
+property
dyn_str
¶
--
-generate_cims(min_val, max_val)¶
+-
+
generate_cims
(min_val, max_val)¶
- For each node, generate the corresponding SetOfCims. The objective is to group the CIMs
(actually generated by private method __generate_cim) according to parents possibles states of every node.
This method must obviously be executed after the graph has been generated.
@@ -216,8 +212,8 @@ This method must obviously be executed after the graph has been generated.
--
-generate_graph(density, fixed: bool = False)¶
+-
+
generate_graph
(density, fixed: bool = False)¶
- Generate the edges according to specified density, and then instantiate the NetworkGraph object
to represent the network
@@ -232,14 +228,14 @@ This method must obviously be executed after the graph has been generated.
-
@@ -248,8 +244,8 @@ This method must obviously be executed after the graph has been generated.
PyCTBN.PyCTBN.structure_graph.network_graph module¶
--
-class PyCTBN.PyCTBN.structure_graph.network_graph.NetworkGraph(graph_struct: PyCTBN.PyCTBN.structure_graph.structure.Structure)¶
+-
+class
PyCTBN.PyCTBN.structure_graph.network_graph.
NetworkGraph
(graph_struct: PyCTBN.PyCTBN.structure_graph.structure.Structure)¶
Bases: object
Abstracts the infos contained in the Structure class in the form of a directed graph.
Has the task of creating all the necessary filtering and indexing structures for parameters estimation
@@ -282,8 +278,8 @@ from one state to another
--
-add_edges(list_of_edges: List) → None¶
+-
+
add_edges
(list_of_edges: List) → None¶
Add the edges to the _graph
contained in the list list_of_edges
.
- Parameters
@@ -293,8 +289,8 @@ from one state to another
--
-add_nodes(list_of_nodes: List) → None¶
+-
+
add_nodes
(list_of_nodes: List) → None¶
Adds the nodes to the _graph
contained in the list of nodes list_of_nodes
.
Sets all the properties that identify a nodes (index, positional index, cardinality)
@@ -305,8 +301,8 @@ Sets all the properties that identify a nodes (index, positional index, cardinal
--
-static build_p_comb_structure_for_a_node(parents_values: List) → numpy.ndarray¶
+-
+static
build_p_comb_structure_for_a_node
(parents_values: List) → numpy.ndarray¶
Builds the combinatorial structure that contains the combinations of all the values contained in
parents_values
.
@@ -323,8 +319,8 @@ Sets all the properties that identify a nodes (index, positional index, cardinal
--
-static build_time_columns_filtering_for_a_node(node_indx: int, p_indxs: List) → numpy.ndarray¶
+-
+static
build_time_columns_filtering_for_a_node
(node_indx: int, p_indxs: List) → numpy.ndarray¶
Builds the necessary structure to filter the desired columns indicated by node_indx
and p_indxs
in the dataset.
This structute will be used in the computation of the state res times.
@@ -337,8 +333,8 @@ This structute will be used in the computation of the state res times.
--
-static build_time_scalar_indexing_structure_for_a_node(node_states: int, parents_vals: List) → numpy.ndarray¶
+-
+static
build_time_scalar_indexing_structure_for_a_node
(node_states: int, parents_vals: List) → numpy.ndarray¶
Builds an indexing structure for the computation of state residence times values.
- Parameters
@@ -357,8 +353,8 @@ This structute will be used in the computation of the state res times.
--
-static build_transition_filtering_for_a_node(node_indx: int, p_indxs: List, nodes_number: int) → numpy.ndarray¶
+-
+static
build_transition_filtering_for_a_node
(node_indx: int, p_indxs: List, nodes_number: int) → numpy.ndarray¶
Builds the necessary structure to filter the desired columns indicated by node_indx
and p_indxs
in the dataset.
This structure will be used in the computation of the state transitions values.
@@ -373,8 +369,8 @@ This structure will be used in the computation of the state transitions values.
--
-static build_transition_scalar_indexing_structure_for_a_node(node_states_number: int, parents_vals: List) → numpy.ndarray¶
+-
+static
build_transition_scalar_indexing_structure_for_a_node
(node_states_number: int, parents_vals: List) → numpy.ndarray¶
Builds an indexing structure for the computation of state transitions values.
- Parameters
@@ -393,19 +389,19 @@ This structure will be used in the computation of the state transitions values.
--
-clear_indexing_filtering_structures() → None¶
+-
+
clear_indexing_filtering_structures
() → None¶
Initialize all the filtering/indexing structures.
-
--
-property edges: List¶
+
+-
+property
edges
¶
--
-fast_init(node_id: str) → None¶
+-
+
fast_init
(node_id: str) → None¶
Initializes all the necessary structures for parameters estimation of the node identified by the label
node_id
@@ -416,13 +412,13 @@ node_id
--
-get_ordered_by_indx_set_of_parents(node: str) → Tuple¶
+-
+
get_ordered_by_indx_set_of_parents
(node: str) → Tuple¶
Builds the aggregated structure that holds all the infos relative to the parent set of the node, namely
(parents_labels, parents_indexes, parents_cardinalities).
@@ -439,8 +435,8 @@ node_id
--
-get_parents_by_id(node_id) → List¶
+-
+
get_parents_by_id
(node_id) → List¶
Returns a list of labels of the parents of the node node_id
- Parameters
@@ -456,18 +452,18 @@ node_id
--
-has_edge(edge: tuple) → bool¶
+-
+
has_edge
(edge: tuple) → bool¶
Check if the graph contains a specific edge
- Parameters:
edge: a tuple that rappresents the edge
@@ -477,29 +473,29 @@ node_id
-
--
-property nodes: List¶
+
+-
+property
nodes
¶
-
--
-property nodes_indexes: numpy.ndarray¶
+
+-
+property
nodes_indexes
¶
-
--
-property nodes_values: numpy.ndarray¶
+
+-
+property
nodes_values
¶
-
--
-property p_combs: numpy.ndarray¶
+
+-
+property
p_combs
¶
--
-remove_edges(list_of_edges: List) → None¶
+-
+
remove_edges
(list_of_edges: List) → None¶
Remove the edges to the graph contained in the list list_of_edges.
- Parameters
@@ -509,30 +505,30 @@ node_id
--
-remove_node(node_id: str) → None¶
+-
+
remove_node
(node_id: str) → None¶
Remove the node node_id
from all the class members.
Initialize all the filtering/indexing structures.
-
--
-property time_filtering: numpy.ndarray¶
+
+-
+property
time_filtering
¶
-
--
-property time_scalar_indexing_strucure: numpy.ndarray¶
+
+-
+property
time_scalar_indexing_strucure
¶
-
--
-property transition_filtering: numpy.ndarray¶
+
+-
+property
transition_filtering
¶
-
--
-property transition_scalar_indexing_structure: numpy.ndarray¶
+
+-
+property
transition_scalar_indexing_structure
¶
@@ -541,8 +537,8 @@ Initialize all the filtering/indexing structures.
PyCTBN.PyCTBN.structure_graph.sample_path module¶
--
-class PyCTBN.PyCTBN.structure_graph.sample_path.SamplePath(importer: PyCTBN.PyCTBN.utility.abstract_importer.AbstractImporter)¶
+-
+class
PyCTBN.PyCTBN.structure_graph.sample_path.
SamplePath
(importer: PyCTBN.PyCTBN.utility.abstract_importer.AbstractImporter)¶
Bases: object
Aggregates all the informations about the trajectories, the real structure of the sampled net and variables
cardinalites. Has the task of creating the objects Trajectory
and Structure
that will
@@ -562,41 +558,41 @@ contain the mentioned data.
--
-build_structure() → None¶
+-
+
build_structure
() → None¶
Builds the Structure
object that aggregates all the infos about the net.
--
-build_trajectories() → None¶
+-
+
build_trajectories
() → None¶
Builds the Trajectory object that will contain all the trajectories.
Clears all the unused dataframes in _importer
Object
-
--
-property has_prior_net_structure: bool¶
+
+-
+property
has_prior_net_structure
¶
-
--
-property structure: PyCTBN.PyCTBN.structure_graph.structure.Structure¶
+
+-
+property
structure
¶
-
--
-property total_variables_count: int¶
+
+-
+property
total_variables_count
¶
-
--
-property trajectories: PyCTBN.PyCTBN.structure_graph.trajectory.Trajectory¶
+
+-
+property
trajectories
¶
@@ -605,8 +601,8 @@ Clears all the unused dataframes in <
PyCTBN.PyCTBN.structure_graph.set_of_cims module¶
--
-class PyCTBN.PyCTBN.structure_graph.set_of_cims.SetOfCims(node_id: str, parents_states_number: List, node_states_number: int, p_combs: numpy.ndarray, cims: Optional[numpy.ndarray] = None)¶
+-
+class
PyCTBN.PyCTBN.structure_graph.set_of_cims.
SetOfCims
(node_id: str, parents_states_number: List, node_states_number: int, p_combs: numpy.ndarray, cims: numpy.ndarray = None)¶
Bases: object
Aggregates all the CIMS of the node identified by the label _node_id.
@@ -628,14 +624,14 @@ Clears all the unused dataframes in <
the cims of the node
-
--
-property actual_cims: numpy.ndarray¶
+
+-
+property
actual_cims
¶
--
-build_cims(state_res_times: numpy.ndarray, transition_matrices: numpy.ndarray) → None¶
+-
+
build_cims
(state_res_times: numpy.ndarray, transition_matrices: numpy.ndarray) → None¶
Build the ConditionalIntensityMatrix
objects given the state residence times and transitions matrices.
Compute the cim coefficients.The class member _actual_cims
will contain the computed cims.
@@ -649,14 +645,14 @@ Compute the cim coefficients.The class member
--
-build_times_and_transitions_structures() → None¶
+-
+
build_times_and_transitions_structures
() → None¶
Initializes at the correct dimensions the state residence times matrix and the state transition matrices.
--
-filter_cims_with_mask(mask_arr: numpy.ndarray, comb: List) → numpy.ndarray¶
+-
+
filter_cims_with_mask
(mask_arr: numpy.ndarray, comb: List) → numpy.ndarray¶
Filter the cims contained in the array _actual_cims
given the boolean mask mask_arr
and the index
comb
.
-
@@ -691,8 +687,8 @@ Compute the cim coefficients.The class member
PyCTBN.PyCTBN.structure_graph.structure module¶
--
-class PyCTBN.PyCTBN.structure_graph.structure.Structure(nodes_labels_list: List, nodes_indexes_arr: numpy.ndarray, nodes_vals_arr: numpy.ndarray, edges_list: List, total_variables_number: int)¶
+-
+class
PyCTBN.PyCTBN.structure_graph.structure.
Structure
(nodes_labels_list: List, nodes_indexes_arr: numpy.ndarray, nodes_vals_arr: numpy.ndarray, edges_list: List, total_variables_number: int)¶
Bases: object
Contains all the infos about the network structure(nodes labels, nodes caridinalites, edges, indexes)
@@ -707,28 +703,28 @@ Compute the cim coefficients.The class member
--
-add_edge(edge: tuple)¶
+-
+
add_edge
(edge: tuple)¶
-
--
-property edges: List¶
+
+-
+property
edges
¶
--
-get_node_id(node_indx: int) → str¶
+-
+
get_node_id
(node_indx: int) → str¶
Given the node_index
returns the node label.
- Parameters
@@ -744,8 +740,8 @@ Compute the cim coefficients.The class member
--
-get_node_indx(node_id: str) → int¶
+-
+
get_node_indx
(node_id: str) → int¶
Given the node_index
returns the node label.
- Parameters
@@ -761,13 +757,13 @@ Compute the cim coefficients.The class member
--
-get_positional_node_indx(node_id: str) → int¶
+-
+
get_positional_node_indx
(node_id: str) → int¶
--
-get_states_number(node: str) → int¶
+-
+
get_states_number
(node: str) → int¶
Given the node label node
returns the cardinality of the node.
- Parameters
@@ -782,36 +778,36 @@ Compute the cim coefficients.The class member
--
-property nodes_indexes: numpy.ndarray¶
+
+-
+property
nodes_indexes
¶
-
--
-property nodes_labels: List¶
+
+-
+property
nodes_labels
¶
-
--
-property nodes_values: numpy.ndarray¶
+
+-
+property
nodes_values
¶
-
@@ -820,8 +816,8 @@ The class member _t
PyCTBN.PyCTBN.structure_graph.trajectory module¶
--
-class PyCTBN.PyCTBN.structure_graph.trajectory.Trajectory(list_of_columns: List, original_cols_number: int)¶
+-
+class
PyCTBN.PyCTBN.structure_graph.trajectory.
Trajectory
(list_of_columns: List, original_cols_number: int)¶
Bases: object
Abstracts the infos about a complete set of trajectories, represented as a numpy array of doubles
(the time deltas) and a numpy matrix of ints (the changes of states).
@@ -839,32 +835,101 @@ The class member _t
the array containing the time deltas
-
+
+
+PyCTBN.PyCTBN.structure_graph.trajectory_generator module¶
+
+-
+class
PyCTBN.PyCTBN.structure_graph.trajectory_generator.
TrajectoryGenerator
(importer: PyCTBN.PyCTBN.utility.abstract_importer.AbstractImporter = None, variables: pandas.core.frame.DataFrame = None, dyn_str: pandas.core.frame.DataFrame = None, dyn_cims: dict = None)¶
+Bases: object
+Provides the methods to generate a trajectory basing on the network defined
+in the importer.
+
+- Parameters
+
+_importer (AbstractImporter) – the Importer object which contains the imported and processed data
+_vnames (List) – List of the variables labels that belong to the network
+_parents (Dict) – It contains, for each variable label (the key), the list of related parents labels
+_cims (Dict) – It contains, for each variable label (the key), the SetOfCims object related to it
+_generated_trajectory (pandas.DataFrame) – Result of the execution of CTBN_Sample, contains the output trajectory
+
+
+
+
+-
+
CTBN_Sample
(t_end=- 1, max_tr=- 1)¶
+
+- This method implements the generation of a trajectory, basing on the network structure and
on the coefficients defined in the CIMs.
+The variables are initialized with value 0, and the method takes care of adding the
+conventional last row made up of -1.
+
+
+
+- Parameters
+
+t_end (float) – If defined, the sampling ends when end time is reached
+max_tr (int) – Parameter taken in consideration in case that t_end isn’t defined. It specifies the number of transitions to execute
+
+
+
+
+
+
+-
+
multi_trajectory
(t_ends: list = None, max_trs: list = None)¶
+Generate n trajectories in parallel, where n is the number of items in
+t_ends, if defined, or the number of items in max_trs otherwise
+
+- Parameters
+
+t_ends (list) – List of t_end values for the trajectories that will be generated
+max_trs (list) – List of max_tr values for the trajectories that will be generated
+
+
+
+
+
+
+-
+
worker
(t_end, max_tr, trajectories)¶
+Single process that will be executed in parallel in order to generate one trajectory.
+
+- Parameters
+
+t_end (float) – If defined, the sampling ends when end time is reached
+max_tr (int) – Parameter taken in consideration in case that t_end isn’t defined. It specifies the number of transitions to execute
+trajectories (list) – Shared list that contains to which the generated trajectory is added
+
+
+
+
+
+
-
Module contents¶
@@ -906,9 +971,6 @@ The class member _t
FILE_SUFFIX:'.html',
HAS_SOURCE: true
};
-
-
+
diff --git a/docs/PyCTBN.PyCTBN.utility.html b/docs/PyCTBN.PyCTBN.utility.html
index 05eaa8e..fe87d56 100644
--- a/docs/PyCTBN.PyCTBN.utility.html
+++ b/docs/PyCTBN.PyCTBN.utility.html
@@ -19,10 +19,6 @@
-
-
-
-
@@ -123,14 +119,58 @@
PyCTBN.PyCTBN.utility package¶
Submodules¶
+
+
+PyCTBN.PyCTBN.utility.abstract_exporter module¶
+
+-
+class
PyCTBN.PyCTBN.utility.abstract_exporter.
AbstractExporter
(variables: pandas.core.frame.DataFrame = None, dyn_str: pandas.core.frame.DataFrame = None, dyn_cims: dict = None)¶
+Bases: abc.ABC
+Abstract class that exposes the methods to save in json format a network information
+along with one or more trajectories generated basing on it
+
+- Parameters
+
+_variables (pandas.DataFrame) – Dataframe containing the nodes labels and cardinalities
+_dyn_str (pandas.DataFrame) – Dataframe containing the structure of the network (edges)
+_dyn_cims (dict) – It contains, for every variable (label is the key), the SetOfCims object related to it
+_trajectories (List) – List of trajectories, that can be added subsequently
+
+
+
+
+-
+
add_trajectory
(trajectory: list)¶
+Add a new trajectory to the current list
+
+- Parameters
+trajectory (pandas.DataFrame) – The trajectory to add
+
+
+
+
+
+-
+abstract
out_file
(filename)¶
+
+- Create a file in current directory and write on it the previously added data
(variables, dyn_str, dyn_cims and trajectories)
+
+
+
+- Parameters
+filename (string) – Name of the output file (it must include json extension)
+
+
+
+
+
-
PyCTBN.PyCTBN.utility.abstract_importer module¶
--
-class PyCTBN.PyCTBN.utility.abstract_importer.AbstractImporter(file_path: Optional[str] = None, trajectory_list: Optional[Union[pandas.core.frame.DataFrame, numpy.ndarray]] = None, variables: Optional[pandas.core.frame.DataFrame] = None, prior_net_structure: Optional[pandas.core.frame.DataFrame] = None)¶
+-
+class
PyCTBN.PyCTBN.utility.abstract_importer.
AbstractImporter
(file_path: str = None, trajectory_list: Union[pandas.core.frame.DataFrame, numpy.ndarray] = None, variables: pandas.core.frame.DataFrame = None, prior_net_structure: pandas.core.frame.DataFrame = None)¶
Bases: abc.ABC
Abstract class that exposes all the necessary methods to process the trajectories and the net structure.
@@ -161,8 +201,8 @@ See the tutorial on how to construct a correct JsonImporter
for an example implementation
--
-build_list_of_samples_array(concatenated_sample: pandas.core.frame.DataFrame) → List¶
+-
+
build_list_of_samples_array
(concatenated_sample: pandas.core.frame.DataFrame) → List¶
Builds a List containing the the delta times numpy array, and the complete transitions matrix
- Parameters
@@ -179,8 +219,8 @@ and converted
--
-abstract build_sorter(trajecory_header: object) → List¶
+-
+abstract
build_sorter
(trajecory_header: object) → List¶
Initializes the _sorter
class member from a trajectory dataframe, exctracting the header of the frame
and keeping ONLY the variables symbolic labels, cutting out the time label in the header.
@@ -197,14 +237,14 @@ and keeping ONLY the variables symbolic labels, cutting out the time label in th
--
-clear_concatenated_frame() → None¶
+-
+
clear_concatenated_frame
() → None¶
Removes all values in the dataframe concatenated_samples.
--
-compute_row_delta_in_all_samples_frames(df_samples_list: List) → None¶
+-
+
compute_row_delta_in_all_samples_frames
(df_samples_list: List) → None¶
Calls the method compute_row_delta_sigle_samples_frame
on every dataframe present in the list
df_samples_list
.
Concatenates the result in the dataframe concatanated_samples
@@ -227,8 +267,8 @@ and merged trajectories
--
-compute_row_delta_sigle_samples_frame(sample_frame: pandas.core.frame.DataFrame, columns_header: List, shifted_cols_header: List) → pandas.core.frame.DataFrame¶
+-
+
compute_row_delta_sigle_samples_frame
(sample_frame: pandas.core.frame.DataFrame, columns_header: List, shifted_cols_header: List) → pandas.core.frame.DataFrame¶
Computes the difference between each value present in th time column.
Copies and shift by one position up all the values present in the remaining columns.
@@ -253,36 +293,36 @@ Header of sample_frame = [Time | Variable values]
-
@@ -291,8 +331,8 @@ dataset
PyCTBN.PyCTBN.utility.cache module¶
--
-class PyCTBN.PyCTBN.utility.cache.Cache¶
+-
+class
PyCTBN.PyCTBN.utility.cache.
Cache
¶
Bases: object
This class acts as a cache of SetOfCims
objects for a node.
@@ -305,14 +345,14 @@ index is related
--
-find(parents_comb: Set)¶
+-
+
find
(parents_comb: Set)¶
Tries to find in cache given the symbolic parents combination parents_comb
the SetOfCims
related to that parents_comb
.
@@ -330,8 +370,8 @@ None otherwise.
--
-put(parents_comb: Set, socim: PyCTBN.PyCTBN.structure_graph.set_of_cims.SetOfCims)¶
+-
+
put
(parents_comb: Set, socim: PyCTBN.PyCTBN.structure_graph.set_of_cims.SetOfCims)¶
Place in cache the SetOfCims
object, and the related symbolic index parents_comb
in
__list_of_sets_of_parents
.
@@ -346,14 +386,52 @@ None otherwise.
+
+
+PyCTBN.PyCTBN.utility.json_exporter module¶
+
+-
+class
PyCTBN.PyCTBN.utility.json_exporter.
JsonExporter
(variables: pandas.core.frame.DataFrame = None, dyn_str: pandas.core.frame.DataFrame = None, dyn_cims: dict = None)¶
+Bases: PyCTBN.PyCTBN.utility.abstract_exporter.AbstractExporter
+Provides the methods to save in json format a network information
+along with one or more trajectories generated basing on it
+
+- Parameters
+
+_variables (pandas.DataFrame) – Dataframe containing the nodes labels and cardinalities
+_dyn_str (pandas.DataFrame) – Dataframe containing the structure of the network (edges)
+_dyn_cims (dict) – It contains, for every variable (label is the key), the SetOfCims object related to it
+_trajectories (List) – List of trajectories, that can be added subsequently
+
+
+
+
+-
+
cims_to_json
() → dict¶
+
+
+
+-
+
out_file
(filename)¶
+
+- Create a file in current directory and write on it the previously added data
(variables, dyn_str, dyn_cims and trajectories)
+
+
+
+- Parameters
+filename (string) – Name of the output file (it must include json extension)
+
+
+
+
+
-
PyCTBN.PyCTBN.utility.json_importer module¶
--
-class PyCTBN.PyCTBN.utility.json_importer.JsonImporter(file_path: str, samples_label: str, structure_label: str, variables_label: str, time_key: str, variables_key: str, cims_label: Optional[str] = None)¶
+-
+class
PyCTBN.PyCTBN.utility.json_importer.
JsonImporter
(file_path: str, samples_label: str, structure_label: str, variables_label: str, time_key: str, variables_key: str, cims_label: str = None)¶
Bases: PyCTBN.PyCTBN.utility.abstract_importer.AbstractImporter
Implements the abstracts methods of AbstractImporter and adds all the necessary methods to process and prepare
the data in json extension.
@@ -379,29 +457,27 @@ the data in json extension.
--
-build_sorter(sample_frame: pandas.core.frame.DataFrame) → List¶
+-
+
build_sorter
(sample_frame: pandas.core.frame.DataFrame) → List¶
Implements the abstract method build_sorter of the AbstractImporter
for this dataset.
--
-clear_data_frame_list() → None¶
+-
+
clear_data_frame_list
() → None¶
Removes all values present in the dataframes in the list _df_samples_list
.
--
-dataset_id() → object¶
+-
+
dataset_id
() → object¶
If the original dataset contains multiple dataset, this method returns a unique id to identify the current
dataset
-
-
import_data
(indx: int = 0) → None¶
-
Implements the abstract method of AbstractImporter
.
- Parameters
@@ -411,8 +487,8 @@ dataset
--
-import_sampled_cims(raw_data: List, indx: int, cims_key: str) → Dict¶
+-
+
import_sampled_cims
(raw_data: List, indx: int, cims_key: str) → Dict¶
Imports the synthetic CIMS in the dataset in a dictionary, using variables labels
as keys for the set of CIMS of a particular node.
@@ -433,8 +509,8 @@ as keys for the set of CIMS of a particular node.
--
-import_structure(raw_data: List) → pandas.core.frame.DataFrame¶
+-
+
import_structure
(raw_data: List) → pandas.core.frame.DataFrame¶
Imports in a dataframe the data in the list raw_data at the key _structure_label
- Parameters
@@ -450,8 +526,8 @@ as keys for the set of CIMS of a particular node.
--
-import_trajectories(raw_data: List) → List¶
+-
+
import_trajectories
(raw_data: List) → List¶
Imports the trajectories from the list of dicts raw_data
.
- Parameters
@@ -467,8 +543,8 @@ as keys for the set of CIMS of a particular node.
--
-import_variables(raw_data: List) → pandas.core.frame.DataFrame¶
+-
+
import_variables
(raw_data: List) → pandas.core.frame.DataFrame¶
Imports the data in raw_data
at the key _variables_label
.
- Parameters
@@ -484,8 +560,8 @@ as keys for the set of CIMS of a particular node.
--
-normalize_trajectories(raw_data: List, indx: int, trajectories_key: str) → List¶
+-
+
normalize_trajectories
(raw_data: List, indx: int, trajectories_key: str) → List¶
Extracts the trajectories in raw_data
at the index index
at the key trajectories key
.
- Parameters
@@ -505,8 +581,8 @@ as keys for the set of CIMS of a particular node.
--
-one_level_normalizing(raw_data: List, indx: int, key: str) → pandas.core.frame.DataFrame¶
+-
+
one_level_normalizing
(raw_data: List, indx: int, key: str) → pandas.core.frame.DataFrame¶
Extracts the one-level nested data in the list raw_data
at the index indx
at the key key
.
- Parameters
@@ -526,8 +602,8 @@ as keys for the set of CIMS of a particular node.
--
-read_json_file() → List¶
+-
+
read_json_file
() → List¶
Reads the JSON file in the path self.filePath.
- Returns
@@ -545,8 +621,8 @@ as keys for the set of CIMS of a particular node.
PyCTBN.PyCTBN.utility.sample_importer module¶
--
-class PyCTBN.PyCTBN.utility.sample_importer.SampleImporter(trajectory_list: Optional[Union[pandas.core.frame.DataFrame, numpy.ndarray, List]] = None, variables: Optional[Union[pandas.core.frame.DataFrame, numpy.ndarray, List]] = None, prior_net_structure: Optional[Union[pandas.core.frame.DataFrame, numpy.ndarray, List]] = None)¶
+-
+class
PyCTBN.PyCTBN.utility.sample_importer.
SampleImporter
(trajectory_list: Union[pandas.core.frame.DataFrame, numpy.ndarray, List] = None, variables: Union[pandas.core.frame.DataFrame, numpy.ndarray, List] = None, prior_net_structure: Union[pandas.core.frame.DataFrame, numpy.ndarray, List] = None)¶
Bases: PyCTBN.PyCTBN.utility.abstract_importer.AbstractImporter
Implements the abstracts methods of AbstractImporter and adds all the necessary methods to process and prepare
the data loaded directly by using DataFrame
@@ -566,21 +642,21 @@ the data loaded directly by using DataFrame
--
-build_sorter(sample_frame: pandas.core.frame.DataFrame) → List¶
+-
+
build_sorter
(sample_frame: pandas.core.frame.DataFrame) → List¶
Implements the abstract method build_sorter of the AbstractImporter
in order to get the ordered variables list.
@@ -628,9 +704,6 @@ dataset
FILE_SUFFIX:'.html',
HAS_SOURCE: true
};
-
-
+
diff --git a/docs/PyCTBN.html b/docs/PyCTBN.html
index a6024f3..c4d5c15 100644
--- a/docs/PyCTBN.html
+++ b/docs/PyCTBN.html
@@ -19,10 +19,6 @@
-
-
-
-
@@ -177,29 +173,29 @@
- PyCTBN.tests.estimators package
- Submodules
- PyCTBN.tests.estimators.test_parameters_estimator module
-- PyCTBN.tests.estimators.test_structure_constraint_based_estimator module
+- PyCTBN.tests.estimators.test_structure_constraint_based_estimator module
- PyCTBN.tests.estimators.test_structure_estimator module
-- PyCTBN.tests.estimators.test_structure_score_based_estimator module
+- PyCTBN.tests.estimators.test_structure_score_based_estimator module
- Module contents
- PyCTBN.tests.optimizers package
- PyCTBN.tests.structure_graph package
- Submodules
- PyCTBN.tests.structure_graph.test_cim module
-- PyCTBN.tests.structure_graph.test_networkgenerator module
+- PyCTBN.tests.structure_graph.test_networkgenerator module
- PyCTBN.tests.structure_graph.test_networkgraph module
- PyCTBN.tests.structure_graph.test_sample_path module
- PyCTBN.tests.structure_graph.test_setofcims module
- PyCTBN.tests.structure_graph.test_structure module
- PyCTBN.tests.structure_graph.test_trajectory module
-- PyCTBN.tests.structure_graph.test_trajectorygenerator module
+- PyCTBN.tests.structure_graph.test_trajectorygenerator module
- Module contents
@@ -221,10 +217,14 @@
Submodules¶
-
+
+
+PyCTBN.basic_main module¶
+
+
+PyCTBN.setup module¶
-
Module contents¶
@@ -257,9 +257,6 @@
FILE_SUFFIX:'.html',
HAS_SOURCE: true
};
-
-
+
diff --git a/docs/PyCTBN.tests.estimators.html b/docs/PyCTBN.tests.estimators.html
index c39f871..8a63d1f 100644
--- a/docs/PyCTBN.tests.estimators.html
+++ b/docs/PyCTBN.tests.estimators.html
@@ -19,10 +19,6 @@
-
-
-
-
@@ -124,43 +120,42 @@
PyCTBN.tests.estimators.test_parameters_estimator module¶
--
-class PyCTBN.tests.estimators.test_parameters_estimator.TestParametersEstimatior(methodName='runTest')¶
+-
+class
PyCTBN.tests.estimators.test_parameters_estimator.
TestParametersEstimatior
(methodName='runTest')¶
Bases: unittest.case.TestCase
--
-equality_of_cims_of_node(sampled_cims, estimated_cims)¶
+-
+
equality_of_cims_of_node
(sampled_cims, estimated_cims)¶
-
PyCTBN.tests.estimators.test_structure_constraint_based_estimator module¶
@@ -193,61 +188,59 @@
-
PyCTBN.tests.estimators.test_structure_estimator module¶
--
-class PyCTBN.tests.estimators.test_structure_estimator.TestStructureEstimator(methodName='runTest')¶
+-
+class
PyCTBN.tests.estimators.test_structure_estimator.
TestStructureEstimator
(methodName='runTest')¶
Bases: unittest.case.TestCase
-
PyCTBN.tests.estimators.test_structure_score_based_estimator module¶
@@ -317,9 +310,6 @@
FILE_SUFFIX:'.html',
HAS_SOURCE: true
};
-
-
+
diff --git a/docs/PyCTBN.tests.html b/docs/PyCTBN.tests.html
index 57c3a3d..7036b72 100644
--- a/docs/PyCTBN.tests.html
+++ b/docs/PyCTBN.tests.html
@@ -19,10 +19,6 @@
-
-
-
-
@@ -125,29 +121,29 @@
- PyCTBN.tests.estimators package
- Submodules
- PyCTBN.tests.estimators.test_parameters_estimator module
-- PyCTBN.tests.estimators.test_structure_constraint_based_estimator module
+- PyCTBN.tests.estimators.test_structure_constraint_based_estimator module
- PyCTBN.tests.estimators.test_structure_estimator module
-- PyCTBN.tests.estimators.test_structure_score_based_estimator module
+- PyCTBN.tests.estimators.test_structure_score_based_estimator module
- Module contents
- PyCTBN.tests.optimizers package
- PyCTBN.tests.structure_graph package
- Submodules
- PyCTBN.tests.structure_graph.test_cim module
-- PyCTBN.tests.structure_graph.test_networkgenerator module
+- PyCTBN.tests.structure_graph.test_networkgenerator module
- PyCTBN.tests.structure_graph.test_networkgraph module
- PyCTBN.tests.structure_graph.test_sample_path module
- PyCTBN.tests.structure_graph.test_setofcims module
- PyCTBN.tests.structure_graph.test_structure module
- PyCTBN.tests.structure_graph.test_trajectory module
-- PyCTBN.tests.structure_graph.test_trajectorygenerator module
+- PyCTBN.tests.structure_graph.test_trajectorygenerator module
- Module contents
@@ -195,9 +191,6 @@
FILE_SUFFIX:'.html',
HAS_SOURCE: true
};
-
-
+
diff --git a/docs/PyCTBN.tests.optimizers.html b/docs/PyCTBN.tests.optimizers.html
index 2e20c9a..96038cc 100644
--- a/docs/PyCTBN.tests.optimizers.html
+++ b/docs/PyCTBN.tests.optimizers.html
@@ -19,10 +19,6 @@
-
-
-
-
@@ -204,9 +200,6 @@
FILE_SUFFIX:'.html',
HAS_SOURCE: true
};
-
-
+
diff --git a/docs/PyCTBN.tests.structure_graph.html b/docs/PyCTBN.tests.structure_graph.html
index 581cd0c..a63e83d 100644
--- a/docs/PyCTBN.tests.structure_graph.html
+++ b/docs/PyCTBN.tests.structure_graph.html
@@ -19,10 +19,6 @@
-
-
-
-
@@ -124,28 +120,47 @@
PyCTBN.tests.structure_graph.test_cim module¶
--
-class PyCTBN.tests.structure_graph.test_cim.TestConditionalIntensityMatrix(methodName='runTest')¶
+-
+class
PyCTBN.tests.structure_graph.test_cim.
TestConditionalIntensityMatrix
(methodName='runTest')¶
Bases: unittest.case.TestCase
+
+
+
+
+
+PyCTBN.tests.structure_graph.test_networkgenerator module¶
+
+-
+class
PyCTBN.tests.structure_graph.test_networkgenerator.
TestNetworkGenerator
(methodName='runTest')¶
+Bases: unittest.case.TestCase
+
+-
+
test_generate_cims
()¶
+
+
+
+-
+
test_generate_graph
()¶
@@ -154,103 +169,103 @@
PyCTBN.tests.structure_graph.test_networkgraph module¶
--
-class PyCTBN.tests.structure_graph.test_networkgraph.TestNetworkGraph(methodName='runTest')¶
+-
+class
PyCTBN.tests.structure_graph.test_networkgraph.
TestNetworkGraph
(methodName='runTest')¶
Bases: unittest.case.TestCase
--
-aux_build_time_columns_filtering_structure_for_a_node(graph, node_id, p_indxs)¶
+-
+
aux_build_time_columns_filtering_structure_for_a_node
(graph, node_id, p_indxs)¶
--
-aux_build_time_scalar_indexing_structure_for_a_node(graph, node_id, parents_indxs, parents_labels, parents_vals)¶
+-
+
aux_build_time_scalar_indexing_structure_for_a_node
(graph, node_id, parents_indxs, parents_labels, parents_vals)¶
--
-aux_build_transition_columns_filtering_structure(graph, node_id, p_indxs)¶
+-
+
aux_build_transition_columns_filtering_structure
(graph, node_id, p_indxs)¶
--
-aux_build_transition_scalar_indexing_structure_for_a_node(graph, node_id, parents_indxs, parents_labels, parents_values)¶
+-
+
aux_build_transition_scalar_indexing_structure_for_a_node
(graph, node_id, parents_indxs, parents_labels, parents_values)¶
--
-classmethod setUpClass()¶
+-
+classmethod
setUpClass
()¶
Hook method for setting up class fixture before running tests in the class.
--
-test_build_time_columns_filtering_structure_for_a_node()¶
+-
+
test_build_time_columns_filtering_structure_for_a_node
()¶
--
-test_build_time_scalar_indexing_structure_for_a_node()¶
+-
+
test_build_time_scalar_indexing_structure_for_a_node
()¶
--
-test_build_transition_columns_filtering_structure()¶
+-
+
test_build_transition_columns_filtering_structure
()¶
@@ -259,58 +274,58 @@
PyCTBN.tests.structure_graph.test_sample_path module¶
--
-class PyCTBN.tests.structure_graph.test_sample_path.TestSamplePath(methodName='runTest')¶
+-
+class
PyCTBN.tests.structure_graph.test_sample_path.
TestSamplePath
(methodName='runTest')¶
Bases: unittest.case.TestCase
--
-classmethod setUpClass() → None¶
+-
+classmethod
setUpClass
() → None¶
Hook method for setting up class fixture before running tests in the class.
@@ -319,27 +334,27 @@
PyCTBN.tests.structure_graph.test_setofcims module¶
--
-class PyCTBN.tests.structure_graph.test_setofcims.TestSetOfCims(methodName='runTest')¶
+-
+class
PyCTBN.tests.structure_graph.test_setofcims.
TestSetOfCims
(methodName='runTest')¶
Bases: unittest.case.TestCase
--
-another_filtering_method(p_combs, mask, parent_value)¶
+-
+
another_filtering_method
(p_combs, mask, parent_value)¶
--
-aux_test_build_cims(node_id, p_values, node_states, p_combs)¶
+-
+
aux_test_build_cims
(node_id, p_values, node_states, p_combs)¶
--
-aux_test_init(node_id, parents_states_number, node_states_number, p_combs)¶
+-
+
aux_test_init
(node_id, parents_states_number, node_states_number, p_combs)¶
--
-build_p_comb_structure_for_a_node(parents_values)¶
+-
+
build_p_comb_structure_for_a_node
(parents_values)¶
Builds the combinatory structure that contains the combinations of all the values contained in parents_values.
- Parameters:
parents_values: the cardinalities of the nodes
@@ -350,24 +365,24 @@
@@ -376,53 +391,53 @@
PyCTBN.tests.structure_graph.test_structure module¶
--
-class PyCTBN.tests.structure_graph.test_structure.TestStructure(methodName='runTest')¶
+-
+class
PyCTBN.tests.structure_graph.test_structure.
TestStructure
(methodName='runTest')¶
Bases: unittest.case.TestCase
@@ -431,22 +446,56 @@
PyCTBN.tests.structure_graph.test_trajectory module¶
--
-class PyCTBN.tests.structure_graph.test_trajectory.TestTrajectory(methodName='runTest')¶
+-
+class
PyCTBN.tests.structure_graph.test_trajectory.
TestTrajectory
(methodName='runTest')¶
Bases: unittest.case.TestCase
+
+
+PyCTBN.tests.structure_graph.test_trajectorygenerator module¶
+
+-
+class
PyCTBN.tests.structure_graph.test_trajectorygenerator.
TestTrajectoryGenerator
(methodName='runTest')¶
+Bases: unittest.case.TestCase
+
+-
+classmethod
setUpClass
() → None¶
+Hook method for setting up class fixture before running tests in the class.
+
+
+
+-
+
test_generated_trajectory
()¶
+
+
+
+-
+
test_generated_trajectory_max_tr
()¶
+
+
+
+-
+
test_init
()¶
+
+
+
+-
+
test_multi_trajectory
()¶
+
+
+
@@ -482,9 +531,6 @@
FILE_SUFFIX:'.html',
HAS_SOURCE: true
};
-
-
+
diff --git a/docs/PyCTBN.tests.utility.html b/docs/PyCTBN.tests.utility.html
index 6e10516..606ce71 100644
--- a/docs/PyCTBN.tests.utility.html
+++ b/docs/PyCTBN.tests.utility.html
@@ -19,10 +19,6 @@
-
-
-
-
@@ -124,27 +120,27 @@
PyCTBN.tests.utility.test_cache module¶
--
-class PyCTBN.tests.utility.test_cache.TestCache(methodName='runTest')¶
+-
+class
PyCTBN.tests.utility.test_cache.
TestCache
(methodName='runTest')¶
Bases: unittest.case.TestCase
@@ -153,108 +149,108 @@
PyCTBN.tests.utility.test_json_importer module¶
--
-class PyCTBN.tests.utility.test_json_importer.TestJsonImporter(methodName='runTest')¶
+-
+class
PyCTBN.tests.utility.test_json_importer.
TestJsonImporter
(methodName='runTest')¶
Bases: unittest.case.TestCase
--
-classmethod setUpClass() → None¶
+-
+classmethod
setUpClass
() → None¶
Hook method for setting up class fixture before running tests in the class.
@@ -263,28 +259,28 @@
PyCTBN.tests.utility.test_sample_importer module¶
--
-class PyCTBN.tests.utility.test_sample_importer.TestSampleImporter(methodName='runTest')¶
+-
+class
PyCTBN.tests.utility.test_sample_importer.
TestSampleImporter
(methodName='runTest')¶
Bases: unittest.case.TestCase
@@ -323,9 +319,6 @@
FILE_SUFFIX:'.html',
HAS_SOURCE: true
};
-
-
+
diff --git a/docs/_static/basic.css b/docs/_static/basic.css
index aa9df31..24a49f0 100644
--- a/docs/_static/basic.css
+++ b/docs/_static/basic.css
@@ -4,7 +4,7 @@
*
* Sphinx stylesheet -- basic theme.
*
- * :copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS.
+ * :copyright: Copyright 2007-2020 by the Sphinx team, see AUTHORS.
* :license: BSD, see LICENSE for details.
*
*/
@@ -130,7 +130,7 @@ ul.search li a {
font-weight: bold;
}
-ul.search li p.context {
+ul.search li div.context {
color: #888;
margin: 2px 0 0 30px;
text-align: left;
@@ -277,25 +277,25 @@ p.rubric {
font-weight: bold;
}
-img.align-left, figure.align-left, .figure.align-left, object.align-left {
+img.align-left, .figure.align-left, object.align-left {
clear: left;
float: left;
margin-right: 1em;
}
-img.align-right, figure.align-right, .figure.align-right, object.align-right {
+img.align-right, .figure.align-right, object.align-right {
clear: right;
float: right;
margin-left: 1em;
}
-img.align-center, figure.align-center, .figure.align-center, object.align-center {
+img.align-center, .figure.align-center, object.align-center {
display: block;
margin-left: auto;
margin-right: auto;
}
-img.align-default, figure.align-default, .figure.align-default {
+img.align-default, .figure.align-default {
display: block;
margin-left: auto;
margin-right: auto;
@@ -319,8 +319,7 @@ img.align-default, figure.align-default, .figure.align-default {
/* -- sidebars -------------------------------------------------------------- */
-div.sidebar,
-aside.sidebar {
+div.sidebar {
margin: 0 0 0.5em 1em;
border: 1px solid #ddb;
padding: 7px;
@@ -378,14 +377,12 @@ div.body p.centered {
/* -- content of sidebars/topics/admonitions -------------------------------- */
div.sidebar > :last-child,
-aside.sidebar > :last-child,
div.topic > :last-child,
div.admonition > :last-child {
margin-bottom: 0;
}
div.sidebar::after,
-aside.sidebar::after,
div.topic::after,
div.admonition::after,
blockquote::after {
@@ -458,22 +455,20 @@ td > :last-child {
/* -- figures --------------------------------------------------------------- */
-div.figure, figure {
+div.figure {
margin: 0.5em;
padding: 0.5em;
}
-div.figure p.caption, figcaption {
+div.figure p.caption {
padding: 0.3em;
}
-div.figure p.caption span.caption-number,
-figcaption span.caption-number {
+div.figure p.caption span.caption-number {
font-style: italic;
}
-div.figure p.caption span.caption-text,
-figcaption span.caption-text {
+div.figure p.caption span.caption-text {
}
/* -- field list styles ----------------------------------------------------- */
@@ -508,63 +503,6 @@ table.hlist td {
vertical-align: top;
}
-/* -- object description styles --------------------------------------------- */
-
-.sig {
- font-family: 'Consolas', 'Menlo', 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', monospace;
-}
-
-.sig-name, code.descname {
- background-color: transparent;
- font-weight: bold;
-}
-
-.sig-name {
- font-size: 1.1em;
-}
-
-code.descname {
- font-size: 1.2em;
-}
-
-.sig-prename, code.descclassname {
- background-color: transparent;
-}
-
-.optional {
- font-size: 1.3em;
-}
-
-.sig-paren {
- font-size: larger;
-}
-
-.sig-param.n {
- font-style: italic;
-}
-
-/* C++ specific styling */
-
-.sig-inline.c-texpr,
-.sig-inline.cpp-texpr {
- font-family: unset;
-}
-
-.sig.c .k, .sig.c .kt,
-.sig.cpp .k, .sig.cpp .kt {
- color: #0033B3;
-}
-
-.sig.c .m,
-.sig.cpp .m {
- color: #1750EB;
-}
-
-.sig.c .s, .sig.c .sc,
-.sig.cpp .s, .sig.cpp .sc {
- color: #067D17;
-}
-
/* -- other body styles ----------------------------------------------------- */
@@ -691,6 +629,14 @@ dl.glossary dt {
font-size: 1.1em;
}
+.optional {
+ font-size: 1.3em;
+}
+
+.sig-paren {
+ font-size: larger;
+}
+
.versionmodified {
font-style: italic;
}
@@ -820,11 +766,7 @@ div.code-block-caption code {
table.highlighttable td.linenos,
span.linenos,
div.doctest > div.highlight span.gp { /* gp: Generic.Prompt */
- user-select: none;
- -webkit-user-select: text; /* Safari fallback only */
- -webkit-user-select: none; /* Chrome/Safari */
- -moz-user-select: none; /* Firefox */
- -ms-user-select: none; /* IE10+ */
+ user-select: none;
}
div.code-block-caption span.caption-number {
@@ -839,6 +781,16 @@ div.literal-block-wrapper {
margin: 1em 0;
}
+code.descname {
+ background-color: transparent;
+ font-weight: bold;
+ font-size: 1.2em;
+}
+
+code.descclassname {
+ background-color: transparent;
+}
+
code.xref, a code {
background-color: transparent;
font-weight: bold;
diff --git a/docs/_static/doctools.js b/docs/_static/doctools.js
index 61ac9d2..7d88f80 100644
--- a/docs/_static/doctools.js
+++ b/docs/_static/doctools.js
@@ -4,7 +4,7 @@
*
* Sphinx JavaScript utilities for all documentation.
*
- * :copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS.
+ * :copyright: Copyright 2007-2020 by the Sphinx team, see AUTHORS.
* :license: BSD, see LICENSE for details.
*
*/
@@ -29,14 +29,9 @@ if (!window.console || !console.firebug) {
/**
* small helper function to urldecode strings
- *
- * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/decodeURIComponent#Decoding_query_parameters_from_a_URL
*/
jQuery.urldecode = function(x) {
- if (!x) {
- return x
- }
- return decodeURIComponent(x.replace(/\+/g, ' '));
+ return decodeURIComponent(x).replace(/\+/g, ' ');
};
/**
diff --git a/docs/_static/language_data.js b/docs/_static/language_data.js
index 863704b..d2b4ee9 100644
--- a/docs/_static/language_data.js
+++ b/docs/_static/language_data.js
@@ -5,7 +5,7 @@
* This script contains the language-specific data used by searchtools.js,
* namely the list of stopwords, stemmer, scorer and splitter.
*
- * :copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS.
+ * :copyright: Copyright 2007-2020 by the Sphinx team, see AUTHORS.
* :license: BSD, see LICENSE for details.
*
*/
@@ -13,8 +13,7 @@
var stopwords = ["a","and","are","as","at","be","but","by","for","if","in","into","is","it","near","no","not","of","on","or","such","that","the","their","then","there","these","they","this","to","was","will","with"];
-/* Non-minified version is copied as a separate JS file, is available */
-
+/* Non-minified version JS is _stemmer.js if file is provided */
/**
* Porter Stemmer
*/
@@ -200,6 +199,7 @@ var Stemmer = function() {
+
var splitChars = (function() {
var result = {};
var singles = [96, 180, 187, 191, 215, 247, 749, 885, 903, 907, 909, 930, 1014, 1648,
diff --git a/docs/_static/pygments.css b/docs/_static/pygments.css
index 28eb679..348ec44 100644
--- a/docs/_static/pygments.css
+++ b/docs/_static/pygments.css
@@ -1,7 +1,7 @@
-pre { line-height: 125%; margin: 0; }
-td.linenos pre { color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px; }
-span.linenos { color: #000000; background-color: #f0f0f0; padding: 0 5px 0 5px; }
-td.linenos pre.special { color: #000000; background-color: #ffffc0; padding: 0 5px 0 5px; }
-span.linenos.special { color: #000000; background-color: #ffffc0; padding: 0 5px 0 5px; }
+pre { line-height: 125%; }
+td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
+span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
+td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
+span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
.highlight .hll { background-color: #ffffcc }
.highlight { background: #ffffff; }
\ No newline at end of file
diff --git a/docs/_static/searchtools.js b/docs/_static/searchtools.js
index e09f926..261ecaa 100644
--- a/docs/_static/searchtools.js
+++ b/docs/_static/searchtools.js
@@ -4,7 +4,7 @@
*
* Sphinx JavaScript utilities for the full-text search.
*
- * :copyright: Copyright 2007-2021 by the Sphinx team, see AUTHORS.
+ * :copyright: Copyright 2007-2020 by the Sphinx team, see AUTHORS.
* :license: BSD, see LICENSE for details.
*
*/
@@ -248,7 +248,7 @@ var Search = {
// results left, load the summary and display it
if (results.length) {
var item = results.pop();
- var listItem = $('');
+ var listItem = $('');
var requestUrl = "";
var linkUrl = "";
if (DOCUMENTATION_OPTIONS.BUILDER === 'dirhtml') {
@@ -273,9 +273,9 @@ var Search = {
if (item[3]) {
listItem.append($(' (' + item[3] + ')'));
Search.output.append(listItem);
- setTimeout(function() {
+ listItem.slideDown(5, function() {
displayNextItem();
- }, 5);
+ });
} else if (DOCUMENTATION_OPTIONS.HAS_SOURCE) {
$.ajax({url: requestUrl,
dataType: "text",
@@ -285,16 +285,16 @@ var Search = {
listItem.append(Search.makeSearchSummary(data, searchterms, hlterms));
}
Search.output.append(listItem);
- setTimeout(function() {
+ listItem.slideDown(5, function() {
displayNextItem();
- }, 5);
+ });
}});
} else {
// no source available, just display title
Search.output.append(listItem);
- setTimeout(function() {
+ listItem.slideDown(5, function() {
displayNextItem();
- }, 5);
+ });
}
}
// search finished, update title and status message
@@ -379,13 +379,6 @@ var Search = {
return results;
},
- /**
- * See https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions
- */
- escapeRegExp : function(string) {
- return string.replace(/[.*+\-?^${}()|[\]\\]/g, '\\$&'); // $& means the whole matched string
- },
-
/**
* search for full-text terms in the index
*/
@@ -409,14 +402,13 @@ var Search = {
];
// add support for partial matches
if (word.length > 2) {
- var word_regex = this.escapeRegExp(word);
for (var w in terms) {
- if (w.match(word_regex) && !terms[word]) {
+ if (w.match(word) && !terms[word]) {
_o.push({files: terms[w], score: Scorer.partialTerm})
}
}
for (var w in titleterms) {
- if (w.match(word_regex) && !titleterms[word]) {
+ if (w.match(word) && !titleterms[word]) {
_o.push({files: titleterms[w], score: Scorer.partialTitle})
}
}
@@ -509,7 +501,7 @@ var Search = {
var excerpt = ((start > 0) ? '...' : '') +
$.trim(text.substr(start, 240)) +
((start + 240 - text.length) ? '...' : '');
- var rv = $('').text(excerpt);
+ var rv = $('').text(excerpt);
$.each(hlwords, function() {
rv = rv.highlightText(this, 'highlighted');
});
diff --git a/docs/_static/underscore-1.13.1.js b/docs/_static/underscore-1.13.1.js
deleted file mode 100644
index ffd77af..0000000
--- a/docs/_static/underscore-1.13.1.js
+++ /dev/null
@@ -1,2042 +0,0 @@
-(function (global, factory) {
- typeof exports === 'object' && typeof module !== 'undefined' ? module.exports = factory() :
- typeof define === 'function' && define.amd ? define('underscore', factory) :
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, (function () {
- var current = global._;
- var exports = global._ = factory();
- exports.noConflict = function () { global._ = current; return exports; };
- }()));
-}(this, (function () {
- // Underscore.js 1.13.1
- // https://underscorejs.org
- // (c) 2009-2021 Jeremy Ashkenas, Julian Gonggrijp, and DocumentCloud and Investigative Reporters & Editors
- // Underscore may be freely distributed under the MIT license.
-
- // Current version.
- var VERSION = '1.13.1';
-
- // Establish the root object, `window` (`self`) in the browser, `global`
- // on the server, or `this` in some virtual machines. We use `self`
- // instead of `window` for `WebWorker` support.
- var root = typeof self == 'object' && self.self === self && self ||
- typeof global == 'object' && global.global === global && global ||
- Function('return this')() ||
- {};
-
- // Save bytes in the minified (but not gzipped) version:
- var ArrayProto = Array.prototype, ObjProto = Object.prototype;
- var SymbolProto = typeof Symbol !== 'undefined' ? Symbol.prototype : null;
-
- // Create quick reference variables for speed access to core prototypes.
- var push = ArrayProto.push,
- slice = ArrayProto.slice,
- toString = ObjProto.toString,
- hasOwnProperty = ObjProto.hasOwnProperty;
-
- // Modern feature detection.
- var supportsArrayBuffer = typeof ArrayBuffer !== 'undefined',
- supportsDataView = typeof DataView !== 'undefined';
-
- // All **ECMAScript 5+** native function implementations that we hope to use
- // are declared here.
- var nativeIsArray = Array.isArray,
- nativeKeys = Object.keys,
- nativeCreate = Object.create,
- nativeIsView = supportsArrayBuffer && ArrayBuffer.isView;
-
- // Create references to these builtin functions because we override them.
- var _isNaN = isNaN,
- _isFinite = isFinite;
-
- // Keys in IE < 9 that won't be iterated by `for key in ...` and thus missed.
- var hasEnumBug = !{toString: null}.propertyIsEnumerable('toString');
- var nonEnumerableProps = ['valueOf', 'isPrototypeOf', 'toString',
- 'propertyIsEnumerable', 'hasOwnProperty', 'toLocaleString'];
-
- // The largest integer that can be represented exactly.
- var MAX_ARRAY_INDEX = Math.pow(2, 53) - 1;
-
- // Some functions take a variable number of arguments, or a few expected
- // arguments at the beginning and then a variable number of values to operate
- // on. This helper accumulates all remaining arguments past the function’s
- // argument length (or an explicit `startIndex`), into an array that becomes
- // the last argument. Similar to ES6’s "rest parameter".
- function restArguments(func, startIndex) {
- startIndex = startIndex == null ? func.length - 1 : +startIndex;
- return function() {
- var length = Math.max(arguments.length - startIndex, 0),
- rest = Array(length),
- index = 0;
- for (; index < length; index++) {
- rest[index] = arguments[index + startIndex];
- }
- switch (startIndex) {
- case 0: return func.call(this, rest);
- case 1: return func.call(this, arguments[0], rest);
- case 2: return func.call(this, arguments[0], arguments[1], rest);
- }
- var args = Array(startIndex + 1);
- for (index = 0; index < startIndex; index++) {
- args[index] = arguments[index];
- }
- args[startIndex] = rest;
- return func.apply(this, args);
- };
- }
-
- // Is a given variable an object?
- function isObject(obj) {
- var type = typeof obj;
- return type === 'function' || type === 'object' && !!obj;
- }
-
- // Is a given value equal to null?
- function isNull(obj) {
- return obj === null;
- }
-
- // Is a given variable undefined?
- function isUndefined(obj) {
- return obj === void 0;
- }
-
- // Is a given value a boolean?
- function isBoolean(obj) {
- return obj === true || obj === false || toString.call(obj) === '[object Boolean]';
- }
-
- // Is a given value a DOM element?
- function isElement(obj) {
- return !!(obj && obj.nodeType === 1);
- }
-
- // Internal function for creating a `toString`-based type tester.
- function tagTester(name) {
- var tag = '[object ' + name + ']';
- return function(obj) {
- return toString.call(obj) === tag;
- };
- }
-
- var isString = tagTester('String');
-
- var isNumber = tagTester('Number');
-
- var isDate = tagTester('Date');
-
- var isRegExp = tagTester('RegExp');
-
- var isError = tagTester('Error');
-
- var isSymbol = tagTester('Symbol');
-
- var isArrayBuffer = tagTester('ArrayBuffer');
-
- var isFunction = tagTester('Function');
-
- // Optimize `isFunction` if appropriate. Work around some `typeof` bugs in old
- // v8, IE 11 (#1621), Safari 8 (#1929), and PhantomJS (#2236).
- var nodelist = root.document && root.document.childNodes;
- if (typeof /./ != 'function' && typeof Int8Array != 'object' && typeof nodelist != 'function') {
- isFunction = function(obj) {
- return typeof obj == 'function' || false;
- };
- }
-
- var isFunction$1 = isFunction;
-
- var hasObjectTag = tagTester('Object');
-
- // In IE 10 - Edge 13, `DataView` has string tag `'[object Object]'`.
- // In IE 11, the most common among them, this problem also applies to
- // `Map`, `WeakMap` and `Set`.
- var hasStringTagBug = (
- supportsDataView && hasObjectTag(new DataView(new ArrayBuffer(8)))
- ),
- isIE11 = (typeof Map !== 'undefined' && hasObjectTag(new Map));
-
- var isDataView = tagTester('DataView');
-
- // In IE 10 - Edge 13, we need a different heuristic
- // to determine whether an object is a `DataView`.
- function ie10IsDataView(obj) {
- return obj != null && isFunction$1(obj.getInt8) && isArrayBuffer(obj.buffer);
- }
-
- var isDataView$1 = (hasStringTagBug ? ie10IsDataView : isDataView);
-
- // Is a given value an array?
- // Delegates to ECMA5's native `Array.isArray`.
- var isArray = nativeIsArray || tagTester('Array');
-
- // Internal function to check whether `key` is an own property name of `obj`.
- function has$1(obj, key) {
- return obj != null && hasOwnProperty.call(obj, key);
- }
-
- var isArguments = tagTester('Arguments');
-
- // Define a fallback version of the method in browsers (ahem, IE < 9), where
- // there isn't any inspectable "Arguments" type.
- (function() {
- if (!isArguments(arguments)) {
- isArguments = function(obj) {
- return has$1(obj, 'callee');
- };
- }
- }());
-
- var isArguments$1 = isArguments;
-
- // Is a given object a finite number?
- function isFinite$1(obj) {
- return !isSymbol(obj) && _isFinite(obj) && !isNaN(parseFloat(obj));
- }
-
- // Is the given value `NaN`?
- function isNaN$1(obj) {
- return isNumber(obj) && _isNaN(obj);
- }
-
- // Predicate-generating function. Often useful outside of Underscore.
- function constant(value) {
- return function() {
- return value;
- };
- }
-
- // Common internal logic for `isArrayLike` and `isBufferLike`.
- function createSizePropertyCheck(getSizeProperty) {
- return function(collection) {
- var sizeProperty = getSizeProperty(collection);
- return typeof sizeProperty == 'number' && sizeProperty >= 0 && sizeProperty <= MAX_ARRAY_INDEX;
- }
- }
-
- // Internal helper to generate a function to obtain property `key` from `obj`.
- function shallowProperty(key) {
- return function(obj) {
- return obj == null ? void 0 : obj[key];
- };
- }
-
- // Internal helper to obtain the `byteLength` property of an object.
- var getByteLength = shallowProperty('byteLength');
-
- // Internal helper to determine whether we should spend extensive checks against
- // `ArrayBuffer` et al.
- var isBufferLike = createSizePropertyCheck(getByteLength);
-
- // Is a given value a typed array?
- var typedArrayPattern = /\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;
- function isTypedArray(obj) {
- // `ArrayBuffer.isView` is the most future-proof, so use it when available.
- // Otherwise, fall back on the above regular expression.
- return nativeIsView ? (nativeIsView(obj) && !isDataView$1(obj)) :
- isBufferLike(obj) && typedArrayPattern.test(toString.call(obj));
- }
-
- var isTypedArray$1 = supportsArrayBuffer ? isTypedArray : constant(false);
-
- // Internal helper to obtain the `length` property of an object.
- var getLength = shallowProperty('length');
-
- // Internal helper to create a simple lookup structure.
- // `collectNonEnumProps` used to depend on `_.contains`, but this led to
- // circular imports. `emulatedSet` is a one-off solution that only works for
- // arrays of strings.
- function emulatedSet(keys) {
- var hash = {};
- for (var l = keys.length, i = 0; i < l; ++i) hash[keys[i]] = true;
- return {
- contains: function(key) { return hash[key]; },
- push: function(key) {
- hash[key] = true;
- return keys.push(key);
- }
- };
- }
-
- // Internal helper. Checks `keys` for the presence of keys in IE < 9 that won't
- // be iterated by `for key in ...` and thus missed. Extends `keys` in place if
- // needed.
- function collectNonEnumProps(obj, keys) {
- keys = emulatedSet(keys);
- var nonEnumIdx = nonEnumerableProps.length;
- var constructor = obj.constructor;
- var proto = isFunction$1(constructor) && constructor.prototype || ObjProto;
-
- // Constructor is a special case.
- var prop = 'constructor';
- if (has$1(obj, prop) && !keys.contains(prop)) keys.push(prop);
-
- while (nonEnumIdx--) {
- prop = nonEnumerableProps[nonEnumIdx];
- if (prop in obj && obj[prop] !== proto[prop] && !keys.contains(prop)) {
- keys.push(prop);
- }
- }
- }
-
- // Retrieve the names of an object's own properties.
- // Delegates to **ECMAScript 5**'s native `Object.keys`.
- function keys(obj) {
- if (!isObject(obj)) return [];
- if (nativeKeys) return nativeKeys(obj);
- var keys = [];
- for (var key in obj) if (has$1(obj, key)) keys.push(key);
- // Ahem, IE < 9.
- if (hasEnumBug) collectNonEnumProps(obj, keys);
- return keys;
- }
-
- // Is a given array, string, or object empty?
- // An "empty" object has no enumerable own-properties.
- function isEmpty(obj) {
- if (obj == null) return true;
- // Skip the more expensive `toString`-based type checks if `obj` has no
- // `.length`.
- var length = getLength(obj);
- if (typeof length == 'number' && (
- isArray(obj) || isString(obj) || isArguments$1(obj)
- )) return length === 0;
- return getLength(keys(obj)) === 0;
- }
-
- // Returns whether an object has a given set of `key:value` pairs.
- function isMatch(object, attrs) {
- var _keys = keys(attrs), length = _keys.length;
- if (object == null) return !length;
- var obj = Object(object);
- for (var i = 0; i < length; i++) {
- var key = _keys[i];
- if (attrs[key] !== obj[key] || !(key in obj)) return false;
- }
- return true;
- }
-
- // If Underscore is called as a function, it returns a wrapped object that can
- // be used OO-style. This wrapper holds altered versions of all functions added
- // through `_.mixin`. Wrapped objects may be chained.
- function _$1(obj) {
- if (obj instanceof _$1) return obj;
- if (!(this instanceof _$1)) return new _$1(obj);
- this._wrapped = obj;
- }
-
- _$1.VERSION = VERSION;
-
- // Extracts the result from a wrapped and chained object.
- _$1.prototype.value = function() {
- return this._wrapped;
- };
-
- // Provide unwrapping proxies for some methods used in engine operations
- // such as arithmetic and JSON stringification.
- _$1.prototype.valueOf = _$1.prototype.toJSON = _$1.prototype.value;
-
- _$1.prototype.toString = function() {
- return String(this._wrapped);
- };
-
- // Internal function to wrap or shallow-copy an ArrayBuffer,
- // typed array or DataView to a new view, reusing the buffer.
- function toBufferView(bufferSource) {
- return new Uint8Array(
- bufferSource.buffer || bufferSource,
- bufferSource.byteOffset || 0,
- getByteLength(bufferSource)
- );
- }
-
- // We use this string twice, so give it a name for minification.
- var tagDataView = '[object DataView]';
-
- // Internal recursive comparison function for `_.isEqual`.
- function eq(a, b, aStack, bStack) {
- // Identical objects are equal. `0 === -0`, but they aren't identical.
- // See the [Harmony `egal` proposal](https://wiki.ecmascript.org/doku.php?id=harmony:egal).
- if (a === b) return a !== 0 || 1 / a === 1 / b;
- // `null` or `undefined` only equal to itself (strict comparison).
- if (a == null || b == null) return false;
- // `NaN`s are equivalent, but non-reflexive.
- if (a !== a) return b !== b;
- // Exhaust primitive checks
- var type = typeof a;
- if (type !== 'function' && type !== 'object' && typeof b != 'object') return false;
- return deepEq(a, b, aStack, bStack);
- }
-
- // Internal recursive comparison function for `_.isEqual`.
- function deepEq(a, b, aStack, bStack) {
- // Unwrap any wrapped objects.
- if (a instanceof _$1) a = a._wrapped;
- if (b instanceof _$1) b = b._wrapped;
- // Compare `[[Class]]` names.
- var className = toString.call(a);
- if (className !== toString.call(b)) return false;
- // Work around a bug in IE 10 - Edge 13.
- if (hasStringTagBug && className == '[object Object]' && isDataView$1(a)) {
- if (!isDataView$1(b)) return false;
- className = tagDataView;
- }
- switch (className) {
- // These types are compared by value.
- case '[object RegExp]':
- // RegExps are coerced to strings for comparison (Note: '' + /a/i === '/a/i')
- case '[object String]':
- // Primitives and their corresponding object wrappers are equivalent; thus, `"5"` is
- // equivalent to `new String("5")`.
- return '' + a === '' + b;
- case '[object Number]':
- // `NaN`s are equivalent, but non-reflexive.
- // Object(NaN) is equivalent to NaN.
- if (+a !== +a) return +b !== +b;
- // An `egal` comparison is performed for other numeric values.
- return +a === 0 ? 1 / +a === 1 / b : +a === +b;
- case '[object Date]':
- case '[object Boolean]':
- // Coerce dates and booleans to numeric primitive values. Dates are compared by their
- // millisecond representations. Note that invalid dates with millisecond representations
- // of `NaN` are not equivalent.
- return +a === +b;
- case '[object Symbol]':
- return SymbolProto.valueOf.call(a) === SymbolProto.valueOf.call(b);
- case '[object ArrayBuffer]':
- case tagDataView:
- // Coerce to typed array so we can fall through.
- return deepEq(toBufferView(a), toBufferView(b), aStack, bStack);
- }
-
- var areArrays = className === '[object Array]';
- if (!areArrays && isTypedArray$1(a)) {
- var byteLength = getByteLength(a);
- if (byteLength !== getByteLength(b)) return false;
- if (a.buffer === b.buffer && a.byteOffset === b.byteOffset) return true;
- areArrays = true;
- }
- if (!areArrays) {
- if (typeof a != 'object' || typeof b != 'object') return false;
-
- // Objects with different constructors are not equivalent, but `Object`s or `Array`s
- // from different frames are.
- var aCtor = a.constructor, bCtor = b.constructor;
- if (aCtor !== bCtor && !(isFunction$1(aCtor) && aCtor instanceof aCtor &&
- isFunction$1(bCtor) && bCtor instanceof bCtor)
- && ('constructor' in a && 'constructor' in b)) {
- return false;
- }
- }
- // Assume equality for cyclic structures. The algorithm for detecting cyclic
- // structures is adapted from ES 5.1 section 15.12.3, abstract operation `JO`.
-
- // Initializing stack of traversed objects.
- // It's done here since we only need them for objects and arrays comparison.
- aStack = aStack || [];
- bStack = bStack || [];
- var length = aStack.length;
- while (length--) {
- // Linear search. Performance is inversely proportional to the number of
- // unique nested structures.
- if (aStack[length] === a) return bStack[length] === b;
- }
-
- // Add the first object to the stack of traversed objects.
- aStack.push(a);
- bStack.push(b);
-
- // Recursively compare objects and arrays.
- if (areArrays) {
- // Compare array lengths to determine if a deep comparison is necessary.
- length = a.length;
- if (length !== b.length) return false;
- // Deep compare the contents, ignoring non-numeric properties.
- while (length--) {
- if (!eq(a[length], b[length], aStack, bStack)) return false;
- }
- } else {
- // Deep compare objects.
- var _keys = keys(a), key;
- length = _keys.length;
- // Ensure that both objects contain the same number of properties before comparing deep equality.
- if (keys(b).length !== length) return false;
- while (length--) {
- // Deep compare each member
- key = _keys[length];
- if (!(has$1(b, key) && eq(a[key], b[key], aStack, bStack))) return false;
- }
- }
- // Remove the first object from the stack of traversed objects.
- aStack.pop();
- bStack.pop();
- return true;
- }
-
- // Perform a deep comparison to check if two objects are equal.
- function isEqual(a, b) {
- return eq(a, b);
- }
-
- // Retrieve all the enumerable property names of an object.
- function allKeys(obj) {
- if (!isObject(obj)) return [];
- var keys = [];
- for (var key in obj) keys.push(key);
- // Ahem, IE < 9.
- if (hasEnumBug) collectNonEnumProps(obj, keys);
- return keys;
- }
-
- // Since the regular `Object.prototype.toString` type tests don't work for
- // some types in IE 11, we use a fingerprinting heuristic instead, based
- // on the methods. It's not great, but it's the best we got.
- // The fingerprint method lists are defined below.
- function ie11fingerprint(methods) {
- var length = getLength(methods);
- return function(obj) {
- if (obj == null) return false;
- // `Map`, `WeakMap` and `Set` have no enumerable keys.
- var keys = allKeys(obj);
- if (getLength(keys)) return false;
- for (var i = 0; i < length; i++) {
- if (!isFunction$1(obj[methods[i]])) return false;
- }
- // If we are testing against `WeakMap`, we need to ensure that
- // `obj` doesn't have a `forEach` method in order to distinguish
- // it from a regular `Map`.
- return methods !== weakMapMethods || !isFunction$1(obj[forEachName]);
- };
- }
-
- // In the interest of compact minification, we write
- // each string in the fingerprints only once.
- var forEachName = 'forEach',
- hasName = 'has',
- commonInit = ['clear', 'delete'],
- mapTail = ['get', hasName, 'set'];
-
- // `Map`, `WeakMap` and `Set` each have slightly different
- // combinations of the above sublists.
- var mapMethods = commonInit.concat(forEachName, mapTail),
- weakMapMethods = commonInit.concat(mapTail),
- setMethods = ['add'].concat(commonInit, forEachName, hasName);
-
- var isMap = isIE11 ? ie11fingerprint(mapMethods) : tagTester('Map');
-
- var isWeakMap = isIE11 ? ie11fingerprint(weakMapMethods) : tagTester('WeakMap');
-
- var isSet = isIE11 ? ie11fingerprint(setMethods) : tagTester('Set');
-
- var isWeakSet = tagTester('WeakSet');
-
- // Retrieve the values of an object's properties.
- function values(obj) {
- var _keys = keys(obj);
- var length = _keys.length;
- var values = Array(length);
- for (var i = 0; i < length; i++) {
- values[i] = obj[_keys[i]];
- }
- return values;
- }
-
- // Convert an object into a list of `[key, value]` pairs.
- // The opposite of `_.object` with one argument.
- function pairs(obj) {
- var _keys = keys(obj);
- var length = _keys.length;
- var pairs = Array(length);
- for (var i = 0; i < length; i++) {
- pairs[i] = [_keys[i], obj[_keys[i]]];
- }
- return pairs;
- }
-
- // Invert the keys and values of an object. The values must be serializable.
- function invert(obj) {
- var result = {};
- var _keys = keys(obj);
- for (var i = 0, length = _keys.length; i < length; i++) {
- result[obj[_keys[i]]] = _keys[i];
- }
- return result;
- }
-
- // Return a sorted list of the function names available on the object.
- function functions(obj) {
- var names = [];
- for (var key in obj) {
- if (isFunction$1(obj[key])) names.push(key);
- }
- return names.sort();
- }
-
- // An internal function for creating assigner functions.
- function createAssigner(keysFunc, defaults) {
- return function(obj) {
- var length = arguments.length;
- if (defaults) obj = Object(obj);
- if (length < 2 || obj == null) return obj;
- for (var index = 1; index < length; index++) {
- var source = arguments[index],
- keys = keysFunc(source),
- l = keys.length;
- for (var i = 0; i < l; i++) {
- var key = keys[i];
- if (!defaults || obj[key] === void 0) obj[key] = source[key];
- }
- }
- return obj;
- };
- }
-
- // Extend a given object with all the properties in passed-in object(s).
- var extend = createAssigner(allKeys);
-
- // Assigns a given object with all the own properties in the passed-in
- // object(s).
- // (https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object/assign)
- var extendOwn = createAssigner(keys);
-
- // Fill in a given object with default properties.
- var defaults = createAssigner(allKeys, true);
-
- // Create a naked function reference for surrogate-prototype-swapping.
- function ctor() {
- return function(){};
- }
-
- // An internal function for creating a new object that inherits from another.
- function baseCreate(prototype) {
- if (!isObject(prototype)) return {};
- if (nativeCreate) return nativeCreate(prototype);
- var Ctor = ctor();
- Ctor.prototype = prototype;
- var result = new Ctor;
- Ctor.prototype = null;
- return result;
- }
-
- // Creates an object that inherits from the given prototype object.
- // If additional properties are provided then they will be added to the
- // created object.
- function create(prototype, props) {
- var result = baseCreate(prototype);
- if (props) extendOwn(result, props);
- return result;
- }
-
- // Create a (shallow-cloned) duplicate of an object.
- function clone(obj) {
- if (!isObject(obj)) return obj;
- return isArray(obj) ? obj.slice() : extend({}, obj);
- }
-
- // Invokes `interceptor` with the `obj` and then returns `obj`.
- // The primary purpose of this method is to "tap into" a method chain, in
- // order to perform operations on intermediate results within the chain.
- function tap(obj, interceptor) {
- interceptor(obj);
- return obj;
- }
-
- // Normalize a (deep) property `path` to array.
- // Like `_.iteratee`, this function can be customized.
- function toPath$1(path) {
- return isArray(path) ? path : [path];
- }
- _$1.toPath = toPath$1;
-
- // Internal wrapper for `_.toPath` to enable minification.
- // Similar to `cb` for `_.iteratee`.
- function toPath(path) {
- return _$1.toPath(path);
- }
-
- // Internal function to obtain a nested property in `obj` along `path`.
- function deepGet(obj, path) {
- var length = path.length;
- for (var i = 0; i < length; i++) {
- if (obj == null) return void 0;
- obj = obj[path[i]];
- }
- return length ? obj : void 0;
- }
-
- // Get the value of the (deep) property on `path` from `object`.
- // If any property in `path` does not exist or if the value is
- // `undefined`, return `defaultValue` instead.
- // The `path` is normalized through `_.toPath`.
- function get(object, path, defaultValue) {
- var value = deepGet(object, toPath(path));
- return isUndefined(value) ? defaultValue : value;
- }
-
- // Shortcut function for checking if an object has a given property directly on
- // itself (in other words, not on a prototype). Unlike the internal `has`
- // function, this public version can also traverse nested properties.
- function has(obj, path) {
- path = toPath(path);
- var length = path.length;
- for (var i = 0; i < length; i++) {
- var key = path[i];
- if (!has$1(obj, key)) return false;
- obj = obj[key];
- }
- return !!length;
- }
-
- // Keep the identity function around for default iteratees.
- function identity(value) {
- return value;
- }
-
- // Returns a predicate for checking whether an object has a given set of
- // `key:value` pairs.
- function matcher(attrs) {
- attrs = extendOwn({}, attrs);
- return function(obj) {
- return isMatch(obj, attrs);
- };
- }
-
- // Creates a function that, when passed an object, will traverse that object’s
- // properties down the given `path`, specified as an array of keys or indices.
- function property(path) {
- path = toPath(path);
- return function(obj) {
- return deepGet(obj, path);
- };
- }
-
- // Internal function that returns an efficient (for current engines) version
- // of the passed-in callback, to be repeatedly applied in other Underscore
- // functions.
- function optimizeCb(func, context, argCount) {
- if (context === void 0) return func;
- switch (argCount == null ? 3 : argCount) {
- case 1: return function(value) {
- return func.call(context, value);
- };
- // The 2-argument case is omitted because we’re not using it.
- case 3: return function(value, index, collection) {
- return func.call(context, value, index, collection);
- };
- case 4: return function(accumulator, value, index, collection) {
- return func.call(context, accumulator, value, index, collection);
- };
- }
- return function() {
- return func.apply(context, arguments);
- };
- }
-
- // An internal function to generate callbacks that can be applied to each
- // element in a collection, returning the desired result — either `_.identity`,
- // an arbitrary callback, a property matcher, or a property accessor.
- function baseIteratee(value, context, argCount) {
- if (value == null) return identity;
- if (isFunction$1(value)) return optimizeCb(value, context, argCount);
- if (isObject(value) && !isArray(value)) return matcher(value);
- return property(value);
- }
-
- // External wrapper for our callback generator. Users may customize
- // `_.iteratee` if they want additional predicate/iteratee shorthand styles.
- // This abstraction hides the internal-only `argCount` argument.
- function iteratee(value, context) {
- return baseIteratee(value, context, Infinity);
- }
- _$1.iteratee = iteratee;
-
- // The function we call internally to generate a callback. It invokes
- // `_.iteratee` if overridden, otherwise `baseIteratee`.
- function cb(value, context, argCount) {
- if (_$1.iteratee !== iteratee) return _$1.iteratee(value, context);
- return baseIteratee(value, context, argCount);
- }
-
- // Returns the results of applying the `iteratee` to each element of `obj`.
- // In contrast to `_.map` it returns an object.
- function mapObject(obj, iteratee, context) {
- iteratee = cb(iteratee, context);
- var _keys = keys(obj),
- length = _keys.length,
- results = {};
- for (var index = 0; index < length; index++) {
- var currentKey = _keys[index];
- results[currentKey] = iteratee(obj[currentKey], currentKey, obj);
- }
- return results;
- }
-
- // Predicate-generating function. Often useful outside of Underscore.
- function noop(){}
-
- // Generates a function for a given object that returns a given property.
- function propertyOf(obj) {
- if (obj == null) return noop;
- return function(path) {
- return get(obj, path);
- };
- }
-
- // Run a function **n** times.
- function times(n, iteratee, context) {
- var accum = Array(Math.max(0, n));
- iteratee = optimizeCb(iteratee, context, 1);
- for (var i = 0; i < n; i++) accum[i] = iteratee(i);
- return accum;
- }
-
- // Return a random integer between `min` and `max` (inclusive).
- function random(min, max) {
- if (max == null) {
- max = min;
- min = 0;
- }
- return min + Math.floor(Math.random() * (max - min + 1));
- }
-
- // A (possibly faster) way to get the current timestamp as an integer.
- var now = Date.now || function() {
- return new Date().getTime();
- };
-
- // Internal helper to generate functions for escaping and unescaping strings
- // to/from HTML interpolation.
- function createEscaper(map) {
- var escaper = function(match) {
- return map[match];
- };
- // Regexes for identifying a key that needs to be escaped.
- var source = '(?:' + keys(map).join('|') + ')';
- var testRegexp = RegExp(source);
- var replaceRegexp = RegExp(source, 'g');
- return function(string) {
- string = string == null ? '' : '' + string;
- return testRegexp.test(string) ? string.replace(replaceRegexp, escaper) : string;
- };
- }
-
- // Internal list of HTML entities for escaping.
- var escapeMap = {
- '&': '&',
- '<': '<',
- '>': '>',
- '"': '"',
- "'": ''',
- '`': '`'
- };
-
- // Function for escaping strings to HTML interpolation.
- var _escape = createEscaper(escapeMap);
-
- // Internal list of HTML entities for unescaping.
- var unescapeMap = invert(escapeMap);
-
- // Function for unescaping strings from HTML interpolation.
- var _unescape = createEscaper(unescapeMap);
-
- // By default, Underscore uses ERB-style template delimiters. Change the
- // following template settings to use alternative delimiters.
- var templateSettings = _$1.templateSettings = {
- evaluate: /<%([\s\S]+?)%>/g,
- interpolate: /<%=([\s\S]+?)%>/g,
- escape: /<%-([\s\S]+?)%>/g
- };
-
- // When customizing `_.templateSettings`, if you don't want to define an
- // interpolation, evaluation or escaping regex, we need one that is
- // guaranteed not to match.
- var noMatch = /(.)^/;
-
- // Certain characters need to be escaped so that they can be put into a
- // string literal.
- var escapes = {
- "'": "'",
- '\\': '\\',
- '\r': 'r',
- '\n': 'n',
- '\u2028': 'u2028',
- '\u2029': 'u2029'
- };
-
- var escapeRegExp = /\\|'|\r|\n|\u2028|\u2029/g;
-
- function escapeChar(match) {
- return '\\' + escapes[match];
- }
-
- // In order to prevent third-party code injection through
- // `_.templateSettings.variable`, we test it against the following regular
- // expression. It is intentionally a bit more liberal than just matching valid
- // identifiers, but still prevents possible loopholes through defaults or
- // destructuring assignment.
- var bareIdentifier = /^\s*(\w|\$)+\s*$/;
-
- // JavaScript micro-templating, similar to John Resig's implementation.
- // Underscore templating handles arbitrary delimiters, preserves whitespace,
- // and correctly escapes quotes within interpolated code.
- // NB: `oldSettings` only exists for backwards compatibility.
- function template(text, settings, oldSettings) {
- if (!settings && oldSettings) settings = oldSettings;
- settings = defaults({}, settings, _$1.templateSettings);
-
- // Combine delimiters into one regular expression via alternation.
- var matcher = RegExp([
- (settings.escape || noMatch).source,
- (settings.interpolate || noMatch).source,
- (settings.evaluate || noMatch).source
- ].join('|') + '|$', 'g');
-
- // Compile the template source, escaping string literals appropriately.
- var index = 0;
- var source = "__p+='";
- text.replace(matcher, function(match, escape, interpolate, evaluate, offset) {
- source += text.slice(index, offset).replace(escapeRegExp, escapeChar);
- index = offset + match.length;
-
- if (escape) {
- source += "'+\n((__t=(" + escape + "))==null?'':_.escape(__t))+\n'";
- } else if (interpolate) {
- source += "'+\n((__t=(" + interpolate + "))==null?'':__t)+\n'";
- } else if (evaluate) {
- source += "';\n" + evaluate + "\n__p+='";
- }
-
- // Adobe VMs need the match returned to produce the correct offset.
- return match;
- });
- source += "';\n";
-
- var argument = settings.variable;
- if (argument) {
- // Insure against third-party code injection. (CVE-2021-23358)
- if (!bareIdentifier.test(argument)) throw new Error(
- 'variable is not a bare identifier: ' + argument
- );
- } else {
- // If a variable is not specified, place data values in local scope.
- source = 'with(obj||{}){\n' + source + '}\n';
- argument = 'obj';
- }
-
- source = "var __t,__p='',__j=Array.prototype.join," +
- "print=function(){__p+=__j.call(arguments,'');};\n" +
- source + 'return __p;\n';
-
- var render;
- try {
- render = new Function(argument, '_', source);
- } catch (e) {
- e.source = source;
- throw e;
- }
-
- var template = function(data) {
- return render.call(this, data, _$1);
- };
-
- // Provide the compiled source as a convenience for precompilation.
- template.source = 'function(' + argument + '){\n' + source + '}';
-
- return template;
- }
-
- // Traverses the children of `obj` along `path`. If a child is a function, it
- // is invoked with its parent as context. Returns the value of the final
- // child, or `fallback` if any child is undefined.
- function result(obj, path, fallback) {
- path = toPath(path);
- var length = path.length;
- if (!length) {
- return isFunction$1(fallback) ? fallback.call(obj) : fallback;
- }
- for (var i = 0; i < length; i++) {
- var prop = obj == null ? void 0 : obj[path[i]];
- if (prop === void 0) {
- prop = fallback;
- i = length; // Ensure we don't continue iterating.
- }
- obj = isFunction$1(prop) ? prop.call(obj) : prop;
- }
- return obj;
- }
-
- // Generate a unique integer id (unique within the entire client session).
- // Useful for temporary DOM ids.
- var idCounter = 0;
- function uniqueId(prefix) {
- var id = ++idCounter + '';
- return prefix ? prefix + id : id;
- }
-
- // Start chaining a wrapped Underscore object.
- function chain(obj) {
- var instance = _$1(obj);
- instance._chain = true;
- return instance;
- }
-
- // Internal function to execute `sourceFunc` bound to `context` with optional
- // `args`. Determines whether to execute a function as a constructor or as a
- // normal function.
- function executeBound(sourceFunc, boundFunc, context, callingContext, args) {
- if (!(callingContext instanceof boundFunc)) return sourceFunc.apply(context, args);
- var self = baseCreate(sourceFunc.prototype);
- var result = sourceFunc.apply(self, args);
- if (isObject(result)) return result;
- return self;
- }
-
- // Partially apply a function by creating a version that has had some of its
- // arguments pre-filled, without changing its dynamic `this` context. `_` acts
- // as a placeholder by default, allowing any combination of arguments to be
- // pre-filled. Set `_.partial.placeholder` for a custom placeholder argument.
- var partial = restArguments(function(func, boundArgs) {
- var placeholder = partial.placeholder;
- var bound = function() {
- var position = 0, length = boundArgs.length;
- var args = Array(length);
- for (var i = 0; i < length; i++) {
- args[i] = boundArgs[i] === placeholder ? arguments[position++] : boundArgs[i];
- }
- while (position < arguments.length) args.push(arguments[position++]);
- return executeBound(func, bound, this, this, args);
- };
- return bound;
- });
-
- partial.placeholder = _$1;
-
- // Create a function bound to a given object (assigning `this`, and arguments,
- // optionally).
- var bind = restArguments(function(func, context, args) {
- if (!isFunction$1(func)) throw new TypeError('Bind must be called on a function');
- var bound = restArguments(function(callArgs) {
- return executeBound(func, bound, context, this, args.concat(callArgs));
- });
- return bound;
- });
-
- // Internal helper for collection methods to determine whether a collection
- // should be iterated as an array or as an object.
- // Related: https://people.mozilla.org/~jorendorff/es6-draft.html#sec-tolength
- // Avoids a very nasty iOS 8 JIT bug on ARM-64. #2094
- var isArrayLike = createSizePropertyCheck(getLength);
-
- // Internal implementation of a recursive `flatten` function.
- function flatten$1(input, depth, strict, output) {
- output = output || [];
- if (!depth && depth !== 0) {
- depth = Infinity;
- } else if (depth <= 0) {
- return output.concat(input);
- }
- var idx = output.length;
- for (var i = 0, length = getLength(input); i < length; i++) {
- var value = input[i];
- if (isArrayLike(value) && (isArray(value) || isArguments$1(value))) {
- // Flatten current level of array or arguments object.
- if (depth > 1) {
- flatten$1(value, depth - 1, strict, output);
- idx = output.length;
- } else {
- var j = 0, len = value.length;
- while (j < len) output[idx++] = value[j++];
- }
- } else if (!strict) {
- output[idx++] = value;
- }
- }
- return output;
- }
-
- // Bind a number of an object's methods to that object. Remaining arguments
- // are the method names to be bound. Useful for ensuring that all callbacks
- // defined on an object belong to it.
- var bindAll = restArguments(function(obj, keys) {
- keys = flatten$1(keys, false, false);
- var index = keys.length;
- if (index < 1) throw new Error('bindAll must be passed function names');
- while (index--) {
- var key = keys[index];
- obj[key] = bind(obj[key], obj);
- }
- return obj;
- });
-
- // Memoize an expensive function by storing its results.
- function memoize(func, hasher) {
- var memoize = function(key) {
- var cache = memoize.cache;
- var address = '' + (hasher ? hasher.apply(this, arguments) : key);
- if (!has$1(cache, address)) cache[address] = func.apply(this, arguments);
- return cache[address];
- };
- memoize.cache = {};
- return memoize;
- }
-
- // Delays a function for the given number of milliseconds, and then calls
- // it with the arguments supplied.
- var delay = restArguments(function(func, wait, args) {
- return setTimeout(function() {
- return func.apply(null, args);
- }, wait);
- });
-
- // Defers a function, scheduling it to run after the current call stack has
- // cleared.
- var defer = partial(delay, _$1, 1);
-
- // Returns a function, that, when invoked, will only be triggered at most once
- // during a given window of time. Normally, the throttled function will run
- // as much as it can, without ever going more than once per `wait` duration;
- // but if you'd like to disable the execution on the leading edge, pass
- // `{leading: false}`. To disable execution on the trailing edge, ditto.
- function throttle(func, wait, options) {
- var timeout, context, args, result;
- var previous = 0;
- if (!options) options = {};
-
- var later = function() {
- previous = options.leading === false ? 0 : now();
- timeout = null;
- result = func.apply(context, args);
- if (!timeout) context = args = null;
- };
-
- var throttled = function() {
- var _now = now();
- if (!previous && options.leading === false) previous = _now;
- var remaining = wait - (_now - previous);
- context = this;
- args = arguments;
- if (remaining <= 0 || remaining > wait) {
- if (timeout) {
- clearTimeout(timeout);
- timeout = null;
- }
- previous = _now;
- result = func.apply(context, args);
- if (!timeout) context = args = null;
- } else if (!timeout && options.trailing !== false) {
- timeout = setTimeout(later, remaining);
- }
- return result;
- };
-
- throttled.cancel = function() {
- clearTimeout(timeout);
- previous = 0;
- timeout = context = args = null;
- };
-
- return throttled;
- }
-
- // When a sequence of calls of the returned function ends, the argument
- // function is triggered. The end of a sequence is defined by the `wait`
- // parameter. If `immediate` is passed, the argument function will be
- // triggered at the beginning of the sequence instead of at the end.
- function debounce(func, wait, immediate) {
- var timeout, previous, args, result, context;
-
- var later = function() {
- var passed = now() - previous;
- if (wait > passed) {
- timeout = setTimeout(later, wait - passed);
- } else {
- timeout = null;
- if (!immediate) result = func.apply(context, args);
- // This check is needed because `func` can recursively invoke `debounced`.
- if (!timeout) args = context = null;
- }
- };
-
- var debounced = restArguments(function(_args) {
- context = this;
- args = _args;
- previous = now();
- if (!timeout) {
- timeout = setTimeout(later, wait);
- if (immediate) result = func.apply(context, args);
- }
- return result;
- });
-
- debounced.cancel = function() {
- clearTimeout(timeout);
- timeout = args = context = null;
- };
-
- return debounced;
- }
-
- // Returns the first function passed as an argument to the second,
- // allowing you to adjust arguments, run code before and after, and
- // conditionally execute the original function.
- function wrap(func, wrapper) {
- return partial(wrapper, func);
- }
-
- // Returns a negated version of the passed-in predicate.
- function negate(predicate) {
- return function() {
- return !predicate.apply(this, arguments);
- };
- }
-
- // Returns a function that is the composition of a list of functions, each
- // consuming the return value of the function that follows.
- function compose() {
- var args = arguments;
- var start = args.length - 1;
- return function() {
- var i = start;
- var result = args[start].apply(this, arguments);
- while (i--) result = args[i].call(this, result);
- return result;
- };
- }
-
- // Returns a function that will only be executed on and after the Nth call.
- function after(times, func) {
- return function() {
- if (--times < 1) {
- return func.apply(this, arguments);
- }
- };
- }
-
- // Returns a function that will only be executed up to (but not including) the
- // Nth call.
- function before(times, func) {
- var memo;
- return function() {
- if (--times > 0) {
- memo = func.apply(this, arguments);
- }
- if (times <= 1) func = null;
- return memo;
- };
- }
-
- // Returns a function that will be executed at most one time, no matter how
- // often you call it. Useful for lazy initialization.
- var once = partial(before, 2);
-
- // Returns the first key on an object that passes a truth test.
- function findKey(obj, predicate, context) {
- predicate = cb(predicate, context);
- var _keys = keys(obj), key;
- for (var i = 0, length = _keys.length; i < length; i++) {
- key = _keys[i];
- if (predicate(obj[key], key, obj)) return key;
- }
- }
-
- // Internal function to generate `_.findIndex` and `_.findLastIndex`.
- function createPredicateIndexFinder(dir) {
- return function(array, predicate, context) {
- predicate = cb(predicate, context);
- var length = getLength(array);
- var index = dir > 0 ? 0 : length - 1;
- for (; index >= 0 && index < length; index += dir) {
- if (predicate(array[index], index, array)) return index;
- }
- return -1;
- };
- }
-
- // Returns the first index on an array-like that passes a truth test.
- var findIndex = createPredicateIndexFinder(1);
-
- // Returns the last index on an array-like that passes a truth test.
- var findLastIndex = createPredicateIndexFinder(-1);
-
- // Use a comparator function to figure out the smallest index at which
- // an object should be inserted so as to maintain order. Uses binary search.
- function sortedIndex(array, obj, iteratee, context) {
- iteratee = cb(iteratee, context, 1);
- var value = iteratee(obj);
- var low = 0, high = getLength(array);
- while (low < high) {
- var mid = Math.floor((low + high) / 2);
- if (iteratee(array[mid]) < value) low = mid + 1; else high = mid;
- }
- return low;
- }
-
- // Internal function to generate the `_.indexOf` and `_.lastIndexOf` functions.
- function createIndexFinder(dir, predicateFind, sortedIndex) {
- return function(array, item, idx) {
- var i = 0, length = getLength(array);
- if (typeof idx == 'number') {
- if (dir > 0) {
- i = idx >= 0 ? idx : Math.max(idx + length, i);
- } else {
- length = idx >= 0 ? Math.min(idx + 1, length) : idx + length + 1;
- }
- } else if (sortedIndex && idx && length) {
- idx = sortedIndex(array, item);
- return array[idx] === item ? idx : -1;
- }
- if (item !== item) {
- idx = predicateFind(slice.call(array, i, length), isNaN$1);
- return idx >= 0 ? idx + i : -1;
- }
- for (idx = dir > 0 ? i : length - 1; idx >= 0 && idx < length; idx += dir) {
- if (array[idx] === item) return idx;
- }
- return -1;
- };
- }
-
- // Return the position of the first occurrence of an item in an array,
- // or -1 if the item is not included in the array.
- // If the array is large and already in sort order, pass `true`
- // for **isSorted** to use binary search.
- var indexOf = createIndexFinder(1, findIndex, sortedIndex);
-
- // Return the position of the last occurrence of an item in an array,
- // or -1 if the item is not included in the array.
- var lastIndexOf = createIndexFinder(-1, findLastIndex);
-
- // Return the first value which passes a truth test.
- function find(obj, predicate, context) {
- var keyFinder = isArrayLike(obj) ? findIndex : findKey;
- var key = keyFinder(obj, predicate, context);
- if (key !== void 0 && key !== -1) return obj[key];
- }
-
- // Convenience version of a common use case of `_.find`: getting the first
- // object containing specific `key:value` pairs.
- function findWhere(obj, attrs) {
- return find(obj, matcher(attrs));
- }
-
- // The cornerstone for collection functions, an `each`
- // implementation, aka `forEach`.
- // Handles raw objects in addition to array-likes. Treats all
- // sparse array-likes as if they were dense.
- function each(obj, iteratee, context) {
- iteratee = optimizeCb(iteratee, context);
- var i, length;
- if (isArrayLike(obj)) {
- for (i = 0, length = obj.length; i < length; i++) {
- iteratee(obj[i], i, obj);
- }
- } else {
- var _keys = keys(obj);
- for (i = 0, length = _keys.length; i < length; i++) {
- iteratee(obj[_keys[i]], _keys[i], obj);
- }
- }
- return obj;
- }
-
- // Return the results of applying the iteratee to each element.
- function map(obj, iteratee, context) {
- iteratee = cb(iteratee, context);
- var _keys = !isArrayLike(obj) && keys(obj),
- length = (_keys || obj).length,
- results = Array(length);
- for (var index = 0; index < length; index++) {
- var currentKey = _keys ? _keys[index] : index;
- results[index] = iteratee(obj[currentKey], currentKey, obj);
- }
- return results;
- }
-
- // Internal helper to create a reducing function, iterating left or right.
- function createReduce(dir) {
- // Wrap code that reassigns argument variables in a separate function than
- // the one that accesses `arguments.length` to avoid a perf hit. (#1991)
- var reducer = function(obj, iteratee, memo, initial) {
- var _keys = !isArrayLike(obj) && keys(obj),
- length = (_keys || obj).length,
- index = dir > 0 ? 0 : length - 1;
- if (!initial) {
- memo = obj[_keys ? _keys[index] : index];
- index += dir;
- }
- for (; index >= 0 && index < length; index += dir) {
- var currentKey = _keys ? _keys[index] : index;
- memo = iteratee(memo, obj[currentKey], currentKey, obj);
- }
- return memo;
- };
-
- return function(obj, iteratee, memo, context) {
- var initial = arguments.length >= 3;
- return reducer(obj, optimizeCb(iteratee, context, 4), memo, initial);
- };
- }
-
- // **Reduce** builds up a single result from a list of values, aka `inject`,
- // or `foldl`.
- var reduce = createReduce(1);
-
- // The right-associative version of reduce, also known as `foldr`.
- var reduceRight = createReduce(-1);
-
- // Return all the elements that pass a truth test.
- function filter(obj, predicate, context) {
- var results = [];
- predicate = cb(predicate, context);
- each(obj, function(value, index, list) {
- if (predicate(value, index, list)) results.push(value);
- });
- return results;
- }
-
- // Return all the elements for which a truth test fails.
- function reject(obj, predicate, context) {
- return filter(obj, negate(cb(predicate)), context);
- }
-
- // Determine whether all of the elements pass a truth test.
- function every(obj, predicate, context) {
- predicate = cb(predicate, context);
- var _keys = !isArrayLike(obj) && keys(obj),
- length = (_keys || obj).length;
- for (var index = 0; index < length; index++) {
- var currentKey = _keys ? _keys[index] : index;
- if (!predicate(obj[currentKey], currentKey, obj)) return false;
- }
- return true;
- }
-
- // Determine if at least one element in the object passes a truth test.
- function some(obj, predicate, context) {
- predicate = cb(predicate, context);
- var _keys = !isArrayLike(obj) && keys(obj),
- length = (_keys || obj).length;
- for (var index = 0; index < length; index++) {
- var currentKey = _keys ? _keys[index] : index;
- if (predicate(obj[currentKey], currentKey, obj)) return true;
- }
- return false;
- }
-
- // Determine if the array or object contains a given item (using `===`).
- function contains(obj, item, fromIndex, guard) {
- if (!isArrayLike(obj)) obj = values(obj);
- if (typeof fromIndex != 'number' || guard) fromIndex = 0;
- return indexOf(obj, item, fromIndex) >= 0;
- }
-
- // Invoke a method (with arguments) on every item in a collection.
- var invoke = restArguments(function(obj, path, args) {
- var contextPath, func;
- if (isFunction$1(path)) {
- func = path;
- } else {
- path = toPath(path);
- contextPath = path.slice(0, -1);
- path = path[path.length - 1];
- }
- return map(obj, function(context) {
- var method = func;
- if (!method) {
- if (contextPath && contextPath.length) {
- context = deepGet(context, contextPath);
- }
- if (context == null) return void 0;
- method = context[path];
- }
- return method == null ? method : method.apply(context, args);
- });
- });
-
- // Convenience version of a common use case of `_.map`: fetching a property.
- function pluck(obj, key) {
- return map(obj, property(key));
- }
-
- // Convenience version of a common use case of `_.filter`: selecting only
- // objects containing specific `key:value` pairs.
- function where(obj, attrs) {
- return filter(obj, matcher(attrs));
- }
-
- // Return the maximum element (or element-based computation).
- function max(obj, iteratee, context) {
- var result = -Infinity, lastComputed = -Infinity,
- value, computed;
- if (iteratee == null || typeof iteratee == 'number' && typeof obj[0] != 'object' && obj != null) {
- obj = isArrayLike(obj) ? obj : values(obj);
- for (var i = 0, length = obj.length; i < length; i++) {
- value = obj[i];
- if (value != null && value > result) {
- result = value;
- }
- }
- } else {
- iteratee = cb(iteratee, context);
- each(obj, function(v, index, list) {
- computed = iteratee(v, index, list);
- if (computed > lastComputed || computed === -Infinity && result === -Infinity) {
- result = v;
- lastComputed = computed;
- }
- });
- }
- return result;
- }
-
- // Return the minimum element (or element-based computation).
- function min(obj, iteratee, context) {
- var result = Infinity, lastComputed = Infinity,
- value, computed;
- if (iteratee == null || typeof iteratee == 'number' && typeof obj[0] != 'object' && obj != null) {
- obj = isArrayLike(obj) ? obj : values(obj);
- for (var i = 0, length = obj.length; i < length; i++) {
- value = obj[i];
- if (value != null && value < result) {
- result = value;
- }
- }
- } else {
- iteratee = cb(iteratee, context);
- each(obj, function(v, index, list) {
- computed = iteratee(v, index, list);
- if (computed < lastComputed || computed === Infinity && result === Infinity) {
- result = v;
- lastComputed = computed;
- }
- });
- }
- return result;
- }
-
- // Sample **n** random values from a collection using the modern version of the
- // [Fisher-Yates shuffle](https://en.wikipedia.org/wiki/Fisher–Yates_shuffle).
- // If **n** is not specified, returns a single random element.
- // The internal `guard` argument allows it to work with `_.map`.
- function sample(obj, n, guard) {
- if (n == null || guard) {
- if (!isArrayLike(obj)) obj = values(obj);
- return obj[random(obj.length - 1)];
- }
- var sample = isArrayLike(obj) ? clone(obj) : values(obj);
- var length = getLength(sample);
- n = Math.max(Math.min(n, length), 0);
- var last = length - 1;
- for (var index = 0; index < n; index++) {
- var rand = random(index, last);
- var temp = sample[index];
- sample[index] = sample[rand];
- sample[rand] = temp;
- }
- return sample.slice(0, n);
- }
-
- // Shuffle a collection.
- function shuffle(obj) {
- return sample(obj, Infinity);
- }
-
- // Sort the object's values by a criterion produced by an iteratee.
- function sortBy(obj, iteratee, context) {
- var index = 0;
- iteratee = cb(iteratee, context);
- return pluck(map(obj, function(value, key, list) {
- return {
- value: value,
- index: index++,
- criteria: iteratee(value, key, list)
- };
- }).sort(function(left, right) {
- var a = left.criteria;
- var b = right.criteria;
- if (a !== b) {
- if (a > b || a === void 0) return 1;
- if (a < b || b === void 0) return -1;
- }
- return left.index - right.index;
- }), 'value');
- }
-
- // An internal function used for aggregate "group by" operations.
- function group(behavior, partition) {
- return function(obj, iteratee, context) {
- var result = partition ? [[], []] : {};
- iteratee = cb(iteratee, context);
- each(obj, function(value, index) {
- var key = iteratee(value, index, obj);
- behavior(result, value, key);
- });
- return result;
- };
- }
-
- // Groups the object's values by a criterion. Pass either a string attribute
- // to group by, or a function that returns the criterion.
- var groupBy = group(function(result, value, key) {
- if (has$1(result, key)) result[key].push(value); else result[key] = [value];
- });
-
- // Indexes the object's values by a criterion, similar to `_.groupBy`, but for
- // when you know that your index values will be unique.
- var indexBy = group(function(result, value, key) {
- result[key] = value;
- });
-
- // Counts instances of an object that group by a certain criterion. Pass
- // either a string attribute to count by, or a function that returns the
- // criterion.
- var countBy = group(function(result, value, key) {
- if (has$1(result, key)) result[key]++; else result[key] = 1;
- });
-
- // Split a collection into two arrays: one whose elements all pass the given
- // truth test, and one whose elements all do not pass the truth test.
- var partition = group(function(result, value, pass) {
- result[pass ? 0 : 1].push(value);
- }, true);
-
- // Safely create a real, live array from anything iterable.
- var reStrSymbol = /[^\ud800-\udfff]|[\ud800-\udbff][\udc00-\udfff]|[\ud800-\udfff]/g;
- function toArray(obj) {
- if (!obj) return [];
- if (isArray(obj)) return slice.call(obj);
- if (isString(obj)) {
- // Keep surrogate pair characters together.
- return obj.match(reStrSymbol);
- }
- if (isArrayLike(obj)) return map(obj, identity);
- return values(obj);
- }
-
- // Return the number of elements in a collection.
- function size(obj) {
- if (obj == null) return 0;
- return isArrayLike(obj) ? obj.length : keys(obj).length;
- }
-
- // Internal `_.pick` helper function to determine whether `key` is an enumerable
- // property name of `obj`.
- function keyInObj(value, key, obj) {
- return key in obj;
- }
-
- // Return a copy of the object only containing the allowed properties.
- var pick = restArguments(function(obj, keys) {
- var result = {}, iteratee = keys[0];
- if (obj == null) return result;
- if (isFunction$1(iteratee)) {
- if (keys.length > 1) iteratee = optimizeCb(iteratee, keys[1]);
- keys = allKeys(obj);
- } else {
- iteratee = keyInObj;
- keys = flatten$1(keys, false, false);
- obj = Object(obj);
- }
- for (var i = 0, length = keys.length; i < length; i++) {
- var key = keys[i];
- var value = obj[key];
- if (iteratee(value, key, obj)) result[key] = value;
- }
- return result;
- });
-
- // Return a copy of the object without the disallowed properties.
- var omit = restArguments(function(obj, keys) {
- var iteratee = keys[0], context;
- if (isFunction$1(iteratee)) {
- iteratee = negate(iteratee);
- if (keys.length > 1) context = keys[1];
- } else {
- keys = map(flatten$1(keys, false, false), String);
- iteratee = function(value, key) {
- return !contains(keys, key);
- };
- }
- return pick(obj, iteratee, context);
- });
-
- // Returns everything but the last entry of the array. Especially useful on
- // the arguments object. Passing **n** will return all the values in
- // the array, excluding the last N.
- function initial(array, n, guard) {
- return slice.call(array, 0, Math.max(0, array.length - (n == null || guard ? 1 : n)));
- }
-
- // Get the first element of an array. Passing **n** will return the first N
- // values in the array. The **guard** check allows it to work with `_.map`.
- function first(array, n, guard) {
- if (array == null || array.length < 1) return n == null || guard ? void 0 : [];
- if (n == null || guard) return array[0];
- return initial(array, array.length - n);
- }
-
- // Returns everything but the first entry of the `array`. Especially useful on
- // the `arguments` object. Passing an **n** will return the rest N values in the
- // `array`.
- function rest(array, n, guard) {
- return slice.call(array, n == null || guard ? 1 : n);
- }
-
- // Get the last element of an array. Passing **n** will return the last N
- // values in the array.
- function last(array, n, guard) {
- if (array == null || array.length < 1) return n == null || guard ? void 0 : [];
- if (n == null || guard) return array[array.length - 1];
- return rest(array, Math.max(0, array.length - n));
- }
-
- // Trim out all falsy values from an array.
- function compact(array) {
- return filter(array, Boolean);
- }
-
- // Flatten out an array, either recursively (by default), or up to `depth`.
- // Passing `true` or `false` as `depth` means `1` or `Infinity`, respectively.
- function flatten(array, depth) {
- return flatten$1(array, depth, false);
- }
-
- // Take the difference between one array and a number of other arrays.
- // Only the elements present in just the first array will remain.
- var difference = restArguments(function(array, rest) {
- rest = flatten$1(rest, true, true);
- return filter(array, function(value){
- return !contains(rest, value);
- });
- });
-
- // Return a version of the array that does not contain the specified value(s).
- var without = restArguments(function(array, otherArrays) {
- return difference(array, otherArrays);
- });
-
- // Produce a duplicate-free version of the array. If the array has already
- // been sorted, you have the option of using a faster algorithm.
- // The faster algorithm will not work with an iteratee if the iteratee
- // is not a one-to-one function, so providing an iteratee will disable
- // the faster algorithm.
- function uniq(array, isSorted, iteratee, context) {
- if (!isBoolean(isSorted)) {
- context = iteratee;
- iteratee = isSorted;
- isSorted = false;
- }
- if (iteratee != null) iteratee = cb(iteratee, context);
- var result = [];
- var seen = [];
- for (var i = 0, length = getLength(array); i < length; i++) {
- var value = array[i],
- computed = iteratee ? iteratee(value, i, array) : value;
- if (isSorted && !iteratee) {
- if (!i || seen !== computed) result.push(value);
- seen = computed;
- } else if (iteratee) {
- if (!contains(seen, computed)) {
- seen.push(computed);
- result.push(value);
- }
- } else if (!contains(result, value)) {
- result.push(value);
- }
- }
- return result;
- }
-
- // Produce an array that contains the union: each distinct element from all of
- // the passed-in arrays.
- var union = restArguments(function(arrays) {
- return uniq(flatten$1(arrays, true, true));
- });
-
- // Produce an array that contains every item shared between all the
- // passed-in arrays.
- function intersection(array) {
- var result = [];
- var argsLength = arguments.length;
- for (var i = 0, length = getLength(array); i < length; i++) {
- var item = array[i];
- if (contains(result, item)) continue;
- var j;
- for (j = 1; j < argsLength; j++) {
- if (!contains(arguments[j], item)) break;
- }
- if (j === argsLength) result.push(item);
- }
- return result;
- }
-
- // Complement of zip. Unzip accepts an array of arrays and groups
- // each array's elements on shared indices.
- function unzip(array) {
- var length = array && max(array, getLength).length || 0;
- var result = Array(length);
-
- for (var index = 0; index < length; index++) {
- result[index] = pluck(array, index);
- }
- return result;
- }
-
- // Zip together multiple lists into a single array -- elements that share
- // an index go together.
- var zip = restArguments(unzip);
-
- // Converts lists into objects. Pass either a single array of `[key, value]`
- // pairs, or two parallel arrays of the same length -- one of keys, and one of
- // the corresponding values. Passing by pairs is the reverse of `_.pairs`.
- function object(list, values) {
- var result = {};
- for (var i = 0, length = getLength(list); i < length; i++) {
- if (values) {
- result[list[i]] = values[i];
- } else {
- result[list[i][0]] = list[i][1];
- }
- }
- return result;
- }
-
- // Generate an integer Array containing an arithmetic progression. A port of
- // the native Python `range()` function. See
- // [the Python documentation](https://docs.python.org/library/functions.html#range).
- function range(start, stop, step) {
- if (stop == null) {
- stop = start || 0;
- start = 0;
- }
- if (!step) {
- step = stop < start ? -1 : 1;
- }
-
- var length = Math.max(Math.ceil((stop - start) / step), 0);
- var range = Array(length);
-
- for (var idx = 0; idx < length; idx++, start += step) {
- range[idx] = start;
- }
-
- return range;
- }
-
- // Chunk a single array into multiple arrays, each containing `count` or fewer
- // items.
- function chunk(array, count) {
- if (count == null || count < 1) return [];
- var result = [];
- var i = 0, length = array.length;
- while (i < length) {
- result.push(slice.call(array, i, i += count));
- }
- return result;
- }
-
- // Helper function to continue chaining intermediate results.
- function chainResult(instance, obj) {
- return instance._chain ? _$1(obj).chain() : obj;
- }
-
- // Add your own custom functions to the Underscore object.
- function mixin(obj) {
- each(functions(obj), function(name) {
- var func = _$1[name] = obj[name];
- _$1.prototype[name] = function() {
- var args = [this._wrapped];
- push.apply(args, arguments);
- return chainResult(this, func.apply(_$1, args));
- };
- });
- return _$1;
- }
-
- // Add all mutator `Array` functions to the wrapper.
- each(['pop', 'push', 'reverse', 'shift', 'sort', 'splice', 'unshift'], function(name) {
- var method = ArrayProto[name];
- _$1.prototype[name] = function() {
- var obj = this._wrapped;
- if (obj != null) {
- method.apply(obj, arguments);
- if ((name === 'shift' || name === 'splice') && obj.length === 0) {
- delete obj[0];
- }
- }
- return chainResult(this, obj);
- };
- });
-
- // Add all accessor `Array` functions to the wrapper.
- each(['concat', 'join', 'slice'], function(name) {
- var method = ArrayProto[name];
- _$1.prototype[name] = function() {
- var obj = this._wrapped;
- if (obj != null) obj = method.apply(obj, arguments);
- return chainResult(this, obj);
- };
- });
-
- // Named Exports
-
- var allExports = {
- __proto__: null,
- VERSION: VERSION,
- restArguments: restArguments,
- isObject: isObject,
- isNull: isNull,
- isUndefined: isUndefined,
- isBoolean: isBoolean,
- isElement: isElement,
- isString: isString,
- isNumber: isNumber,
- isDate: isDate,
- isRegExp: isRegExp,
- isError: isError,
- isSymbol: isSymbol,
- isArrayBuffer: isArrayBuffer,
- isDataView: isDataView$1,
- isArray: isArray,
- isFunction: isFunction$1,
- isArguments: isArguments$1,
- isFinite: isFinite$1,
- isNaN: isNaN$1,
- isTypedArray: isTypedArray$1,
- isEmpty: isEmpty,
- isMatch: isMatch,
- isEqual: isEqual,
- isMap: isMap,
- isWeakMap: isWeakMap,
- isSet: isSet,
- isWeakSet: isWeakSet,
- keys: keys,
- allKeys: allKeys,
- values: values,
- pairs: pairs,
- invert: invert,
- functions: functions,
- methods: functions,
- extend: extend,
- extendOwn: extendOwn,
- assign: extendOwn,
- defaults: defaults,
- create: create,
- clone: clone,
- tap: tap,
- get: get,
- has: has,
- mapObject: mapObject,
- identity: identity,
- constant: constant,
- noop: noop,
- toPath: toPath$1,
- property: property,
- propertyOf: propertyOf,
- matcher: matcher,
- matches: matcher,
- times: times,
- random: random,
- now: now,
- escape: _escape,
- unescape: _unescape,
- templateSettings: templateSettings,
- template: template,
- result: result,
- uniqueId: uniqueId,
- chain: chain,
- iteratee: iteratee,
- partial: partial,
- bind: bind,
- bindAll: bindAll,
- memoize: memoize,
- delay: delay,
- defer: defer,
- throttle: throttle,
- debounce: debounce,
- wrap: wrap,
- negate: negate,
- compose: compose,
- after: after,
- before: before,
- once: once,
- findKey: findKey,
- findIndex: findIndex,
- findLastIndex: findLastIndex,
- sortedIndex: sortedIndex,
- indexOf: indexOf,
- lastIndexOf: lastIndexOf,
- find: find,
- detect: find,
- findWhere: findWhere,
- each: each,
- forEach: each,
- map: map,
- collect: map,
- reduce: reduce,
- foldl: reduce,
- inject: reduce,
- reduceRight: reduceRight,
- foldr: reduceRight,
- filter: filter,
- select: filter,
- reject: reject,
- every: every,
- all: every,
- some: some,
- any: some,
- contains: contains,
- includes: contains,
- include: contains,
- invoke: invoke,
- pluck: pluck,
- where: where,
- max: max,
- min: min,
- shuffle: shuffle,
- sample: sample,
- sortBy: sortBy,
- groupBy: groupBy,
- indexBy: indexBy,
- countBy: countBy,
- partition: partition,
- toArray: toArray,
- size: size,
- pick: pick,
- omit: omit,
- first: first,
- head: first,
- take: first,
- initial: initial,
- last: last,
- rest: rest,
- tail: rest,
- drop: rest,
- compact: compact,
- flatten: flatten,
- without: without,
- uniq: uniq,
- unique: uniq,
- union: union,
- intersection: intersection,
- difference: difference,
- unzip: unzip,
- transpose: unzip,
- zip: zip,
- object: object,
- range: range,
- chunk: chunk,
- mixin: mixin,
- 'default': _$1
- };
-
- // Default Export
-
- // Add all of the Underscore functions to the wrapper object.
- var _ = mixin(allExports);
- // Legacy Node.js API.
- _._ = _;
-
- return _;
-
-})));
-//# sourceMappingURL=underscore-umd.js.map
diff --git a/docs/_static/underscore.js b/docs/_static/underscore.js
index cf177d4..5b55f32 100644
--- a/docs/_static/underscore.js
+++ b/docs/_static/underscore.js
@@ -1,6 +1,31 @@
-!function(n,r){"object"==typeof exports&&"undefined"!=typeof module?module.exports=r():"function"==typeof define&&define.amd?define("underscore",r):(n="undefined"!=typeof globalThis?globalThis:n||self,function(){var t=n._,e=n._=r();e.noConflict=function(){return n._=t,e}}())}(this,(function(){
-// Underscore.js 1.13.1
-// https://underscorejs.org
-// (c) 2009-2021 Jeremy Ashkenas, Julian Gonggrijp, and DocumentCloud and Investigative Reporters & Editors
-// Underscore may be freely distributed under the MIT license.
-var n="1.13.1",r="object"==typeof self&&self.self===self&&self||"object"==typeof global&&global.global===global&&global||Function("return this")()||{},t=Array.prototype,e=Object.prototype,u="undefined"!=typeof Symbol?Symbol.prototype:null,o=t.push,i=t.slice,a=e.toString,f=e.hasOwnProperty,c="undefined"!=typeof ArrayBuffer,l="undefined"!=typeof DataView,s=Array.isArray,p=Object.keys,v=Object.create,h=c&&ArrayBuffer.isView,y=isNaN,d=isFinite,g=!{toString:null}.propertyIsEnumerable("toString"),b=["valueOf","isPrototypeOf","toString","propertyIsEnumerable","hasOwnProperty","toLocaleString"],m=Math.pow(2,53)-1;function j(n,r){return r=null==r?n.length-1:+r,function(){for(var t=Math.max(arguments.length-r,0),e=Array(t),u=0;u=0&&t<=m}}function J(n){return function(r){return null==r?void 0:r[n]}}var G=J("byteLength"),H=K(G),Q=/\[object ((I|Ui)nt(8|16|32)|Float(32|64)|Uint8Clamped|Big(I|Ui)nt64)Array\]/;var X=c?function(n){return h?h(n)&&!q(n):H(n)&&Q.test(a.call(n))}:C(!1),Y=J("length");function Z(n,r){r=function(n){for(var r={},t=n.length,e=0;e":">",'"':""","'":"'","`":"`"},Cn=Ln($n),Kn=Ln(_n($n)),Jn=tn.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g},Gn=/(.)^/,Hn={"'":"'","\\":"\\","\r":"r","\n":"n","\u2028":"u2028","\u2029":"u2029"},Qn=/\\|'|\r|\n|\u2028|\u2029/g;function Xn(n){return"\\"+Hn[n]}var Yn=/^\s*(\w|\$)+\s*$/;var Zn=0;function nr(n,r,t,e,u){if(!(e instanceof r))return n.apply(t,u);var o=Mn(n.prototype),i=n.apply(o,u);return _(i)?i:o}var rr=j((function(n,r){var t=rr.placeholder,e=function(){for(var u=0,o=r.length,i=Array(o),a=0;a1)ur(a,r-1,t,e),u=e.length;else for(var f=0,c=a.length;f0&&(t=r.apply(this,arguments)),n<=1&&(r=null),t}}var lr=rr(cr,2);function sr(n,r,t){r=qn(r,t);for(var e,u=nn(n),o=0,i=u.length;o0?0:u-1;o>=0&&o0?a=o>=0?o:Math.max(o+f,a):f=o>=0?Math.min(o+1,f):o+f+1;else if(t&&o&&f)return e[o=t(e,u)]===u?o:-1;if(u!=u)return(o=r(i.call(e,a,f),$))>=0?o+a:-1;for(o=n>0?a:f-1;o>=0&&o0?0:i-1;for(u||(e=r[o?o[a]:a],a+=n);a>=0&&a=3;return r(n,Fn(t,u,4),e,o)}}var Ar=wr(1),xr=wr(-1);function Sr(n,r,t){var e=[];return r=qn(r,t),jr(n,(function(n,t,u){r(n,t,u)&&e.push(n)})),e}function Or(n,r,t){r=qn(r,t);for(var e=!er(n)&&nn(n),u=(e||n).length,o=0;o=0}var Br=j((function(n,r,t){var e,u;return D(r)?u=r:(r=Nn(r),e=r.slice(0,-1),r=r[r.length-1]),_r(n,(function(n){var o=u;if(!o){if(e&&e.length&&(n=In(n,e)),null==n)return;o=n[r]}return null==o?o:o.apply(n,t)}))}));function Nr(n,r){return _r(n,Rn(r))}function Ir(n,r,t){var e,u,o=-1/0,i=-1/0;if(null==r||"number"==typeof r&&"object"!=typeof n[0]&&null!=n)for(var a=0,f=(n=er(n)?n:jn(n)).length;ao&&(o=e);else r=qn(r,t),jr(n,(function(n,t,e){((u=r(n,t,e))>i||u===-1/0&&o===-1/0)&&(o=n,i=u)}));return o}function Tr(n,r,t){if(null==r||t)return er(n)||(n=jn(n)),n[Wn(n.length-1)];var e=er(n)?En(n):jn(n),u=Y(e);r=Math.max(Math.min(r,u),0);for(var o=u-1,i=0;i1&&(e=Fn(e,r[1])),r=an(n)):(e=qr,r=ur(r,!1,!1),n=Object(n));for(var u=0,o=r.length;u1&&(t=r[1])):(r=_r(ur(r,!1,!1),String),e=function(n,t){return!Er(r,t)}),Ur(n,e,t)}));function zr(n,r,t){return i.call(n,0,Math.max(0,n.length-(null==r||t?1:r)))}function Lr(n,r,t){return null==n||n.length<1?null==r||t?void 0:[]:null==r||t?n[0]:zr(n,n.length-r)}function $r(n,r,t){return i.call(n,null==r||t?1:r)}var Cr=j((function(n,r){return r=ur(r,!0,!0),Sr(n,(function(n){return!Er(r,n)}))})),Kr=j((function(n,r){return Cr(n,r)}));function Jr(n,r,t,e){A(r)||(e=t,t=r,r=!1),null!=t&&(t=qn(t,e));for(var u=[],o=[],i=0,a=Y(n);ir?(e&&(clearTimeout(e),e=null),a=c,i=n.apply(u,o),e||(u=o=null)):e||!1===t.trailing||(e=setTimeout(f,l)),i};return c.cancel=function(){clearTimeout(e),a=0,e=u=o=null},c},debounce:function(n,r,t){var e,u,o,i,a,f=function(){var c=zn()-u;r>c?e=setTimeout(f,r-c):(e=null,t||(i=n.apply(a,o)),e||(o=a=null))},c=j((function(c){return a=this,o=c,u=zn(),e||(e=setTimeout(f,r),t&&(i=n.apply(a,o))),i}));return c.cancel=function(){clearTimeout(e),e=o=a=null},c},wrap:function(n,r){return rr(r,n)},negate:fr,compose:function(){var n=arguments,r=n.length-1;return function(){for(var t=r,e=n[r].apply(this,arguments);t--;)e=n[t].call(this,e);return e}},after:function(n,r){return function(){if(--n<1)return r.apply(this,arguments)}},before:cr,once:lr,findKey:sr,findIndex:vr,findLastIndex:hr,sortedIndex:yr,indexOf:gr,lastIndexOf:br,find:mr,detect:mr,findWhere:function(n,r){return mr(n,Dn(r))},each:jr,forEach:jr,map:_r,collect:_r,reduce:Ar,foldl:Ar,inject:Ar,reduceRight:xr,foldr:xr,filter:Sr,select:Sr,reject:function(n,r,t){return Sr(n,fr(qn(r)),t)},every:Or,all:Or,some:Mr,any:Mr,contains:Er,includes:Er,include:Er,invoke:Br,pluck:Nr,where:function(n,r){return Sr(n,Dn(r))},max:Ir,min:function(n,r,t){var e,u,o=1/0,i=1/0;if(null==r||"number"==typeof r&&"object"!=typeof n[0]&&null!=n)for(var a=0,f=(n=er(n)?n:jn(n)).length;ae||void 0===t)return 1;if(t2;a==
+null&&(a=[]);if(y&&a.reduce===y)return e&&(c=b.bind(c,e)),f?a.reduce(c,d):a.reduce(c);j(a,function(a,b,i){f?d=c.call(e,d,a,b,i):(d=a,f=true)});if(!f)throw new TypeError("Reduce of empty array with no initial value");return d};b.reduceRight=b.foldr=function(a,c,d,e){var f=arguments.length>2;a==null&&(a=[]);if(z&&a.reduceRight===z)return e&&(c=b.bind(c,e)),f?a.reduceRight(c,d):a.reduceRight(c);var g=b.toArray(a).reverse();e&&!f&&(c=b.bind(c,e));return f?b.reduce(g,c,d,e):b.reduce(g,c)};b.find=b.detect=
+function(a,c,b){var e;E(a,function(a,g,h){if(c.call(b,a,g,h))return e=a,true});return e};b.filter=b.select=function(a,c,b){var e=[];if(a==null)return e;if(A&&a.filter===A)return a.filter(c,b);j(a,function(a,g,h){c.call(b,a,g,h)&&(e[e.length]=a)});return e};b.reject=function(a,c,b){var e=[];if(a==null)return e;j(a,function(a,g,h){c.call(b,a,g,h)||(e[e.length]=a)});return e};b.every=b.all=function(a,c,b){var e=true;if(a==null)return e;if(B&&a.every===B)return a.every(c,b);j(a,function(a,g,h){if(!(e=
+e&&c.call(b,a,g,h)))return n});return e};var E=b.some=b.any=function(a,c,d){c||(c=b.identity);var e=false;if(a==null)return e;if(C&&a.some===C)return a.some(c,d);j(a,function(a,b,h){if(e||(e=c.call(d,a,b,h)))return n});return!!e};b.include=b.contains=function(a,c){var b=false;if(a==null)return b;return p&&a.indexOf===p?a.indexOf(c)!=-1:b=E(a,function(a){return a===c})};b.invoke=function(a,c){var d=i.call(arguments,2);return b.map(a,function(a){return(b.isFunction(c)?c||a:a[c]).apply(a,d)})};b.pluck=
+function(a,c){return b.map(a,function(a){return a[c]})};b.max=function(a,c,d){if(!c&&b.isArray(a))return Math.max.apply(Math,a);if(!c&&b.isEmpty(a))return-Infinity;var e={computed:-Infinity};j(a,function(a,b,h){b=c?c.call(d,a,b,h):a;b>=e.computed&&(e={value:a,computed:b})});return e.value};b.min=function(a,c,d){if(!c&&b.isArray(a))return Math.min.apply(Math,a);if(!c&&b.isEmpty(a))return Infinity;var e={computed:Infinity};j(a,function(a,b,h){b=c?c.call(d,a,b,h):a;bd?1:0}),"value")};b.groupBy=function(a,c){var d={},e=b.isFunction(c)?c:function(a){return a[c]};j(a,function(a,b){var c=e(a,b);(d[c]||(d[c]=[])).push(a)});return d};b.sortedIndex=function(a,
+c,d){d||(d=b.identity);for(var e=0,f=a.length;e>1;d(a[g])=0})})};b.difference=function(a){var c=b.flatten(i.call(arguments,1));return b.filter(a,function(a){return!b.include(c,a)})};b.zip=function(){for(var a=i.call(arguments),c=b.max(b.pluck(a,"length")),d=Array(c),e=0;e=0;d--)b=[a[d].apply(this,b)];return b[0]}};
+b.after=function(a,b){return a<=0?b():function(){if(--a<1)return b.apply(this,arguments)}};b.keys=J||function(a){if(a!==Object(a))throw new TypeError("Invalid object");var c=[],d;for(d in a)b.has(a,d)&&(c[c.length]=d);return c};b.values=function(a){return b.map(a,b.identity)};b.functions=b.methods=function(a){var c=[],d;for(d in a)b.isFunction(a[d])&&c.push(d);return c.sort()};b.extend=function(a){j(i.call(arguments,1),function(b){for(var d in b)a[d]=b[d]});return a};b.defaults=function(a){j(i.call(arguments,
+1),function(b){for(var d in b)a[d]==null&&(a[d]=b[d])});return a};b.clone=function(a){return!b.isObject(a)?a:b.isArray(a)?a.slice():b.extend({},a)};b.tap=function(a,b){b(a);return a};b.isEqual=function(a,b){return q(a,b,[])};b.isEmpty=function(a){if(b.isArray(a)||b.isString(a))return a.length===0;for(var c in a)if(b.has(a,c))return false;return true};b.isElement=function(a){return!!(a&&a.nodeType==1)};b.isArray=o||function(a){return l.call(a)=="[object Array]"};b.isObject=function(a){return a===Object(a)};
+b.isArguments=function(a){return l.call(a)=="[object Arguments]"};if(!b.isArguments(arguments))b.isArguments=function(a){return!(!a||!b.has(a,"callee"))};b.isFunction=function(a){return l.call(a)=="[object Function]"};b.isString=function(a){return l.call(a)=="[object String]"};b.isNumber=function(a){return l.call(a)=="[object Number]"};b.isNaN=function(a){return a!==a};b.isBoolean=function(a){return a===true||a===false||l.call(a)=="[object Boolean]"};b.isDate=function(a){return l.call(a)=="[object Date]"};
+b.isRegExp=function(a){return l.call(a)=="[object RegExp]"};b.isNull=function(a){return a===null};b.isUndefined=function(a){return a===void 0};b.has=function(a,b){return I.call(a,b)};b.noConflict=function(){r._=G;return this};b.identity=function(a){return a};b.times=function(a,b,d){for(var e=0;e/g,">").replace(/"/g,""").replace(/'/g,"'").replace(/\//g,"/")};b.mixin=function(a){j(b.functions(a),
+function(c){K(c,b[c]=a[c])})};var L=0;b.uniqueId=function(a){var b=L++;return a?a+b:b};b.templateSettings={evaluate:/<%([\s\S]+?)%>/g,interpolate:/<%=([\s\S]+?)%>/g,escape:/<%-([\s\S]+?)%>/g};var t=/.^/,u=function(a){return a.replace(/\\\\/g,"\\").replace(/\\'/g,"'")};b.template=function(a,c){var d=b.templateSettings,d="var __p=[],print=function(){__p.push.apply(__p,arguments);};with(obj||{}){__p.push('"+a.replace(/\\/g,"\\\\").replace(/'/g,"\\'").replace(d.escape||t,function(a,b){return"',_.escape("+
+u(b)+"),'"}).replace(d.interpolate||t,function(a,b){return"',"+u(b)+",'"}).replace(d.evaluate||t,function(a,b){return"');"+u(b).replace(/[\r\n\t]/g," ")+";__p.push('"}).replace(/\r/g,"\\r").replace(/\n/g,"\\n").replace(/\t/g,"\\t")+"');}return __p.join('');",e=new Function("obj","_",d);return c?e(c,b):function(a){return e.call(this,a,b)}};b.chain=function(a){return b(a).chain()};var m=function(a){this._wrapped=a};b.prototype=m.prototype;var v=function(a,c){return c?b(a).chain():a},K=function(a,c){m.prototype[a]=
+function(){var a=i.call(arguments);H.call(a,this._wrapped);return v(c.apply(b,a),this._chain)}};b.mixin(b);j("pop,push,reverse,shift,sort,splice,unshift".split(","),function(a){var b=k[a];m.prototype[a]=function(){var d=this._wrapped;b.apply(d,arguments);var e=d.length;(a=="shift"||a=="splice")&&e===0&&delete d[0];return v(d,this._chain)}});j(["concat","join","slice"],function(a){var b=k[a];m.prototype[a]=function(){return v(b.apply(this._wrapped,arguments),this._chain)}});m.prototype.chain=function(){this._chain=
+true;return this};m.prototype.value=function(){return this._wrapped}}).call(this);
diff --git a/docs/basic_main.html b/docs/basic_main.html
index 551dae4..a74fa74 100644
--- a/docs/basic_main.html
+++ b/docs/basic_main.html
@@ -19,10 +19,6 @@
-
-
-
-
@@ -148,9 +144,6 @@
FILE_SUFFIX:'.html',
HAS_SOURCE: true
};
-
-
+
diff --git a/docs/example.html b/docs/example.html
index b77f93f..926439d 100644
--- a/docs/example.html
+++ b/docs/example.html
@@ -19,10 +19,6 @@
-
-
-
-
@@ -62,7 +58,7 @@
-
+
- PyCTBN.PyCTBN package
- Subpackages
@@ -116,14 +112,9 @@
@@ -153,9 +144,6 @@
FILE_SUFFIX:'.html',
HAS_SOURCE: true
};
-
-
+
diff --git a/docs/examples.html b/docs/examples.html
index 3f6fa37..2755cf0 100644
--- a/docs/examples.html
+++ b/docs/examples.html
@@ -19,10 +19,6 @@
-
-
-
-
@@ -272,9 +268,6 @@
FILE_SUFFIX:'.html',
HAS_SOURCE: true
};
-
-
+
diff --git a/docs/genindex.html b/docs/genindex.html
index e58c172..763383b 100644
--- a/docs/genindex.html
+++ b/docs/genindex.html
@@ -19,10 +19,6 @@
-
-
-
-
@@ -148,7 +144,7 @@
- AbstractImporter (class in PyCTBN.PyCTBN.utility.abstract_importer)
- - actual_cims (PyCTBN.PyCTBN.structure_graph.set_of_cims.SetOfCims property)
+
- actual_cims() (PyCTBN.PyCTBN.structure_graph.set_of_cims.SetOfCims property)
- add_edge() (PyCTBN.PyCTBN.structure_graph.structure.Structure method)
@@ -232,11 +228,11 @@
- Cache (class in PyCTBN.PyCTBN.utility.cache)
- - cim (PyCTBN.PyCTBN.structure_graph.conditional_intensity_matrix.ConditionalIntensityMatrix property)
+
- cim() (PyCTBN.PyCTBN.structure_graph.conditional_intensity_matrix.ConditionalIntensityMatrix property)
- cim_equality_test() (PyCTBN.tests.estimators.test_parameters_estimator.TestParametersEstimatior method)
- - cims (PyCTBN.PyCTBN.structure_graph.network_generator.NetworkGenerator property)
+
- cims() (PyCTBN.PyCTBN.structure_graph.network_generator.NetworkGenerator property)
- cims_to_json() (PyCTBN.PyCTBN.utility.json_exporter.JsonExporter method)
@@ -254,7 +250,7 @@
- complete_test() (PyCTBN.PyCTBN.estimators.structure_constraint_based_estimator.StructureConstraintBasedEstimator method)
- - complete_trajectory (PyCTBN.PyCTBN.structure_graph.trajectory.Trajectory property)
+
- complete_trajectory() (PyCTBN.PyCTBN.structure_graph.trajectory.Trajectory property)
@@ -272,7 +268,7 @@
- compute_thumb_value() (PyCTBN.PyCTBN.estimators.structure_constraint_based_estimator.StructureConstraintBasedEstimator method)
- - concatenated_samples (PyCTBN.PyCTBN.utility.abstract_importer.AbstractImporter property)
+
- concatenated_samples() (PyCTBN.PyCTBN.utility.abstract_importer.AbstractImporter property)
- ConditionalIntensityMatrix (class in PyCTBN.PyCTBN.structure_graph.conditional_intensity_matrix)
@@ -300,7 +296,7 @@
|
|
|