Beispiel #1
0
    def __save_frames__(self):
        size = len(self.pp_specs_managers)
        if size > 0:
            #create output movie dir if it is not present
            create_dir(self.pp_specs_managers[0].movie_dir)

            if self.p.movie_multiprocessing_factor > 0:
                for specs_managers in get_chunks(self.pp_specs_managers,
                                                 self.core_nums):
                    pool = multiprocessing.Pool(
                        processes=self.core_nums
                        #,maxtasksperchild=self.p.movie_multiprocessing_factor
                    )
                    if not self.params.info_message_handler == None:
                        self.params.info_message_handler('Generating frames' +
                                                         (' ' * 20))
                    pool.map(
                        self.__poincare_plot_function__,
                        specs_managers,
                        #self.pp_specs_managers,
                        #chunksize=self.p.movie_multiprocessing_factor
                        #chunksize=20
                    )
                    pool.close()
                    gc.collect()
            else:
                _function = self.__poincare_plot_function__
                for pp_spec_manager in self.pp_specs_managers:
                    _function(pp_spec_manager)
    def __save_frames__(self):
        size = len(self.pp_specs_managers)
        if size > 0:
            #create output movie dir if it is not present
            create_dir(self.pp_specs_managers[0].movie_dir)

            if self.p.movie_multiprocessing_factor > 0:
                for specs_managers in get_chunks(self.pp_specs_managers,
                                                 self.core_nums):
                    pool = multiprocessing.Pool(processes=self.core_nums
                        #,maxtasksperchild=self.p.movie_multiprocessing_factor
                        )
                    if not self.params.info_message_handler == None:
                        self.params.info_message_handler('Generating frames'
                                                     + (' ' * 20))
                    pool.map(self.__poincare_plot_function__,
                             specs_managers,
                             #self.pp_specs_managers,
                             #chunksize=self.p.movie_multiprocessing_factor
                             #chunksize=20
                             )
                    pool.close()
                    gc.collect()
            else:
                _function = self.__poincare_plot_function__
                for pp_spec_manager in self.pp_specs_managers:
                    _function(pp_spec_manager)
Beispiel #3
0
 def __save_members__(self):
     """
     [optional]
     save members values
     """
     if self.save_parameters:
         _filename = as_path(self.output_dir, "pp_parameters.txt")
         create_dir(self.output_dir)
         with open(_filename, 'w') as _file:
             for info_line in self.__p__.get_infos_lines(valued_only=True):
                 _file.write(info_line + "\n")
             print('Poincare plot parameters saved into a file: %s ' %
                   (_filename))
Beispiel #4
0
 def __save_members__(self):
     """
     [optional]
     save members values
     """
     if self.save_parameters:
         _filename = as_path(self.output_dir, "pp_parameters.txt")
         create_dir(self.output_dir)
         with open(_filename, 'w') as _file:
             for info_line in self.__p__.get_infos_lines(valued_only=True):
                 _file.write(info_line + "\n")
             print('Poincare plot parameters saved into a file: %s '
                   % (_filename))