pwdata 0.1.3__tar.gz → 0.1.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of pwdata might be problematic. Click here for more details.
- {pwdata-0.1.3 → pwdata-0.1.4}/PKG-INFO +1 -1
- {pwdata-0.1.3 → pwdata-0.1.4}/pwdata/build/write_struc.py +14 -14
- {pwdata-0.1.3 → pwdata-0.1.4}/pwdata/extendedxyz.py +2 -1
- {pwdata-0.1.3 → pwdata-0.1.4}/pwdata/main.py +23 -17
- {pwdata-0.1.3 → pwdata-0.1.4}/pwdata.egg-info/PKG-INFO +1 -1
- {pwdata-0.1.3 → pwdata-0.1.4}/setup.py +1 -1
- {pwdata-0.1.3 → pwdata-0.1.4}/LICENSE +0 -0
- {pwdata-0.1.3 → pwdata-0.1.4}/README.md +0 -0
- {pwdata-0.1.3 → pwdata-0.1.4}/pwdata/__init__.py +0 -0
- {pwdata-0.1.3 → pwdata-0.1.4}/pwdata/atomconfig.py +0 -0
- {pwdata-0.1.3 → pwdata-0.1.4}/pwdata/build/__init__.py +0 -0
- {pwdata-0.1.3 → pwdata-0.1.4}/pwdata/build/cell.py +0 -0
- {pwdata-0.1.3 → pwdata-0.1.4}/pwdata/build/geometry.py +0 -0
- {pwdata-0.1.3 → pwdata-0.1.4}/pwdata/build/supercells.py +0 -0
- {pwdata-0.1.3 → pwdata-0.1.4}/pwdata/calculators/__init__.py +0 -0
- {pwdata-0.1.3 → pwdata-0.1.4}/pwdata/calculators/const.py +0 -0
- {pwdata-0.1.3 → pwdata-0.1.4}/pwdata/calculators/unitconvert_lmps.py +0 -0
- {pwdata-0.1.3 → pwdata-0.1.4}/pwdata/calculators/units.py +0 -0
- {pwdata-0.1.3 → pwdata-0.1.4}/pwdata/configop.py +0 -0
- {pwdata-0.1.3 → pwdata-0.1.4}/pwdata/cp2kdata.py +0 -0
- {pwdata-0.1.3 → pwdata-0.1.4}/pwdata/datasets_saver.py +0 -0
- {pwdata-0.1.3 → pwdata-0.1.4}/pwdata/dump.py +0 -0
- {pwdata-0.1.3 → pwdata-0.1.4}/pwdata/image.py +0 -0
- {pwdata-0.1.3 → pwdata-0.1.4}/pwdata/lammpsdata.py +0 -0
- {pwdata-0.1.3 → pwdata-0.1.4}/pwdata/lmps.py +0 -0
- {pwdata-0.1.3 → pwdata-0.1.4}/pwdata/movement.py +0 -0
- {pwdata-0.1.3 → pwdata-0.1.4}/pwdata/movement_saver.py +0 -0
- {pwdata-0.1.3 → pwdata-0.1.4}/pwdata/outcar.py +0 -0
- {pwdata-0.1.3 → pwdata-0.1.4}/pwdata/pertub/__init__.py +0 -0
- {pwdata-0.1.3 → pwdata-0.1.4}/pwdata/pertub/perturbation.py +0 -0
- {pwdata-0.1.3 → pwdata-0.1.4}/pwdata/pertub/scale.py +0 -0
- {pwdata-0.1.3 → pwdata-0.1.4}/pwdata/poscar.py +0 -0
- {pwdata-0.1.3 → pwdata-0.1.4}/pwdata.egg-info/SOURCES.txt +0 -0
- {pwdata-0.1.3 → pwdata-0.1.4}/pwdata.egg-info/dependency_links.txt +0 -0
- {pwdata-0.1.3 → pwdata-0.1.4}/pwdata.egg-info/top_level.txt +0 -0
- {pwdata-0.1.3 → pwdata-0.1.4}/setup.cfg +0 -0
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: pwdata
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.4
|
|
4
4
|
Summary: pwdata is a data pre-processing tool for PWMLFF, which can be used to extract features and labels. It also provides convenient interfaces for data conversion between different software.
|
|
5
5
|
Home-page: https://github.com/LonxunQuantum/pwdata
|
|
6
6
|
Author: LonxunQuantum
|
|
@@ -6,9 +6,9 @@ from pwdata.lmps import Box2l
|
|
|
6
6
|
from pwdata.calculators.const import elements, ELEMENTMASSTABLE
|
|
7
7
|
|
|
8
8
|
|
|
9
|
-
def write_config(
|
|
10
|
-
|
|
11
|
-
|
|
9
|
+
def write_config(atoms,
|
|
10
|
+
filepath,
|
|
11
|
+
data_name="tmp.pwdada",
|
|
12
12
|
sort=None,
|
|
13
13
|
symbol_count=None,
|
|
14
14
|
long_format=True,
|
|
@@ -105,7 +105,7 @@ def write_config(filepath,
|
|
|
105
105
|
atom_type_num = atoms.atom_type_num
|
|
106
106
|
|
|
107
107
|
# Write to file
|
|
108
|
-
output_file = open(os.path.join(filepath,
|
|
108
|
+
output_file = open(os.path.join(filepath, data_name), 'w')
|
|
109
109
|
output_file.write('%d\n' % atom_nums)
|
|
110
110
|
output_file.write('Lattice vector\n')
|
|
111
111
|
for i in range(3):
|
|
@@ -117,9 +117,9 @@ def write_config(filepath,
|
|
|
117
117
|
1, 1, 1))
|
|
118
118
|
output_file.close()
|
|
119
119
|
|
|
120
|
-
def write_vasp(
|
|
121
|
-
|
|
122
|
-
|
|
120
|
+
def write_vasp(atoms,
|
|
121
|
+
filepath,
|
|
122
|
+
data_name="tmp.pwdada",
|
|
123
123
|
direct=False,
|
|
124
124
|
sort=None,
|
|
125
125
|
symbol_count=None,
|
|
@@ -222,8 +222,8 @@ def write_vasp(filepath,
|
|
|
222
222
|
|
|
223
223
|
atom_type = [elements[_] for _ in atom_type]
|
|
224
224
|
# Write to file
|
|
225
|
-
output_file = open(os.path.join(filepath,
|
|
226
|
-
output_file.write('Created from %s\n' %
|
|
225
|
+
output_file = open(os.path.join(filepath, data_name), 'w')
|
|
226
|
+
output_file.write('Created from %s\n' % data_name)
|
|
227
227
|
output_file.write('1.0\n')
|
|
228
228
|
for i in range(3):
|
|
229
229
|
output_file.write('%19.16f %19.16f %19.16f\n' % tuple(atoms.lattice[i]))
|
|
@@ -245,9 +245,9 @@ def write_vasp(filepath,
|
|
|
245
245
|
output_file.write('\n')
|
|
246
246
|
output_file.close()
|
|
247
247
|
|
|
248
|
-
def write_lammps(
|
|
249
|
-
|
|
250
|
-
|
|
248
|
+
def write_lammps(atoms,
|
|
249
|
+
filepath,
|
|
250
|
+
data_name="tmp.pwdada",
|
|
251
251
|
direct=False,
|
|
252
252
|
sort=None,
|
|
253
253
|
symbol_count=None,
|
|
@@ -380,8 +380,8 @@ def write_lammps(filepath,
|
|
|
380
380
|
LX[i,2] = x[i,2]
|
|
381
381
|
|
|
382
382
|
# Write to file
|
|
383
|
-
output_file = open(os.path.join(filepath,
|
|
384
|
-
output_file.write('Created from %s\n' %
|
|
383
|
+
output_file = open(os.path.join(filepath, data_name), 'w')
|
|
384
|
+
output_file.write('Created from %s\n' % data_name)
|
|
385
385
|
output_file.write("%-12d atoms\n" % (atom_nums))
|
|
386
386
|
output_file.write("%-12d atom types\n" % (len(atom_type)))
|
|
387
387
|
output_file.write("%16.12f %16.12f xlo xhi\n" % (xlo, xhi))
|
|
@@ -5,7 +5,8 @@ def save_to_extxyz(image_data_all: list, output_path: str, output_file: str, wri
|
|
|
5
5
|
output_file = open(os.path.join(output_path, output_file), write_patthen)
|
|
6
6
|
for i in range(len(image_data_all)):
|
|
7
7
|
image_data = image_data_all[i]
|
|
8
|
-
image_data.
|
|
8
|
+
if not image_data.cartesian:
|
|
9
|
+
image_data._set_cartesian()
|
|
9
10
|
output_file.write("%d\n" % image_data.atom_nums)
|
|
10
11
|
# output_file.write("Iteration: %s\n" % image_data.iteration)
|
|
11
12
|
output_head = 'Lattice="%.2f %.2f %.2f %.2f %.2f %.2f %.2f %.2f %.2f" Properties=species:S:1:pos:R:3:force:R:3:local_energy:R:1 pbc="T T T" energy={}\n'.format(image_data.Ep)
|
|
@@ -163,7 +163,7 @@ class Configs(object):
|
|
|
163
163
|
return image
|
|
164
164
|
|
|
165
165
|
@staticmethod
|
|
166
|
-
def to(image, output_path,
|
|
166
|
+
def to(image, output_path, file_format = None, train_ratio = 0.8, **kwargs):
|
|
167
167
|
"""
|
|
168
168
|
Write atoms object to a new file.
|
|
169
169
|
|
|
@@ -171,38 +171,44 @@ class Configs(object):
|
|
|
171
171
|
|
|
172
172
|
Args:
|
|
173
173
|
output_path (str): The path to save the file.
|
|
174
|
-
file_name (str): Save name of the configuration file.
|
|
175
174
|
file_format (str): The format of the file. Default is None.
|
|
176
|
-
direct (bool): The coordinates of the atoms are in fractional coordinates or cartesian coordinates. (0 0 0) -> (1 1 1)
|
|
177
|
-
sort (bool): Whether to sort the atoms by atomic number. Default is False.
|
|
178
|
-
wrap (bool): hether to wrap the atoms into the simulation box (for pbc). Default is False.
|
|
179
|
-
train_ratio (float): The ratio of the training dataset. Default is 0.8.
|
|
180
175
|
|
|
181
176
|
Kwargs:
|
|
177
|
+
|
|
178
|
+
Additional keyword arguments for image or multi_image format. (e.g. 'pwmat/config', 'vasp/poscar', 'lammps/lmp', 'pwmat/movement', 'extxyz')
|
|
179
|
+
|
|
180
|
+
* data_name (str): Save name of the configuration file.
|
|
181
|
+
* sort (bool): Whether to sort the atoms by atomic number. Default is False.
|
|
182
|
+
* wrap (bool): hether to wrap the atoms into the simulation box (for pbc). Default is False.
|
|
183
|
+
* direct (bool): The coordinates of the atoms are in fractional coordinates or cartesian coordinates. (0 0 0) -> (1 1 1)
|
|
184
|
+
|
|
185
|
+
|
|
182
186
|
Additional keyword arguments for 'pwmlff/npy' format.
|
|
183
187
|
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
188
|
+
* data_name (str): Save name of the dataset folder.
|
|
189
|
+
* train_ratio (float): The ratio of the training dataset. Default is None.
|
|
190
|
+
* train_data_path (str): Save path of the training dataset. Default is "train". ("./output_path/train")
|
|
191
|
+
* valid_data_path (str): Save path of the validation dataset. Default is "valid". ("./output_path/valid")
|
|
192
|
+
* random (bool): Whether to shuffle the raw data and then split the data into the training and validation datasets. Default is True.
|
|
193
|
+
* seed (int): Random seed. Default is 2024.
|
|
194
|
+
* retain_raw (bool): Whether to retain the raw data. Default is False.
|
|
189
195
|
|
|
190
196
|
"""
|
|
191
197
|
assert file_format is not None, "output file format is not specified"
|
|
192
198
|
if not os.path.exists(output_path):
|
|
193
199
|
os.makedirs(output_path)
|
|
194
200
|
if file_format.lower() == 'pwmat/config':
|
|
195
|
-
write_config(
|
|
201
|
+
write_config(image, output_path, **kwargs)
|
|
196
202
|
elif file_format.lower() == 'vasp/poscar':
|
|
197
|
-
write_vasp(
|
|
203
|
+
write_vasp(image, output_path, **kwargs)
|
|
198
204
|
elif file_format.lower() == "lammps/lmp":
|
|
199
|
-
write_lammps(
|
|
205
|
+
write_lammps(image, output_path, **kwargs)
|
|
200
206
|
elif file_format.lower() == "pwmat/movement":
|
|
201
|
-
save_to_movement(image, output_path,
|
|
207
|
+
save_to_movement(image, output_path, **kwargs)
|
|
202
208
|
elif file_format.lower() == "extxyz":
|
|
203
|
-
save_to_extxyz(image, output_path,
|
|
209
|
+
save_to_extxyz(image, output_path, **kwargs)
|
|
204
210
|
elif file_format.lower() == "pwmlff/npy":
|
|
205
|
-
save_to_dataset(image, datasets_path
|
|
211
|
+
save_to_dataset(image, datasets_path=output_path, **kwargs)
|
|
206
212
|
else:
|
|
207
213
|
raise RuntimeError('Unknown file format')
|
|
208
214
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.1
|
|
2
2
|
Name: pwdata
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.4
|
|
4
4
|
Summary: pwdata is a data pre-processing tool for PWMLFF, which can be used to extract features and labels. It also provides convenient interfaces for data conversion between different software.
|
|
5
5
|
Home-page: https://github.com/LonxunQuantum/pwdata
|
|
6
6
|
Author: LonxunQuantum
|
|
@@ -5,7 +5,7 @@ with open("README.md", "r") as fh:
|
|
|
5
5
|
|
|
6
6
|
setuptools.setup(
|
|
7
7
|
name="pwdata",
|
|
8
|
-
version="0.1.
|
|
8
|
+
version="0.1.4",
|
|
9
9
|
author="LonxunQuantum",
|
|
10
10
|
author_email="lonxun@pwmat.com",
|
|
11
11
|
description="pwdata is a data pre-processing tool for PWMLFF, which can be used to extract features and labels. It also provides convenient interfaces for data conversion between different software.",
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|