예제 #1
0
    def test_error01(self):

        atoms = create(StaDumpAtoms("dumps_bead/bead.2990000.dump", 2990000))
        atoms.append_updater(FilSet({"dummy": {1, 2, 3}}))

        check_error_msg(self, "RuntimeError: Missing key(s) 'dummy' in FilSet",
                        atoms.get_data)
예제 #2
0
  def test_error02(self):

    elem = create(StaCustom({"foo": 0, "bar": 1}))
    elem.append_updater(AddRename("foo", "bar"))

    check_error_msg(
      self, "RuntimeError: Key 'bar' already exists", elem.get_data)
예제 #3
0
  def test_error03(self):

    elem = create(StaCustom({"foo": 0, "bar": 1}))
    elem.append_updater(AddRename("foo", "id"))

    check_error_msg(
      self, "RuntimeError: Adder cannot add 'id'", elem.get_data)
  def test_error03(self):

    atoms_traj = []
    base_atoms = deepcopy(self.base_data)

    for i in range(2, 12):

      atoms_tmp = []

      for j in range(1, i):

        for k, atom in enumerate(base_atoms):
          atom["id"] = (j-1) * len(base_atoms) + k + 1
          atom["mol"] = j

        atoms_tmp.extend(deepcopy(base_atoms))

      atoms_traj.append(create(StaCustom(atoms_tmp)))

    mols_traj = [create(StaMolecules(atoms)) for atoms in atoms_traj]

    pro = ProTimeCorrelationInMolecule(list(zip(mols_traj, atoms_traj)))

    check_error_msg(
      self, "RuntimeError: Number of molecules and molecular types must be unchanged", execute_omp, pro)
예제 #5
0
  def test_error01(self):

    elem = create(StaCustom({"foo": 0, "bar": 1}))
    elem.append_updater(AddRename("dummy", "new"))

    check_error_msg(
      self, "RuntimeError: Missing key(s) 'dummy' in AddRename", elem.get_data)
예제 #6
0
  def test_error02(self):

    atoms = create(StaCustom(self.custom_data))
    molecules = create(StaMolecules(atoms))
    molecules.append_updater(AddInertiaMoment(atoms))

    check_error_msg(
      self,  "RuntimeError: Missing key(s) 'xu', 'yu', 'zu' in AddInertiaMoment", molecules.get_data)
예제 #7
0
  def test_error02(self):

    atoms = create(
      StaDumpAtoms("dumps_bead/bead.2990000.dump", 2990000))
    atoms.append_updater(FilComparison([("mol", "dummy", 10)]))

    check_error_msg(
      self, "RuntimeError: Supported operators for comparison are '<', '>', '<=', '>=', '==' and '!='", atoms.get_data)
예제 #8
0
    def test_error01(self):

        elems = [create(StaCustom({"A": i, "B": i * i})) for i in range(1000)]
        pro = ProData(elems)
        pro.select("C")

        check_error_msg(self, "RuntimeError: Missing key(s) 'C' in ProData",
                        execute_omp, pro)
예제 #9
0
  def test_error01(self):

    atoms = create(
      StaDumpAtoms("dumps_bead/bead.2990000.dump", 2990000))
    atoms.append_updater(FilComparison([("dummy", "<", 0)]))

    check_error_msg(
      self, "RuntimeError: Missing key(s) 'dummy' in FilComparison", atoms.get_data)
  def test_error02(self):

    atomses = [create(StaCustom(self.base_data)) for i in range(10)]
    molses = [create(StaCustom([{"id": 1}])) for i in range(10)]

    pro = ProTimeCorrelationInMolecule(list(zip(molses, atomses)))

    check_error_msg(
      self, "RuntimeError: Missing key(s) 'atom-ids' in ProTimeCorrelationInMolecule", execute_omp, pro)
예제 #11
0
  def test_error01(self):

    elems = [
      create(StaCustom({"id": i, "A": i*i})) for i in range(1000)]

    pro = ProValueArray(elems)

    check_error_msg(
      self, "RuntimeError: Selected value(s) for ProValueArray", execute_omp, pro)
예제 #12
0
    def test_error01(self):

        atoms = create(StaCustom(self.custom_data))
        molecules = create(StaMolecules(atoms))
        molecules.append_updater(AddGyrationRadius())

        check_error_msg(
            self,
            "RuntimeError: Missing key(s) 'I_xx', 'I_yy', 'I_zz', 'mass' in AddGyrationRadius",
            molecules.get_data)
예제 #13
0
    def test_error02(self):

        box = create(StaDumpBox("dumps_bead/bead.2990000.dump", 2990000))
        atoms = create(StaCustom([{"A": i, "B": i * i} for i in range(1000)]))
        atoms.append_updater(AddWrappedPosition(box))

        check_error_msg(
            self,
            "RuntimeError: Missing key(s) 'xu', 'yu', 'zu' in AddWrappedPosition",
            atoms.get_data)
예제 #14
0
    def test_error01(self):

        atoms = create(StaDumpAtoms("dumps_bead/bead.2990000.dump", 2990000))
        molecules = create(StaMolecules(atoms))

        molecules.append_updater(AddCoMPosition(atoms))

        check_error_msg(
            self, "RuntimeError: Missing key(s) 'mass' in AddCoMPosition",
            molecules.get_data)
    def test_error01(self):

        atoms = create(StaCustom(self.custom_data))
        molecules = create(StaMolecules(atoms))
        molecules.append_updater(AddMolecularOrientation())

        check_error_msg(
            self,
            "RuntimeError: Missing key(s) 'I_xx', 'I_xy', 'I_xz', 'I_yy', 'I_yz', 'I_zz' in AddMolecularOrientation",
            molecules.get_data)
예제 #16
0
  def test_error02(self):

    elems = [
      create(StaCustom({"id": i, "A": i*i})) for i in range(1000)]

    pro = ProValueArray(elems)
    pro.select("B")

    check_error_msg(
      self, "RuntimeError: Missing key(s) 'B' in ProValueArray", execute_omp, pro)
예제 #17
0
    def test_error01(self):

        box = create(StaCustom({"foo": 0, "bar": 1}))
        atoms = create(StaDumpAtoms("dumps_bead/bead.2990000.dump", 2990000))
        atoms.append_updater(AddWrappedPosition(box))

        check_error_msg(
            self,
            "RuntimeError: Missing key(s) 'hi_x', 'hi_y', 'hi_z', 'lo_x', 'lo_y', 'lo_z' in AddWrappedPosition",
            atoms.get_data)
    def test_error02(self):

        atoms = create(StaCustom(self.base_data))
        mols = create(StaCustom([{"id": 1, "foo": "var"}]))

        pro = ProDistanceInMolecule(mols, atoms)

        check_error_msg(
            self,
            "RuntimeError: Missing key(s) 'atom-ids' in ProDistanceInMolecule",
            execute_omp, pro)
예제 #19
0
    def test_error01(self):

        atoms = create(StaDumpAtoms("dumps_atom/atom.0.dump", 0))
        moles = create(StaMolecules(atoms))

        check_error_msg(
            self,
            "RuntimeError: Mapping to Beads must be specified by 'indices-in-mol'",
            create, StaBeads(moles, [{
                "foo": [1, 2, 3]
            }]))
예제 #20
0
  def test_error01(self):

    atoms = create(StaCustom(self.custom_data))
    molecules = create(StaMolecules(atoms))
    molecules.append_updater(AddCoMPosition(atoms))

    molecules.append_updater(
      AddInertiaMoment(create(StaCustom({"foo": 0, "bar": 1}))))

    check_error_msg(
      self, "RuntimeError: Missing key(s) 'id', 'mass', 'xu', 'yu', 'zu' in AddInertiaMoment", molecules.get_data)
예제 #21
0
  def test_error03(self):

    data = [
      [{"id": j, "A": float(i*j)} for j in range(10*i+1)]
      for i in range(100)]
    elems = [create(StaCustom(d)) for d in data]
    pro = ProValueArray(elems)
    pro.select("A")

    check_error_msg(
      self, "RuntimeError: Data sizes must be the same", execute_omp, pro)
