Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
86 commits
Select commit Hold shift + click to select a range
9ed7fc6
build: deprecate addNewItem
stevenhua0320 Feb 19, 2026
6e99082
build: change body of deprecated function
stevenhua0320 Feb 19, 2026
95138f7
build: add test cases for addNewAtom to test it & show deprecation me…
stevenhua0320 Feb 19, 2026
3f285b6
fix: refine test code to avoid if logic
stevenhua0320 Feb 19, 2026
1fc8a34
test: add docstring and comments to the test.
stevenhua0320 Feb 19, 2026
cb7aec0
fix: add more test cases and refine behavior of add_new_atom
stevenhua0320 Feb 20, 2026
114f3d6
fix: add docstring for hyperparamter for add_new_atom
stevenhua0320 Feb 20, 2026
40e8773
fix: fix comment with syntax error
stevenhua0320 Feb 20, 2026
8f8253c
fix: change behavior to warning and use pytest parametrize to test it.
stevenhua0320 Feb 20, 2026
15ccba1
[pre-commit.ci] auto fixes from pre-commit hooks
pre-commit-ci[bot] Feb 20, 2026
52c99e6
fix: fix comment for UserWarning.
stevenhua0320 Feb 20, 2026
ca9116a
Merge pull request #157 from stevenhua0320/deprecate-addNewItem
sbillinge Feb 20, 2026
793f5b0
build: deprecate getLastAtom and add a test
stevenhua0320 Feb 20, 2026
0762314
Merge pull request #159 from stevenhua0320/deprecate-getLastAtom
sbillinge Feb 20, 2026
e66ddbe
chore: deprecate read/writeStr, placeInLattice method
stevenhua0320 Feb 20, 2026
7da571a
Merge pull request #161 from stevenhua0320/deprecate-structure-function
sbillinge Feb 20, 2026
9c26c25
chore: deprecate private function in utils
stevenhua0320 Feb 20, 2026
3041bc2
Merge pull request #162 from stevenhua0320/deprecate-utils-method
sbillinge Feb 21, 2026
f903531
chore: deprecate setLatPar and setLatBase method
stevenhua0320 Feb 22, 2026
cca23ff
chore: rename the lower-case function to make it clearer in meaning
stevenhua0320 Feb 23, 2026
74683b6
fix: rename new function name in deprecation message and in news
stevenhua0320 Feb 23, 2026
a7d43a1
Merge pull request #163 from stevenhua0320/deprecate-lattice
sbillinge Feb 23, 2026
d09a89c
chore: deprecate abcABG and readStr method
stevenhua0320 Feb 23, 2026
b453098
Merge pull request #164 from stevenhua0320/deprecate-method-lattice
sbillinge Feb 24, 2026
99575aa
chore: deprecate methods in
stevenhua0320 Feb 24, 2026
9a4195a
fix: fix deprecation message and rename the snakecase method to be co…
stevenhua0320 Feb 24, 2026
42d3828
Merge pull request #165 from stevenhua0320/symmetryutilities-deprecate
sbillinge Feb 24, 2026
358df45
chore:deprecate method in and add test for methods
stevenhua0320 Feb 24, 2026
d19c025
fix: fix docstring for method in test.
stevenhua0320 Feb 24, 2026
6a25991
chore: changeg unittest to pytest
stevenhua0320 Feb 25, 2026
567f7fa
Merge pull request #166 from stevenhua0320/deprecate-symmetryutilities-2
sbillinge Feb 25, 2026
ba5eabe
chore: deprecate method in symmetryutilities
stevenhua0320 Feb 25, 2026
f93a859
[pre-commit.ci] auto fixes from pre-commit hooks
pre-commit-ci[bot] Feb 25, 2026
d34a414
Merge pull request #167 from stevenhua0320/deprecate-symmetryutilities-3
sbillinge Feb 25, 2026
7bd0db1
chore: deprecate method in GeneratorSite class
stevenhua0320 Feb 26, 2026
0d60a73
chore: rename function to make it readable
stevenhua0320 Feb 26, 2026
1646a8b
Merge pull request #168 from stevenhua0320/deprecate-symmetryutilities-4
sbillinge Feb 26, 2026
a2e253a
chore: deprecate methods in GeneratorSite class
stevenhua0320 Feb 26, 2026
1395fc3
Merge pull request #169 from stevenhua0320/deprecate-symmetryutilities-5
sbillinge Feb 26, 2026
40e30aa
chore: deprecate SymmetryConstraints class method
stevenhua0320 Feb 28, 2026
71b6a3f
chore: rename the function to increase readability
stevenhua0320 Feb 28, 2026
820a3d6
chore: rename the api in the docstring
stevenhua0320 Feb 28, 2026
fd16b4c
Merge pull request #170 from stevenhua0320/deprecate-symmetryutilities-6
sbillinge Feb 28, 2026
259532c
chore: deprecate symmetryutilities method
stevenhua0320 Mar 2, 2026
f489b30
chore: rename the method to correct one in news
stevenhua0320 Mar 3, 2026
64aa1c7
Merge pull request #171 from stevenhua0320/deprecate-symmetryutilities-7
sbillinge Mar 3, 2026
84b879e
chore: deprecate utils method and private methods in parsers.
stevenhua0320 Mar 3, 2026
6286234
fix: change cif parser attribute name to construct Structure object
stevenhua0320 Mar 3, 2026
fe2ac51
Merge pull request #172 from stevenhua0320/deprecate-utils
sbillinge Mar 3, 2026
0f4ddda
chore: deprecate parseLines method in all parsers
stevenhua0320 Mar 3, 2026
3855f25
Merge pull request #173 from stevenhua0320/deprecate-parser
sbillinge Mar 3, 2026
00987ec
chore: deprecate parseFile method
stevenhua0320 Mar 4, 2026
284bc84
chore: run pre-commit
stevenhua0320 Mar 4, 2026
ae9a8b2
Merge pull request #174 from stevenhua0320/deprecate-parsefile
sbillinge Mar 5, 2026
10ac932
chore: deprecate toLines method across of parsers
stevenhua0320 Mar 5, 2026
70aa675
chore: deprecate getParser method across all parsers format.
stevenhua0320 Mar 6, 2026
29ab7d8
Merge pull request #175 from stevenhua0320/deprecate-toLine
sbillinge Mar 6, 2026
810ef8a
Merge branch 'v3.4.0' into deprecate-getParser
stevenhua0320 Mar 6, 2026
5ddd7b4
Merge pull request #176 from stevenhua0320/deprecate-getParser
sbillinge Mar 6, 2026
c89466c
chore: derepcate P_pdb method
stevenhua0320 Mar 6, 2026
5f64982
chore: deprecate expansion functional utilities method.
stevenhua0320 Mar 6, 2026
a70bc27
Merge pull request #177 from stevenhua0320/deprecate-parser-display
sbillinge Mar 6, 2026
9690c3e
Merge pull request #178 from stevenhua0320/deprecate-expansion-utilit…
sbillinge Mar 6, 2026
279d29d
chore: deprecate apps method
stevenhua0320 Mar 6, 2026
4957ccf
Merge pull request #179 from stevenhua0320/deprecate-apps
sbillinge Mar 7, 2026
d2d6285
chore: deprecate spacegroup method
stevenhua0320 Mar 7, 2026
e19e628
chore: deprecate Atom class method
stevenhua0320 Mar 7, 2026
9751d1e
chore: change docstring
stevenhua0320 Mar 7, 2026
b73f794
Merge pull request #180 from stevenhua0320/deprecate-spacegroup
sbillinge Mar 7, 2026
d6d8525
chore: rename variables to more explicit one, add test case descripti…
stevenhua0320 Mar 7, 2026
991889b
chore: change utility script to snake_case method.
stevenhua0320 Mar 7, 2026
ad7e720
Merge pull request #181 from stevenhua0320/deprecate-atom
sbillinge Mar 8, 2026
913382e
Merge pull request #182 from stevenhua0320/change-utility-script
sbillinge Mar 8, 2026
d4726b1
chore: add readme.md for devutils files
stevenhua0320 Mar 14, 2026
4f7656c
fix: fix load_structure method with loading Path object.
stevenhua0320 Mar 14, 2026
d742cf8
Merge pull request #185 from stevenhua0320/fix-load-structure
sbillinge Mar 16, 2026
6086938
Merge pull request #184 from stevenhua0320/add-devutils-readme
sbillinge Mar 16, 2026
009b5be
feat: add parser for vesta files and vesta app viewer.
stevenhua0320 Mar 24, 2026
05c0219
pre-commit auto-fix
stevenhua0320 Mar 24, 2026
842b92a
fix: change every os.path to Path() object and replace string to f-st…
stevenhua0320 Mar 26, 2026
92c1832
chore: delete unncessary AtomicTable comments.
stevenhua0320 Mar 26, 2026
52748fb
chore: remove unncessary import from p_xcfg
stevenhua0320 Mar 26, 2026
68695b0
Merge pull request #188 from stevenhua0320/vesta_view
sbillinge Mar 26, 2026
193a640
Merge branch 'main' into v3.4.0
sbillinge Mar 27, 2026
cba50a6
chore: add assignUniqueLabels deprecation message
stevenhua0320 Mar 27, 2026
a05255f
Merge pull request #190 from stevenhua0320/assignUniqueLabels-depreca…
sbillinge Mar 27, 2026
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 .codespell/ignore_words.txt
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,7 @@ CONECT
;; /src/diffpy/structure/parsers/p_xcfg.py:452
;; used in a function
BU

