f8ef181f3f348d03fd4d07b376befdd93e213998,pyntcloud/core_class.py,PyntCloud,from_pyvista,#,664

Before Change


                points["red"] = array[:,0]
                points["green"] = array[:,1]
                points["blue"] = array[:,2]
            elif array.ndim < 2:
                points[name] = array
            else:
                // Multicomponent arrays aren"t supported by PyntCloud?

After Change


        for name, array in scalars.items():
            if array.ndim == 1:
                points[name] = array
            elif array.ndim == 2:
                if name in "RGB":
                    points["red"] = array[:, 0]
                    points["green"] = array[:, 1]
                    points["blue"] = array[:, 2]
                elif name == "Normals":
                    points["nx"] = array[:, 0]
                    points["ny"] = array[:, 1]
                    points["nz"] = array[:, 2]
                else:
                    for n in range(array.shape[1]):
                        points["{}_{}".format(name, n)] = array[:, n]
            else:
                warnings.warn("Ignoring scalar field {} with ndim > 2 ({})".format(name, array.ndim))

        return cls(points, mesh=mesh)

    def plot(
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 7

Instances


Project Name: daavoo/pyntcloud
Commit Name: f8ef181f3f348d03fd4d07b376befdd93e213998
Time: 2019-06-18
Author: diglesia@gradiant.org
File Name: pyntcloud/core_class.py
Class Name: PyntCloud
Method Name: from_pyvista


Project Name: librosa/librosa
Commit Name: b2e82574eb7e7292741ece09ec9eb286e9ea4168
Time: 2020-05-22
Author: bmcfee@users.noreply.github.com
File Name: librosa/util/utils.py
Class Name:
Method Name: frame


Project Name: KrishnaswamyLab/PHATE
Commit Name: f999473a09e13023ff458ce9273e4455480d6963
Time: 2018-05-30
Author: scottgigante@gmail.com
File Name: Python/phate/phate.py
Class Name: PHATE
Method Name: __init__