Skip to content

Commit 76617fb

Browse files
authored
patch up v1, vdev testing (#73)
* patch up v1, vdev testing * Update versions.py * Update versions.py * Update setup.py
1 parent 6ef6abd commit 76617fb

11 files changed

+42
-20
lines changed

qcschema/versions.py

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,16 @@
33
from the development branch
44
"""
55

6+
import json
67
import os
8+
try:
9+
from pathlib import Path
10+
except ImportError:
11+
from pathlib2 import Path
712

813
from . import dev
914

10-
_data_path = os.path.dirname(__file__)
15+
_data_path = Path(__file__).resolve().parent / "data"
1116

1217
_input_version_list = ["dev", 1]
1318
_output_version_list = ["dev", 1]
@@ -28,9 +33,8 @@ def _load_schema(schema_type, version):
2833
else:
2934
raise KeyError("Schema type %s not understood." % schema_type)
3035

31-
fpath = os.path.join(_data_path, "v" + str(version), fname)
32-
with open(fpath, "r") as handle:
33-
ret = json.loads(handle)
36+
fpath = _data_path / ("v" + str(version)) / fname
37+
ret = json.loads(fpath.read_text())
3438

3539
return ret
3640

setup.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,11 +6,12 @@
66
version="1",
77
description='A schema for quantum chemistry',
88
author='',
9-
url="https://github.com/MolSSI/QC_JSON_Schema",
9+
url="https://github.com/MolSSI/QCSchema",
1010
license='',
1111
packages=setuptools.find_packages(),
1212
install_requires=[
1313
'jsonschema',
14+
'pathlib2; python_version < "3.5"', # redundant with jsonschema
1415
],
1516
extras_require={
1617
'docs': [

tests/basis/waterZr_energy_B3LYP_STO3G_DEF2_input.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"schema_name": "qc_schema_input",
3-
"schema_version": 1,
3+
"schema_version": 2,
44
"molecule": {
55
"schema_name": "qcschema_molecule",
66
"schema_version": 2,

tests/basis/water_energy_B3LYP_631G_input.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"schema_name": "qc_schema_input",
3-
"schema_version": 1,
3+
"schema_version": 2,
44
"molecule": {
55
"schema_name": "qcschema_molecule",
66
"schema_version": 2,

tests/simple/water_energy_CCSD_PRT_PR_input.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"schema_name": "qcschema_input",
2+
"schema_name": "qc_schema_input",
33
"schema_version": 1,
44
"molecule": {
55
"schema_name": "qcschema_molecule",

tests/simple/water_energy_CCSD_PRT_PR_output.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"schema_name": "qcschema_output",
3-
"schema_version": 1,
2+
"schema_name": "qc_schema_output",
3+
"schema_version": 2,
44
"molecule": {
55
"schema_name": "qcschema_molecule",
66
"schema_version": 2,

tests/simple/water_energy_CCSD_input.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"schema_name": "qcschema_input",
2+
"schema_name": "qc_schema_input",
33
"schema_version": 1,
44
"molecule": {
55
"schema_name": "qcschema_molecule",

tests/simple/water_energy_CCSD_output.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"schema_name": "qcschema_output",
3-
"schema_version": 1,
2+
"schema_name": "qc_schema_output",
3+
"schema_version": 2,
44
"molecule": {
55
"schema_name": "qcschema_molecule",
66
"schema_version": 2,

tests/simple/water_energy_MP2_input.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"schema_name": "qcschema_input",
2+
"schema_name": "qc_schema_input",
33
"schema_version": 1,
44
"molecule": {
55
"schema_name": "qcschema_molecule",

tests/simple/water_energy_MP2_output.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
2-
"schema_name": "qcschema_output",
3-
"schema_version": 1,
2+
"schema_name": "qc_schema_output",
3+
"schema_version": 2,
44
"molecule": {
55
"schema_name": "qcschema_molecule",
66
"schema_version": 2,

0 commit comments

Comments
 (0)