;; /src/diffpy/structure/parsers/p_vesta.py:452
;; abbreviation for Structure in vesta
STRUC
1 change: 1 addition & 0 deletions devutils/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Library of scripts used as part of the code development,please keep it out of the package but in the same repo.
68 changes: 34 additions & 34 deletions devutils/sgtbx_extra_groups.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,10 @@
import numpy
from cctbx import sgtbx

from diffpy.structure.spacegroups import IsSpaceGroupIdentifier, SpaceGroup, SymOp, mmLibSpaceGroupList
from diffpy.structure.spacegroups import SpaceGroup, SymOp, is_space_group_identifier, mmLibSpaceGroupList


def tupleToSGArray(tpl):
def tuple_to_sg_array(tpl):
if not _rtarrays:
import diffpy.structure.SpaceGroups as sgmod

Expand All @@ -40,19 +40,19 @@ def tupleToSGArray(tpl):
_rtarrays = {}


def mmSpaceGroupFromSymbol(symbol):
def mm_space_group_from_symbol(symbol):
"""Construct SpaceGroup instance from a string symbol using sgtbx
data."""
sginfo = sgtbx.space_group_info(symbol)
symop_list = []
symop_list = getSymOpList(sginfo.group())
symop_list = get_symop_list(sginfo.group())
sgtype = sginfo.type()
uhm = sgtype.lookup_symbol()
sgsmbls = sgtbx.space_group_symbols(uhm)
kw = {}
kw["number"] = sgtype.number()
kw["num_sym_equiv"] = len(symop_list)
kw["num_primitive_sym_equiv"] = countUniqueRotations(symop_list)
kw["num_primitive_sym_equiv"] = count_unique_rotations(symop_list)
kw["short_name"] = sgsmbls.hermann_mauguin().replace(" ", "")
pgt = sgsmbls.point_group_type()
pgn = "PG" + re.sub(r"-(\d)", "\\1bar", pgt)
Expand All @@ -64,77 +64,77 @@ def mmSpaceGroupFromSymbol(symbol):
return mmsg


