How to use the joblib.externals.cloudpickle.dumps function in joblib

To help you get started, we’ve selected a few joblib examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jcmgray / xyzpy / xyzpy / gen / batch.py View on Github external
def save_info(self, combos=None, cases=None, fn_args=None):
        """Save information about the sowed cases.
        """
        # If saving Harvester or Runner, strip out function information so
        #   as just to use pickle.
        if self.farmer is not None:
            farmer_copy = copy.deepcopy(self.farmer)
            farmer_copy.fn = None
            farmer_pkl = cloudpickle.dumps(farmer_copy)
        else:
            farmer_pkl = None

        joblib.dump({
            'combos': combos,
            'cases': cases,
            'fn_args': fn_args,
            'batchsize': self.batchsize,
            'num_batches': self.num_batches,
            '_batch_remainder': self._batch_remainder,
            'farmer': farmer_pkl,
        }, os.path.join(self.location, INFO_NM))
github joblib / joblib / joblib / externals / loky / cloudpickle_wrapper.py View on Github external
def __reduce__(self):
        _pickled_object = dumps(self._obj)
        if not self._keep_wrapper:
            return loads, (_pickled_object,)

        return _reconstruct_wrapper, (_pickled_object, self._keep_wrapper)
github jcmgray / xyzpy / xyzpy / gen / batch.py View on Github external
def save_function_to_disk(self):
        """Save the base function to disk using cloudpickle
        """
        joblib.dump(cloudpickle.dumps(self._fn),
                    os.path.join(self.location, FNCT_NM))