Unverified Commit 60098401 authored by markuskowa's avatar markuskowa Committed by GitHub
Browse files

Merge pull request #200680 from robertodr/update-geometric

python3Packages.geometric: 0.9.7.2 -> 1.0
parents 69f8e94c defcd6b6
Loading
Loading
Loading
Loading
+50 −0
Original line number Diff line number Diff line
From aff6e4411980ac9cbe112a050c3a34ba7e305a43 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Roberto=20Di=20Remigio=20Eik=C3=A5s?=
 <robertodr@users.noreply.github.com>
Date: Fri, 11 Nov 2022 09:20:25 +0100
Subject: [PATCH] Do not import ASE stuff at the top

Since it is an optional add-on and it's not listed in the installation requirements.
---
 geometric/tests/test_ase_engine.py | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/geometric/tests/test_ase_engine.py b/geometric/tests/test_ase_engine.py
index 8750763..34239b5 100644
--- a/geometric/tests/test_ase_engine.py
+++ b/geometric/tests/test_ase_engine.py
@@ -10,7 +10,6 @@
 - geometry optimisation w/ ASE internal calc
 """
 import numpy as np
-from ase.calculators.lj import LennardJones
 from pytest import fixture, raises
 
 from geometric.ase_engine import EngineASE
@@ -37,6 +36,8 @@ def molecule_h2o() -> Molecule:
 
 @using_ase
 def test_construction(molecule_h2o):
+    from ase.calculators.lj import LennardJones
+
     lj_calc = LennardJones()
     engine = EngineASE(molecule_h2o, lj_calc)
     assert engine.calculator == lj_calc
@@ -44,6 +45,8 @@ def test_construction(molecule_h2o):
 
 @using_ase
 def test_from_args(molecule_h2o):
+    from ase.calculators.lj import LennardJones
+
     lj_calc = LennardJones(sigma=1.4, epsilon=3.0)
 
     # create equivalent engines in two ways
@@ -68,6 +71,8 @@ def test_from_args(molecule_h2o):
 
 @using_ase
 def test_from_string(molecule_h2o):
+    from ase.calculators.lj import LennardJones
+
     engine = EngineASE.from_calculator_string(
         molecule_h2o, calculator_import="ase.calculators.lj.LennardJones"
     )
+17 −4
Original line number Diff line number Diff line
{ buildPythonPackage, lib, fetchFromGitHub
, networkx, numpy, scipy, six
{ buildPythonPackage
, lib
, fetchFromGitHub
, networkx
, numpy
, scipy
, six
, pytestCheckHook
}:

buildPythonPackage rec {
  pname = "geometric";
  version = "0.9.7.2";
  version = "1.0";

  src = fetchFromGitHub {
    owner = "leeping";
    repo = "geomeTRIC";
    rev = version;
    hash = "sha256-QFpfY6tWqcda6AJT17YBEuwu/4DYPbIMJU1c9/gHjaA=";
    hash = "sha256-y8dh4vZ/d1KL1EpDrle8CH/KIDMCKKZdAyJVgUFjx/o=";
  };

  patches = [
    ./ase-is-optional.patch
  ];

  propagatedBuildInputs = [
    networkx
    numpy
@@ -21,6 +30,10 @@ buildPythonPackage rec {
    six
  ];

  preCheck = ''
    export OMP_NUM_THREADS=2
  '';

  checkInputs = [ pytestCheckHook ];

  meta = with lib; {