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

Devel update #4

Merged
merged 13 commits into from
May 2, 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
4 changes: 4 additions & 0 deletions .git_archival.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node: $Format:%H$
node-date: $Format:%cI$
describe-name: $Format:%(describe:tags=true,match=*[0-9]*)$
ref-names: $Format:%D$
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
.git_archival.txt export-subst
30 changes: 2 additions & 28 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,42 +6,16 @@ on:
- 'v*'

jobs:
conda-publish:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: publish-to-conda
uses: felix5572/conda-publish-action@v1.9
with:
subdir: 'conda'
anacondatoken: ${{ secrets.ANACONDA_TOKEN }}
platforms: 'noarch'
construct-and-publish:
runs-on: ubuntu-latest
needs: conda-publish
steps:
- uses: actions/checkout@master
- uses: s-weigand/setup-conda@v1
- run: conda install constructor jinja2 -y
- run: constructor ./conda
- name: Upload to release
uses: softprops/action-gh-release@master
if: startsWith(github.ref, 'refs/tags/')
with:
files: dpgen-*.sh
repository: ${{ env.GITHUB_REPOSITORY }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
release-to-pypi:
name: Release to pypi
runs-on: ubuntu-latest
permissions:
# IMPORTANT: this permission is mandatory for trusted publishing
id-token: write
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Setup python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.x
architecture: x64
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@ jobs:
python-version: ["3.9", "3.12"]

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- run: pip install uv
- name: Install dependencies
run: pip install -e .[test]
run: uv pip install --system -e .[test]
- name: Test
run: coverage run --source=./dpgen -m unittest -v && coverage report
- uses: codecov/codecov-action@v4
Expand Down
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.5.0
rev: v4.6.0
hooks:
# there are many log files in tests
# TODO: seperate py files and log files
Expand All @@ -28,7 +28,7 @@ repos:

# Python
- repo: https://github.com/astral-sh/ruff-pre-commit
rev: v0.3.4
rev: v0.4.1
hooks:
- id: ruff
args: ["--fix"]
Expand Down
11 changes: 5 additions & 6 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,14 @@ build:
os: ubuntu-22.04
tools:
python: "3.10"

jobs:
post_create_environment:
- pip install uv
post_install:
- VIRTUAL_ENV=$READTHEDOCS_VIRTUALENV_PATH uv pip install -r doc/requirements.txt
# Build documentation in the docs/ directory with Sphinx
sphinx:
configuration: doc/conf.py

# If using Sphinx, optionally build your docs in additional formats such as PDF
formats: all

# Optionally declare the Python requirements required to build your docs
python:
install:
- requirements: doc/requirements.txt
5 changes: 0 additions & 5 deletions conda/conda_build_config.yaml

This file was deleted.

18 changes: 0 additions & 18 deletions conda/construct.yaml

This file was deleted.

60 changes: 0 additions & 60 deletions conda/meta.yaml

This file was deleted.

16 changes: 7 additions & 9 deletions dpgen/generator/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -4437,20 +4437,18 @@ def post_fp_cp2k(iter_index, jdata, rfailed=None):
sys_output = glob.glob(os.path.join(work_path, "task.%s.*/output" % ss))
sys_output.sort()
tcount += len(sys_output)
all_sys = None
all_sys = dpdata.MultiSystems(type_map=jdata["type_map"])
for oo in sys_output:
_sys = dpdata.LabeledSystem(oo, fmt="cp2k/output")
# _sys.check_type_map(type_map = jdata['type_map'])
if all_sys is None:
all_sys = _sys
else:
all_sys.append(_sys)
_sys = dpdata.LabeledSystem(
oo, fmt="cp2kdata/e_f", type_map=jdata["type_map"]
)
all_sys.append(_sys)
icount += 1

icount += len(all_sys)
if (all_sys is not None) and (len(all_sys) > 0):
sys_data_path = os.path.join(work_path, "data.%s" % ss)
all_sys.to_deepmd_raw(sys_data_path)
all_sys.to_deepmd_npy(sys_data_path, set_size=len(sys_output))
all_sys.to_deepmd_npy(sys_data_path)

if tcount == 0:
rfail = 0.0
Expand Down
5 changes: 3 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[build-system]
requires = ["setuptools>=61", "setuptools_scm[toml]>=6.2"]
requires = ["setuptools>=61", "setuptools_scm[toml]>=7"]
build-backend = "setuptools.build_meta"

[project]
Expand All @@ -19,7 +19,8 @@ classifiers = [
]
dependencies = [
'numpy>=1.14.3',
'dpdata>=0.2.16',
'dpdata>=0.2.17',
'cp2kdata>=0.6.6',
'pymatgen>=2022.11.1',
'ase',
'monty>2.0.0',
Expand Down
2 changes: 1 addition & 1 deletion tests/generator/test_post_fp.py
Original file line number Diff line number Diff line change
Expand Up @@ -281,7 +281,7 @@ def setUp(self):
post_fp(0, jdata)
self.system_1 = dpdata.LabeledSystem("iter.000000/orig", fmt="deepmd/raw")
self.system_2 = dpdata.LabeledSystem(
"iter.000000/02.fp/data.000", fmt="deepmd/raw"
"iter.000000/02.fp/data.000/C2H2N2", fmt="deepmd/raw"
)


Expand Down
Loading