Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Make torsiondrive python 3.12 compatible #78

Merged
merged 1 commit into from
Apr 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions torsiondrive/data/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# Path to this data directory
import os
data_dir = os.path.dirname(os.path.abspath(__file__))
4 changes: 2 additions & 2 deletions torsiondrive/tests/test_qm_engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@
import os
import subprocess
import pytest
from pkg_resources import resource_filename
import shutil
import numpy as np

from torsiondrive.data import data_dir
from torsiondrive.launch import create_engine
from torsiondrive.qm_engine import QMEngine, EngineBlank, EnginePsi4, EngineQChem, EngineTerachem, EngineOpenMM, EngineGaussian, EnginexTB
from geometric.molecule import Molecule
Expand All @@ -18,7 +18,7 @@ def get_data(relative_path):
"""
Get the file path to some data in the torsiondrive package.
"""
fn = resource_filename("torsiondrive", os.path.join("data", relative_path))
fn = os.path.join(data_dir, relative_path)

if not os.path.exists(fn):
raise ValueError("The file %s can not be found. If you just added it re-install the package."%relative_path)
Expand Down
4 changes: 2 additions & 2 deletions versioneer.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,9 +339,9 @@ def get_config_from_root(root):
# configparser.NoOptionError (if it lacks "VCS="). See the docstring at
# the top of versioneer.py for instructions on writing your setup.cfg .
setup_cfg = os.path.join(root, "setup.cfg")
parser = configparser.SafeConfigParser()
parser = configparser.ConfigParser()
with open(setup_cfg, "r") as f:
parser.readfp(f)
parser.read_file(f)
VCS = parser.get("versioneer", "VCS") # mandatory

def get(parser, name):
Expand Down