def adjustMMSpaceGroupNumber(mmsg):
def adjust_mm_space_group_number(mmsg):
sg0 = [x for x in mmLibSpaceGroupList if x.number == mmsg.number]
if sg0 and cmpSpaceGroups(sg0[0], mmsg):
if sg0 and cmp_space_groups(sg0[0], mmsg):
return
while mmsg.number in sgnumbers:
mmsg.number += 1000
sgnumbers.append(mmsg.number)


def getSymOpList(grp):
def get_symop_list(grp):
symop_list = []
for op in grp:
r_sgtbx = op.r().as_double()
t_sgtbx = op.t().as_double()
R = tupleToSGArray(r_sgtbx)
t = tupleToSGArray(t_sgtbx)
R = tuple_to_sg_array(r_sgtbx)
t = tuple_to_sg_array(t_sgtbx)
symop_list.append(SymOp(R, t))
return symop_list


def countUniqueRotations(symop_list):
def count_unique_rotations(symop_list):
unique_rotations = set()
for op in symop_list:
tpl = tuple(op.R.flatten())
unique_rotations.add(tpl)
return len(unique_rotations)


def cmpSpaceGroups(sg0, sg1):
def cmp_space_groups(sg0, sg1):
if sg0 is sg1:
return True
s0 = hashMMSpaceGroup(sg0)
s1 = hashMMSpaceGroup(sg1)
s0 = hash_mm_space_group(sg0)
s1 = hash_mm_space_group(sg1)
return s0 == s1


