e547a82c24b37c157bc9b40d2724a7b1fd0a7b0f,cesium/featurize.py,,save_featureset,#,346

Before Change


    
    features, channels = zip(*fset.columns)
    for v in [fset.values, features, channels] + list(kwargs.values()):
        if np.array(v).dtype == np.object:
            raise ValueError("Cannot save objects in .npz format.")
    np.savez(path, values=fset.values, index=fset.index.values.astype(str),
             features=features, channels=channels, **kwargs)

After Change


            arr = v.to_records()
            dt_list = arr.dtype.descr
            // Change type of indices from object to str
            for i, (name, dt) in enumerate(dt_list):
                if dt.endswith("O"):
                    size = max(len(x) for x in arr["index"])
                    dt_list[i] = (name, "U" + str(size))
            kwargs[k] = arr.astype(dt_list)

    // Bypass savez to allow for `allow_pickle` keyword
    // See https://github.com/numpy/numpy/pull/5770
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 4

Instances


Project Name: cesium-ml/cesium
Commit Name: e547a82c24b37c157bc9b40d2724a7b1fd0a7b0f
Time: 2017-04-17
Author: brettnaul@gmail.com
File Name: cesium/featurize.py
Class Name:
Method Name: save_featureset


Project Name: oddt/oddt
Commit Name: aa5d761c03ea31df01ff51ec3634dd89cd73bec1
Time: 2018-05-17
Author: maciek@wojcikowski.pl
File Name: oddt/toolkits/extras/rdkit_fixer.py
Class Name:
Method Name: UFFConstrainedOptimize


Project Name: pgmpy/pgmpy
Commit Name: b384268df66742de0bc92a13db162b8409dda730
Time: 2019-04-19
Author: ankurankan@gmail.com
File Name: pgmpy/readwrite/BIF.py
Class Name: BIFReader
Method Name: get_values