Input data for a single node This takes input, feeds it to self._data_input.generate(), and updates the dependencies via self._tree.update_status(). The kwargs can be for normal (keywords `mean` and `stdev`), BetaPert (keywords `low`, `mode`, `high`, and `gamma`), ,
(self, target, **kwargs)
| 245 | ########################################################################## |
| 246 | |
| 247 | def input_data(self, target, **kwargs): |
| 248 | """Input data for a single node |
| 249 | |
| 250 | This takes input, feeds it to self._data_input.generate(), and |
| 251 | updates the dependencies via self._tree.update_status(). The kwargs |
| 252 | can be for normal (keywords `mean` and `stdev`), BetaPert (keywords |
| 253 | `low`, `mode`, `high`, and `gamma`), , or a constant (keywords |
| 254 | `constant`). |
| 255 | |
| 256 | Parameters |
| 257 | ---------- |
| 258 | target : str |
| 259 | The name of the node for which the arguments are directed |
| 260 | kwargs : float |
| 261 | The arguments used to generate a distribution for the node |
| 262 | |
| 263 | Returns |
| 264 | ------- |
| 265 | pyfair.model.FairModel |
| 266 | A reference to this object of type FairModel |
| 267 | |
| 268 | Examples |
| 269 | -------- |
| 270 | >>> model = pyfair.model.FairModel(name='Data Loss') |
| 271 | >>> model.input_data('Loss Magnitude', mean=20, stdev=10) |
| 272 | |
| 273 | """ |
| 274 | # Standardize inputs to account for abbreviations |
| 275 | target = self._standardize_target(target) |
| 276 | # Generate data via data captive class |
| 277 | data = self._data_input.generate(target, self._n_simulations, **kwargs) |
| 278 | # Update dependency tracker captive class |
| 279 | self._tree.update_status(target, 'Supplied') |
| 280 | # Update the model table with the generated data |
| 281 | self._model_table[target] = data |
| 282 | return self |
| 283 | |
| 284 | def input_multi_data(self, target, kwargs_dict): |
| 285 | """Input data for multiple items that roll up into an aggregate |