def findEquivalentMMSpaceGroup(grp):
def find_equivalent_mm_space_group(grp):
if not _equivmmsg:
for sgn in mmLibSpaceGroupList:
ssgn = hashMMSpaceGroup(sgn)
ssgn = hash_mm_space_group(sgn)
_equivmmsg.setdefault(ssgn, sgn)
ssg = hashSgtbxGroup(grp)
ssg = hash_sgtbx_group(grp)
return _equivmmsg.get(ssg)


_equivmmsg = {}


def findEquivalentSgtbxSpaceGroup(sgmm):
def find_equivalent_sgtbx_space_group(sgmm):
if not _equivsgtbx:
for smbls in sgtbx.space_group_symbol_iterator():
uhm = smbls.universal_hermann_mauguin()
grp = sgtbx.space_group_info(uhm).group()
hgrp = hashSgtbxGroup(grp)
hgrp = hash_sgtbx_group(grp)
_equivsgtbx.setdefault(hgrp, grp)
hgmm = hashMMSpaceGroup(sgmm)
hgmm = hash_mm_space_group(sgmm)
return _equivsgtbx.get(hgmm)


_equivsgtbx = {}


def hashMMSpaceGroup(sg):
def hash_mm_space_group(sg):
lines = [str(sg.number % 1000)] + sorted(map(str, sg.iter_symops()))
s = "\n".join(lines)
return s


def hashSgtbxGroup(grp):
def hash_sgtbx_group(grp):
n = grp.type().number()
lines = [str(n)] + sorted(map(str, getSymOpList(grp)))
lines = [str(n)] + sorted(map(str, get_symop_list(grp)))
s = "\n".join(lines)
return s

