Skip to content

Commit

Permalink
Merge pull request #694 from jthorton/qcelemental_fix
Browse files Browse the repository at this point in the history
QCElemental 0.23.0 update
  • Loading branch information
bennybp committed Nov 5, 2021
2 parents 867b1bc + d0567b7 commit f0066ff
Show file tree
Hide file tree
Showing 9 changed files with 41 additions and 27 deletions.
8 changes: 7 additions & 1 deletion .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,18 @@ jobs:
ulimit -a
- name: Configure conda
uses: conda-incubator/setup-miniconda@v2
uses: conda-incubator/setup-miniconda@v2.1.1
with:
python-version: ${{ matrix.python-version }}
activate-environment: qcarchive
environment-file: devtools/conda-envs/${{ matrix.environ }}.yaml
auto-activate-base: false
auto-update-conda: true
show-channel-urls: true
mamba-version: "*"
miniforge-version: latest
miniforge-variant: Mambaforge
use-mamba: true

- name: Environment Information
shell: bash -l {0}
Expand Down
6 changes: 3 additions & 3 deletions devtools/conda-envs/adapter_dask.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ dependencies:
- cryptography

# Storage dependencies
- alembic
- conda-forge::alembic
- psycopg2 >=2.7
- postgresql
- sqlalchemy >=1.3,<1.4
Expand All @@ -44,5 +44,5 @@ dependencies:
- dask-jobqueue >=0.5.0

# QCArchive includes
- qcengine >=0.17.0,<0.20
- qcelemental >=0.17.0,<0.23
- qcengine >=0.20,<0.21
- qcelemental >=0.23,<0.24
6 changes: 3 additions & 3 deletions devtools/conda-envs/adapter_fireworks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ dependencies:
- cryptography

# Storage dependencies
- alembic
- conda-forge::alembic
- psycopg2 >=2.7
- postgresql
- sqlalchemy >=1.3,<1.4
Expand All @@ -38,8 +38,8 @@ dependencies:
- requests-mock

# QCArchive includes
- qcengine >=0.17.0,<0.20
- qcelemental >=0.17.0,<0.23
- qcengine >=0.20,<0.21
- qcelemental >=0.23,<0.24

# Pip includes
- pip:
Expand Down
6 changes: 3 additions & 3 deletions devtools/conda-envs/adapter_parsl.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ dependencies:
- cryptography

# Storage dependencies
- alembic
- conda-forge::alembic
- psycopg2 >=2.7
- postgresql
- sqlalchemy >=1.3,<1.4
Expand All @@ -44,5 +44,5 @@ dependencies:
- parsl ==1.0.0

# QCArchive includes
- qcengine >=0.17.0,<0.20
- qcelemental >=0.17.0,<0.23
- qcengine >=0.20,<0.21
- qcelemental >=0.23,<0.24
6 changes: 3 additions & 3 deletions devtools/conda-envs/base.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ dependencies:
- cryptography

# Storage dependencies
- alembic
- conda-forge::alembic
- psycopg2 >=2.7
- postgresql
- sqlalchemy >=1.3,<1.4
Expand All @@ -38,5 +38,5 @@ dependencies:
- requests-mock

# QCArchive includes
- qcengine >=0.17.0,<0.20
- qcelemental >=0.17.0,<0.23
- qcengine >=0.20,<0.21
- qcelemental >=0.23,<0.24
2 changes: 1 addition & 1 deletion devtools/conda-envs/dev_head.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ dependencies:
- cryptography

# Storage dependencies
- alembic
- conda-forge::alembic
- psycopg2 >=2.7
- postgresql
- sqlalchemy >=1.3,<1.4
Expand Down
17 changes: 8 additions & 9 deletions devtools/conda-envs/openff.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: qcarchive
channels:
- defaults
- omnia
- psi4/label/dev
- conda-forge
dependencies:
Expand All @@ -20,7 +19,7 @@ dependencies:
- cryptography

# Storage dependencies
- alembic
- conda-forge::alembic
- psycopg2 >=2.7
- postgresql
- sqlalchemy >=1.3,<1.4
Expand All @@ -40,17 +39,17 @@ dependencies:
- requests-mock

# Environment specific includes
- psi4>1.4a2.dev700,<1.4a2
- gau2grid=2.0.3
- psi4
- gau2grid
- rdkit
- geometric >=0.9.3
- torsiondrive
- dftd3
- openforcefield >=0.7.1
- openforcefields >=1.2.0
- openmm >=7.4.2
- openff-toolkit >=0.10.0
- openff-forcefields >=2.0.0
- openmm >=7.6.0
- openmmforcefields >=0.8.0

# QCArchive includes
- qcengine >=0.17.0,<0.20
- qcelemental >=0.17.0,<0.23
- qcengine >=0.20,<0.21
- qcelemental >=0.23,<0.24
13 changes: 11 additions & 2 deletions qcfractal/storage_sockets/sqlalchemy_socket.py
Original file line number Diff line number Diff line change
Expand Up @@ -1221,7 +1221,11 @@ def add_results(self, record_list: List[ResultRecord]):

if idx not in existing_results:
# Does not exist in the database. Construct a new ResultORM
doc = ResultORM(**result.dict(exclude={"id"}))
doc = ResultORM(**result.dict(exclude={"id", "properties"}))

# Keep properties as JSON (PR #694)
if result.properties is not None:
doc.properties = result.properties.dict(encoding="json")

# Store in existing_results in case later records are duplicates
existing_results[idx] = doc
Expand Down Expand Up @@ -1313,7 +1317,12 @@ def update_results(self, record_list: List[ResultRecord]):
self.logger.error("Attempted update without ID, skipping")
continue

data = result.dict(exclude={"id"})
# must use json encoding to remove numpy arrays of properties
data = result.dict(exclude={"id", "properties"})

if result.properties is not None:
data["properties"] = result.properties.dict(encoding="json")

# retrieve the found item
found_db = found_dict[result.id]

Expand Down
4 changes: 2 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@
"pyarrow >=0.15.0",
# 'double-conversion >=3.0.0',
# QCArchive depends
"qcengine>=0.11.0,<0.20",
"qcelemental>=0.13.1,<0.23",
"qcengine>=0.20",
"qcelemental>=0.23",
],
entry_points={
"console_scripts": [
Expand Down

0 comments on commit f0066ff

Please sign in to comment.