Skip to content

Commit

Permalink
GAP add export for environmental variables (#42)
Browse files Browse the repository at this point in the history
* add env

* bump zntrack

* remove os import
  • Loading branch information
PythonFZ authored Apr 5, 2023
1 parent e5ab187 commit 5ce8fb9
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 24 deletions.
6 changes: 1 addition & 5 deletions ipsuite/models/gap.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
import dataclasses
import importlib.resources as pkg_resources
import logging
import os
import subprocess as sp
import typing
from collections import OrderedDict
Expand Down Expand Up @@ -213,13 +212,10 @@ class GAP(MLModel):
gap_input_script: Path = zntrack.dvc.outs(zntrack.nwd / "gap.input")

#
openblas_num_threads = zntrack.meta.Text(None)
OPENBLAS_NUM_THREADS = zntrack.meta.Environment(None)

#
def _post_init_(self):
if self.openblas_num_threads is not None:
os.environ["OPENBLAS_NUM_THREADS"] = self.openblas_num_threads

if not self.state.loaded:
if self.soap is None:
self.soap = {}
Expand Down
36 changes: 18 additions & 18 deletions poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ python = ">=3.10,<3.12"
libclang = "^15"

znh5md = "^0.1.6a0"
zntrack = "^0.6.0a3"
zntrack = "^0.6.0a4"

ase = "^3.22.1"

Expand Down

0 comments on commit 5ce8fb9

Please sign in to comment.