How to use the qcfractal.interface.hash_helpers.float_prep function in qcfractal

To help you get started, we’ve selected a few qcfractal 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 MolSSI / QCFractal / qcfractal / interface / molecule.py View on Github external
if field == "fix_com":
                data = self._fix_com
            elif field == "fix_orientation":
                data = self._fix_orientation
            else:
                data = getattr(self, field)

            # Do we add this data?
            if isinstance(data, (np.ndarray, list, tuple, dict, str)) and (len(data) == 0): continue

            # If we added masses for orientation, continue
            if (field == "masses") and (self._custom_masses is False):
                continue

            if field == "geometry":
                ret[field] = hash_helpers.float_prep(data, GEOMETRY_NOISE).ravel().tolist()
            elif field == "fragment_charges":
                ret[field] = hash_helpers.float_prep(data, CHARGE_NOISE).tolist()
            elif field == "charge":
                ret[field] = hash_helpers.float_prep(data, CHARGE_NOISE)
            elif field == "masses":
                ret[field] = hash_helpers.float_prep(data, MASS_NOISE).tolist()
            else:
                ret[field] = data

        self.validate(data=ret)
        return ret
github MolSSI / QCFractal / qcfractal / interface / molecule.py View on Github external
if field == "fix_com":
                data = self._fix_com
            elif field == "fix_orientation":
                data = self._fix_orientation
            else:
                data = getattr(self, field)

            # Do we add this data?
            if isinstance(data, (np.ndarray, list, tuple, dict, str)) and (len(data) == 0): continue

            # If we added masses for orientation, continue
            if (field == "masses") and (self._custom_masses is False):
                continue

            if field == "geometry":
                ret[field] = hash_helpers.float_prep(data, GEOMETRY_NOISE).ravel().tolist()
            elif field == "fragment_charges":
                ret[field] = hash_helpers.float_prep(data, CHARGE_NOISE).tolist()
            elif field == "charge":
                ret[field] = hash_helpers.float_prep(data, CHARGE_NOISE)
            elif field == "masses":
                ret[field] = hash_helpers.float_prep(data, MASS_NOISE).tolist()
            else:
                ret[field] = data

        self.validate(data=ret)
        return ret
github MolSSI / QCFractal / qcfractal / interface / molecule.py View on Github external
else:
                data = getattr(self, field)

            # Do we add this data?
            if isinstance(data, (np.ndarray, list, tuple, dict, str)) and (len(data) == 0): continue

            # If we added masses for orientation, continue
            if (field == "masses") and (self._custom_masses is False):
                continue

            if field == "geometry":
                ret[field] = hash_helpers.float_prep(data, GEOMETRY_NOISE).ravel().tolist()
            elif field == "fragment_charges":
                ret[field] = hash_helpers.float_prep(data, CHARGE_NOISE).tolist()
            elif field == "charge":
                ret[field] = hash_helpers.float_prep(data, CHARGE_NOISE)
            elif field == "masses":
                ret[field] = hash_helpers.float_prep(data, MASS_NOISE).tolist()
            else:
                ret[field] = data

        self.validate(data=ret)
        return ret
github MolSSI / QCFractal / qcfractal / interface / molecule.py View on Github external
# Do we add this data?
            if isinstance(data, (np.ndarray, list, tuple, dict, str)) and (len(data) == 0): continue

            # If we added masses for orientation, continue
            if (field == "masses") and (self._custom_masses is False):
                continue

            if field == "geometry":
                ret[field] = hash_helpers.float_prep(data, GEOMETRY_NOISE).ravel().tolist()
            elif field == "fragment_charges":
                ret[field] = hash_helpers.float_prep(data, CHARGE_NOISE).tolist()
            elif field == "charge":
                ret[field] = hash_helpers.float_prep(data, CHARGE_NOISE)
            elif field == "masses":
                ret[field] = hash_helpers.float_prep(data, MASS_NOISE).tolist()
            else:
                ret[field] = data

        self.validate(data=ret)
        return ret
github MolSSI / QCFractal / qcfractal / interface / molecule.py View on Github external
# Do we add this data?
            if isinstance(data, (np.ndarray, list, tuple, dict, str)) and (len(data) == 0): continue

            # If we added masses for orientation, continue
            if (field == "masses") and (self._custom_masses is False):
                continue

            if field == "geometry":
                ret[field] = hash_helpers.float_prep(data, GEOMETRY_NOISE).ravel().tolist()
            elif field == "fragment_charges":
                ret[field] = hash_helpers.float_prep(data, CHARGE_NOISE).tolist()
            elif field == "charge":
                ret[field] = hash_helpers.float_prep(data, CHARGE_NOISE)
            elif field == "masses":
                ret[field] = hash_helpers.float_prep(data, MASS_NOISE).tolist()
            else:
                ret[field] = data

        self.validate(data=ret)
        return ret
github MolSSI / QCFractal / qcfractal / interface / molecule.py View on Github external
elif field == "fix_orientation":
                data = self._fix_orientation
            else:
                data = getattr(self, field)

            # Do we add this data?
            if isinstance(data, (np.ndarray, list, tuple, dict, str)) and (len(data) == 0): continue

            # If we added masses for orientation, continue
            if (field == "masses") and (self._custom_masses is False):
                continue

            if field == "geometry":
                ret[field] = hash_helpers.float_prep(data, GEOMETRY_NOISE).ravel().tolist()
            elif field == "fragment_charges":
                ret[field] = hash_helpers.float_prep(data, CHARGE_NOISE).tolist()
            elif field == "charge":
                ret[field] = hash_helpers.float_prep(data, CHARGE_NOISE)
            elif field == "masses":
                ret[field] = hash_helpers.float_prep(data, MASS_NOISE).tolist()
            else:
                ret[field] = data

        self.validate(data=ret)
        return ret
github MolSSI / QCFractal / qcfractal / interface / molecule.py View on Github external
elif field == "fix_orientation":
                data = self._fix_orientation
            else:
                data = getattr(self, field)

            # Do we add this data?
            if isinstance(data, (np.ndarray, list, tuple, dict, str)) and (len(data) == 0): continue

            # If we added masses for orientation, continue
            if (field == "masses") and (self._custom_masses is False):
                continue

            if field == "geometry":
                ret[field] = hash_helpers.float_prep(data, GEOMETRY_NOISE).ravel().tolist()
            elif field == "fragment_charges":
                ret[field] = hash_helpers.float_prep(data, CHARGE_NOISE).tolist()
            elif field == "charge":
                ret[field] = hash_helpers.float_prep(data, CHARGE_NOISE)
            elif field == "masses":
                ret[field] = hash_helpers.float_prep(data, MASS_NOISE).tolist()
            else:
                ret[field] = data

        self.validate(data=ret)
        return ret