Beispiel #1
0
    def get_version(self) -> str:
        # excuse missing Q-Chem for QCEngineRecords tests
        found = self.found()
        if not found:
            return safe_version("0.0.0")

        self.found(raise_error=True)

        # Get the node configuration
        config = get_config()

        which_prog = which("qchem")
        if which_prog not in self.version_cache:
            success, exc = execute(
                [which_prog, "v.in"],
                {"v.in": "$rem\n"},
                scratch_directory=config.scratch_directory,
                environment=self._get_qc_path(),
                timeout=15,
            )

            mobj = re.search(r"Q-Chem\s+([\d.]+)\s+for", exc["stdout"])
            if not mobj:
                mobj = re.search(r"Q-Chem version:\s+([\d.]+)\s+",
                                 exc["stdout"])

            if mobj:
                self.version_cache[which_prog] = safe_version(mobj.group(1))

            # if "QC not defined" in exc["stdout"]:
            else:
                return safe_version("0.0.0")

        return self.version_cache[which_prog]
Beispiel #2
0
    def get_version(self) -> str:
        self.found(raise_error=True)

        which_prog = which("qchem")
        if which_prog not in self.version_cache:
            with popen([which_prog, "-h"], popen_kwargs={"env": self._get_qc_path()}) as exc:
                exc["proc"].wait(timeout=15)

            if "QC not defined" in exc["stdout"]:
                return safe_version("0.0.0")

            self.version_cache[which_prog] = safe_version(exc["stdout"].splitlines()[0].split()[-1])

        return self.version_cache[which_prog]
Beispiel #3
0
    def get_version(self) -> str:
        self.found(raise_error=True)

        # Get the node configuration
        config = get_config()

        # Run MADNESS
        which_prog = which("moldft")

        if config.use_mpiexec:
            command = create_mpi_invocation(which_prog, config)
        else:
            command = [which_prog]
        command.append("v.moldft")

        if which_prog not in self.version_cache:
            success, output = execute(
                command,
                {
                    "v.moldft":
                    "dft\nxc lda\nend\ngeometry\nBe  0.0    0.0 0.0\n\nend\n"
                },
                scratch_directory=config.scratch_directory,
            )

            if success:
                for line in output["stdout"].splitlines():
                    if "multiresolution suite" in line:
                        version = line.strip().split()[1]
                self.version_cache[which_prog] = safe_version(version)
            else:
                raise UnknownError(output["stderr"])

        return self.version_cache[which_prog]
Beispiel #4
0
    def get_version(self) -> str:
        self.found(raise_error=True)

        which_prog = which_import('torchani')
        if which_prog not in self.version_cache:
            import torchani
            self.version_cache[which_prog] = safe_version(torchani.__version__)

        return self.version_cache[which_prog]
Beispiel #5
0
    def get_version(self) -> str:
        self.found(raise_error=True)

        # Note: anything below v3.2.1 will return the help menu here. but that's fine as version compare evals to False.
        command = [which('dftd3'), '-version']
        import subprocess
        proc = subprocess.run(command, stdout=subprocess.PIPE)
        candidate_version = proc.stdout.decode('utf-8').strip()

        return safe_version(candidate_version)
Beispiel #6
0
    def get_version(self) -> str:
        """Return the currently used version of adcc"""
        self.found(raise_error=True)

        which_prog = which_import("adcc")
        if which_prog not in self.version_cache:
            import adcc

            self.version_cache[which_prog] = safe_version(adcc.__version__)
        return self.version_cache[which_prog]
Beispiel #7
0
    def get_version(self) -> str:
        self.found(raise_error=True)

        which_prog = which('terachem')
        if which_prog not in self.version_cache:
            with popen([which_prog, '--version']) as exc:
                exc["proc"].wait(timeout=5)
            self.version_cache[which_prog] = safe_version(exc["stdout"].split()[2].strip('K'))

        return self.version_cache[which_prog]
Beispiel #8
0
    def get_version(self) -> str:
        self.found(raise_error=True)

        which_prog = which("entos")
        if which_prog not in self.version_cache:
            with popen([which_prog, "--version"]) as exc:
                exc["proc"].wait(timeout=15)
            self.version_cache[which_prog] = safe_version(
                exc["stdout"].split()[2])

        return self.version_cache[which_prog]
Beispiel #9
0
    def get_version(self) -> str:
        """Return the currently used version of RDKit."""
        self.found(raise_error=True)

        which_prog = which_import("rdkit")
        if which_prog not in self.version_cache:
            import rdkit

            self.version_cache[which_prog] = safe_version(rdkit.__version__)

        return self.version_cache[which_prog]
Beispiel #10
0
    def get_version(self) -> str:
        self.found(raise_error=True)

        which_prog = which('mp2d')
        if which_prog not in self.version_cache:
            #command = [which_prog, '-version']
            #import subprocess
            #proc = subprocess.run(command, stdout=subprocess.PIPE)
            #self.version_cache[which_prog] = safe_version(proc.stdout.decode('utf-8').strip())
            self.version_cache[which_prog] = safe_version('0.1')

        return self.version_cache[which_prog]
Beispiel #11
0
    def get_version(self) -> str:
        self.found(raise_error=True)

        which_prog = which("mctc-gcp")
        if which_prog not in self.version_cache:
            command = [which_prog, "--version"]
            import subprocess

            proc = subprocess.run(command, stdout=subprocess.PIPE)
            self.version_cache[which_prog] = safe_version(proc.stdout.decode("utf-8").strip().split()[-1])

        return self.version_cache[which_prog]
Beispiel #12
0
    def get_version(self) -> str:
        self.found(raise_error=True)

        which_prog = which('nwchem')
        if which_prog not in self.version_cache:
            success, output = execute([which_prog, "v.nw"], {"v.nw": ""})

            if success:
                for line in output["stdout"].splitlines():
                    if 'nwchem branch' in line:
                        branch = line.strip().split()[-1]
                    if 'nwchem revision' in line:
                        revision = line.strip().split()[-1]
                self.version_cache[which_prog] = safe_version(branch + '+' + revision)

        return self.version_cache[which_prog]
Beispiel #13
0
    def get_version(self) -> str:
        """Return the currently used version of OpenMM."""
        self.found(raise_error=True)

        # we have to do some gymnastics for OpenMM pre-7.6 import support
        # we know it exists due to succesful `found` above
        which_prog = which_import("openmm")
        if which_prog is None:
            which_prog = which_import(".openmm", package="simtk")

        if which_prog not in self.version_cache:
            try:
                import openmm
            except ImportError:
                from simtk import openmm

            self.version_cache[which_prog] = safe_version(
                openmm.version.short_version)

        return self.version_cache[which_prog]