From 3b4be621b606fb82dfb9ca5bf4cd3e63ea8f85df Mon Sep 17 00:00:00 2001 From: David Hendriks <davidhendriks93@gmail.com> Date: Fri, 25 Nov 2022 10:39:15 +0000 Subject: [PATCH] testing things with the MC sampling --- .../monte_carlo_sampling.py | 17 ++++++++++------- 1 file changed, 10 insertions(+), 7 deletions(-) diff --git a/binarycpython/utils/population_extensions/monte_carlo_sampling.py b/binarycpython/utils/population_extensions/monte_carlo_sampling.py index c9b4ab10e..548db7a10 100644 --- a/binarycpython/utils/population_extensions/monte_carlo_sampling.py +++ b/binarycpython/utils/population_extensions/monte_carlo_sampling.py @@ -1,10 +1,5 @@ """ Main script to provide the Monte-Carlo sampling class extensions - -TODO: some of the parameters that we use to sample require previous parameters. We need to set up a method to include making CDFs for those: -TODO: rename the GridVariable to SamplingVariable -TODO: add a property of 'parameter_dependence' which holds a list of other parameters that the current samplingVariable needs to calculate their cdf from -TODO: build CDFS in a nested dict fashing where the parameter the current parameter depends on are stored in some binned way s.t. we can can access the CDFs """ import datetime @@ -1088,11 +1083,19 @@ class monte_carlo_sampling: Function to get the generator for the source_file sampling method. Called by _get_generator and used in the actual evolution loop. """ - # Write monte_carlo generator - self._monte_carlo_sampling_write_generator() + # Write the sampling functions file + self._monte_carlo_sampling_write_sampling_functions_file() + + # Load the sampling functions + self._monte_carlo_sampling_load_sampling_functions_file() + + # Write generator file + self._monte_carlo_sampling_write_generator_file() # Load generator self._monte_carlo_sampling_load_generator() + + # Get generator file generator = self.grid_options["_monte_carlo_sampling_generator"]( self, print_results=False ) -- GitLab