Expand All @@ -157,19 +157,19 @@ def hashSgtbxGroup(grp):
"""


def SGCode(mmsg):
def sg_code(mmsg):
src0 = _SGsrc % mmsg.__dict__
src1 = src0.replace("@SYMOPS@", SymOpsCode(mmsg))
src1 = src0.replace("@SYMOPS@", symops_code(mmsg))
return src1


def SymOpsCode(mmsg):
lst = ["%8s%s," % ("", SymOpCode(op)) for op in mmsg.iter_symops()]
def symops_code(mmsg):
lst = ["%8s%s," % ("", symop_code(op)) for op in mmsg.iter_symops()]
src = "\n".join(lst).strip()
return src


def SymOpCode(op):
def symop_code(op):
if not _rtnames:
import diffpy.structure.SpaceGroups as sgmod

Expand All @@ -193,18 +193,18 @@ def main():
for smbls in sgtbx.space_group_symbol_iterator():
uhm = smbls.universal_hermann_mauguin()
grp = sgtbx.space_group_info(uhm).group()
if findEquivalentMMSpaceGroup(grp):
if find_equivalent_mm_space_group(grp):
continue
shn = smbls.hermann_mauguin().replace(" ", "")
if IsSpaceGroupIdentifier(shn):
if is_space_group_identifier(shn):
continue
sg = mmSpaceGroupFromSymbol(uhm)
hsg = hashMMSpaceGroup(sg)
sg = mm_space_group_from_symbol(uhm)
hsg = hash_mm_space_group(sg)
if hsg in duplicates:
continue
adjustMMSpaceGroupNumber(sg)
adjust_mm_space_group_number(sg)
duplicates.add(hsg)
print(SGCode(sg))
print(sg_code(sg))
return


Expand Down
23 changes: 23 additions & 0 deletions news/add-devutils-readme.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
**Added:**

* No news added: add devutils readme

**Changed:**

* <news item>

**Deprecated:**

* <news item>

**Removed:**

* <news item>

**Fixed:**

* <news item>

**Security:**

* <news item>
23 changes: 23 additions & 0 deletions news/assignUniqueLabels-deprecation.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
**Added:**

* No news added: add deprecation message for `assignUniqueLabels`

**Changed:**

* <news item>

**Deprecated:**

* <news item>

**Removed:**

* <news item>

**Fixed:**

* <news item>

**Security:**

* <news item>
23 changes: 23 additions & 0 deletions news/change-utility-script.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
**Added:**

* No news added: Change any utility scripts that outside of package distribution method to snake_cae method

**Changed:**

* <news item>

**Deprecated:**

* <news item>

**Removed:**

* <news item>

**Fixed:**

* <news item>

**Security:**

* <news item>
23 changes: 23 additions & 0 deletions news/deprecate-addNewItem.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
**Added:**

* Added `diffpy.structure.Structure.add_new_atom` in replace of `addNewAtom`

**Changed:**

* <news item>

**Deprecated:**

* Deprecated `diffpy.structure.Structure.addNewAtom` method for removal in version 4.0.0

**Removed:**

* <news item>

**Fixed:**

* <news item>

**Security:**

* <news item>
33 changes: 33 additions & 0 deletions news/deprecate-apps.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
**Added:**

* Added ``load_structure_file`` method in ``apps/anyeye.py``
* Added ``convert_structure_file`` method in ``apps/anyeye.py``
* Added ``watch_structure_file`` method in ``apps/anyeye.py``
* Added ``clean_up`` method in ``apps/anyeye.py``
* Added ``parse_formula`` method in ``apps/anyeye.py``
* Added ``signal_handler`` method in ``apps/anyeye.py``

**Changed:**

* <news item>

**Deprecated:**

* Deprecated ``loadStructureFile`` method in ``apps/anyeye.py`` for removal in version 4.0.0
* Deprecated ``convertStructureFile`` method in ``apps/anyeye.py`` for removal in version 4.0.0
* Deprecated ``watchStructureFile`` method in ``apps/anyeye.py`` for removal in version 4.0.0
* Deprecated ``cleanUp`` method in ``apps/anyeye.py`` for removal in version 4.0.0
* Deprecated ``parseFormula`` method in ``apps/anyeye.py`` for removal in version 4.0.0
* Deprecated ``signalHandler`` method in ``apps/anyeye.py`` for removal in version 4.0.0

**Removed:**

* <news item>

**Fixed:**

* <news item>

**Security:**

* <news item>
28 changes: 28 additions & 0 deletions news/deprecate-atom.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
**Added:**

* Added ``msd_latt`` method in ``atom.py``
* Added ``msd_cart`` method in ``atom.py``
* Added ``_get_uij`` method in ``atom.py``
* Added ``_set_uij`` method in ``atom.py``


**Changed:**

* <news item>

**Deprecated:**

* Deprecated ``msdLat`` method in ``atom.py`` for removal in version 4.0.0
* Deprecated ``msdCart`` method in ``atom.py`` for removal in version 4.0.0

**Removed:**

* <news item>

**Fixed:**

* <news item>

**Security:**

* <news item>
27 changes: 27 additions & 0 deletions news/deprecate-expansion-utilities-1.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
**Added:**

* Added ``find_center`` method in ``expansion/shapeutils.py``
* Added ``make_sphere`` method in ``expansion/makeellipsoid.py``
* Added ``make_ellipsoid`` method in ``expansion/makeellipsoid.py``

**Changed:**

* <news item>

**Deprecated:**

* Deprecated ``findCenter`` method in ``expansion/shapeutils.py`` for removal in version 4.0.0
* Deprecated ``makeSphere`` method in ``expansion/makeellipsoid.py`` for removal in version 4.0.0
* Deprecated ``makeEllipsoid`` method in ``expansion/makeellipsoid.py`` for removal in version 4.0.0

**Removed:**

* <news item>

**Fixed:**

* <news item>

**Security:**

* <news item>
Loading
Loading