Skip to content

dpdata label system read ase db file - #115

Open
jwz360 wants to merge 6 commits into
deepmodeling:masterfrom
jwz360:master
Open

dpdata label system read ase db file#115
jwz360 wants to merge 6 commits into
deepmodeling:masterfrom
jwz360:master

Conversation

@jwz360

@jwz360 jwz360 commented Sep 9, 2020

Copy link
Copy Markdown

convert ase db to dpdata label system

@njzjz njzjz left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to add dpdata/ase under this line

dpdata/setup.py

Lines 27 to 40 in f150dd1

packages=['dpdata',
'dpdata/vasp',
'dpdata/lammps',
'dpdata/md',
'dpdata/deepmd',
'dpdata/qe',
'dpdata/siesta',
'dpdata/gaussian',
'dpdata/cp2k',
'dpdata/xyz',
'dpdata/pwmat',
'dpdata/amber',
'dpdata/fhi_aims',
'dpdata/gromacs'

@amcadmus
amcadmus changed the base branch from master to devel September 10, 2020 06:01
@amcadmus

Copy link
Copy Markdown
Member

documentation and unittest are required.

Comment thread setup.py
'dpdata/fhi_aims',
'dpdata/gromacs'],
'dpdata/gromacs',
'dpdata/ase'

@njzjz njzjz Oct 9, 2020

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You need to use another directory name instead of ase, otherwise it will be conflict with the ase package when you import ase package in this directory.

@amcadmus

amcadmus commented Oct 9, 2020

Copy link
Copy Markdown
Member

Your change to the code should be based on branch "devel" rather than master.

we do not want to merge some of changes on master into devel

njzjz added a commit to njzjz/dpdata that referenced this pull request Jul 9, 2021

@njzjz-bot njzjz-bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Requesting changes and recommending a clean rewrite against the current ASE plugin. The current generic ASE reader can already load all 2646 structures without labels, while an ASE DB-specific fallback for row.data labels remains useful; however, this 2020 branch makes ASE a core import, returns an invalid energy shape, has an empty test file, and includes unrelated generated or misnamed artifacts.

Process note: the Codex usage allowance is about to reset, so I am spending the remaining token budget now on this review.

Coding agent: Codex
Codex version: codex-cli 0.144.6
Model: gpt-5.6-sol
Reasoning effort: xhigh

Comment thread dpdata/system.py
import dpdata.vasp.poscar
import dpdata.vasp.xml
import dpdata.vasp.outcar
import dpdata.ase.db

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P1] Keep ASE optional by importing it lazily

This module-level import makes every import dpdata require ASE, but ASE is not a core dependency. Core-only installations would fail before using any ASE feature. Register the backend through the current plugin structure and import ASE only when that format is selected.

Comment thread dpdata/ase/db.py
sorted_numbers = numbers.argsort()
ats = ats_[sorted_numbers]
data = ati.data
energy = data['energy']

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] Normalize scalar energies to the required frame shape

The bundled database stores data[energy] as a one-element array, so appending it unchanged produces energies with shape (2646, 1). LabeledSystem requires one scalar per frame, shape (nframes,). Extract and validate the scalar value here, and cover it with a real test rather than the empty test_ase_db.py file.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants