From 6f06adbc567b092e2fdada808512e9527246b5e2 Mon Sep 17 00:00:00 2001 From: Anyang Peng <137014849+anyangml@users.noreply.github.com> Date: Wed, 8 May 2024 00:35:44 +0800 Subject: [PATCH] Fix: ZBL test path (#3757) ## Summary by CodeRabbit - **Tests** - Updated the path configuration for the `use_srtab` key in test settings to enhance reliability by changing from a relative path to an absolute path. - Imported `os` module and defined `CUR_DIR` as the directory of the current file. --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com> --- source/tests/pt/model/test_permutation.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source/tests/pt/model/test_permutation.py b/source/tests/pt/model/test_permutation.py index 110abd0d23..b4cd133200 100644 --- a/source/tests/pt/model/test_permutation.py +++ b/source/tests/pt/model/test_permutation.py @@ -1,5 +1,6 @@ # SPDX-License-Identifier: LGPL-3.0-or-later import copy +import os import unittest import torch @@ -14,6 +15,8 @@ env, ) +CUR_DIR = os.path.dirname(__file__) + dtype = torch.float64 model_se_e2_a = { @@ -60,7 +63,7 @@ model_zbl = { "type_map": ["O", "H", "B"], - "use_srtab": "source/tests/pt/model/water/data/zbl_tab_potential/H2O_tab_potential.txt", + "use_srtab": f"{CUR_DIR}/water/data/zbl_tab_potential/H2O_tab_potential.txt", "smin_alpha": 0.1, "sw_rmin": 0.2, "sw_rmax": 1.0,