예제 #22
0
    def test_error02(self):

        atoms = create(StaDumpAtoms("dumps_atom/atom.0.dump", 0))
        moles = create(StaMolecules(atoms))

        check_error_msg(
            self,
            "RuntimeError: The numbers of elements in 'indices-in-mol' and 'weights' are inconsistent",
            create,
            StaBeads(moles, [{
                "indices-in-mol": [1, 2, 3, 4],
                "weights": [1.0, 1.0, 1.0]
            }]))
  def test_error01(self):

    dummy_data = deepcopy(self.base_data)

    for i in range(len(dummy_data)):
      del dummy_data[i]["xu"]

    atomses = [create(StaCustom(dummy_data)) for i in range(10)]
    molses = [create(StaMolecules(atoms)) for atoms in atomses]

    pro = ProTimeCorrelationInMolecule(list(zip(molses, atomses)))

    check_error_msg(
      self, "RuntimeError: Missing key(s) 'xu' in ProTimeCorrelationInMolecule", execute_omp, pro)
예제 #24
0
    def test_error02(self):

        atoms = create(
            StaCustom([{
                "id": i,
                "mol": i // 10
            } for i in range(100)]))

        moles = create(StaCustom([{"index": i} for i in range(10)]))
        moles.append_updater(AddChildIDs(atoms, "atom", "mol"))

        check_error_msg(self,
                        "RuntimeError: Missing key(s) 'id' in AddChildIDs",
                        moles.get_data)
    def test_error01(self):

        dummy_data = deepcopy(self.base_data)

        for i in range(len(dummy_data)):
            del dummy_data[i]["xu"]

        atoms = create(StaCustom(dummy_data))
        mols = create(StaMolecules(atoms))

        pro = ProDistanceInMolecule(mols, atoms)

        check_error_msg(
            self, "RuntimeError: Missing key(s) 'xu' in ProDistanceInMolecule",
            execute_omp, pro)
예제 #26
0
    def test_error03(self):

        atoms = create(StaDumpAtoms("dumps_atom/atom.0.dump", 0))
        moles = create(StaMolecules(atoms))

        check_error_msg(
            self, "RuntimeError: The number of 'type' is invalid", create,
            StaBeads(moles, [{
                "indices-in-mol": [1, 2],
                "weights": [1.0, 1.0]
            }, {
                "indices-in-mol": [3, 4],
                "type": 1,
                "weights": [1.0, 1.0]
            }]))
예제 #27
0
    def test_error01(self):

        atoms = create(
            StaCustom([{
                "id": i,
                "mol": i // 10
            } for i in range(100)]))

        moles = create(StaMolecules(atoms))
        moles.append_updater(AddChildPositions(atoms, "child"))

        check_error_msg(
            self,
            "RuntimeError: Missing key(s) 'child-ids', 'xu', 'yu', 'zu' in AddChildPositions",
            moles.get_data)
    def test_error01(self):

        dummy_data = deepcopy(self.abst_atoms)

        for i in range(len(dummy_data)):
            del dummy_data[i]["mass"]

        atoms = create(StaCustom(dummy_data))

        pro = ProMeanSquareDisplacement([atoms])

        check_error_msg(
            self,
            "RuntimeError: Missing key(s) 'mass' in ProMeanSquareDisplacement",
            execute_omp, pro)
예제 #29
0
    def test_error01(self):

        atoms = create(
            StaCustom([{
                "x": 1.0 * i,
                "y": 1.0 * i,
                "z": 1.0 * i
            } for i in range(100)]))
        box = create(StaCustom({"foo": 0.0, "bar": 1.0}))

        pro = ProThicknessProfile(atoms, box)

        check_error_msg(
            self,
            "RuntimeError: Missing key(s) 'radius' in ProThicknessProfile",
            execute_omp, pro)
    def test_error01(self):

        atoms = create(
            StaCustom([{
                "x": 1.0 * i,
                "y": 1.0 * i,
                "z": 1.0 * i
            } for i in range(100)]))
        box = create(StaCustom({"foo": 0.0, "bar": 1.0}))

        pro = ProRDFWD(atoms, box)

        check_error_msg(
            self,
            "RuntimeError: Missing key(s) 'I_xx', 'I_xy', 'I_xz', 'I_yy', 'I_yz', 'I_zz', 'id', 'mass' in ProRadialDistributionFunctionWithDeformation",
            execute_omp, pro)