diffpy.structure 3.2.1rc0__tar.gz → 3.2.2__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.
Files changed (94) hide show
  1. {diffpy_structure-3.2.1rc0 → diffpy_structure-3.2.2}/AUTHORS.rst +1 -0
  2. {diffpy_structure-3.2.1rc0 → diffpy_structure-3.2.2}/LICENSE.rst +1 -1
  3. {diffpy_structure-3.2.1rc0 → diffpy_structure-3.2.2}/LICENSE_DANSE.rst +2 -2
  4. {diffpy_structure-3.2.1rc0 → diffpy_structure-3.2.2}/LICENSE_pymmlib.rst +1 -1
  5. diffpy_structure-3.2.2/MANIFEST.in +12 -0
  6. {diffpy_structure-3.2.1rc0 → diffpy_structure-3.2.2}/PKG-INFO +8 -9
  7. {diffpy_structure-3.2.1rc0 → diffpy_structure-3.2.2}/README.rst +5 -8
  8. {diffpy_structure-3.2.1rc0 → diffpy_structure-3.2.2}/pyproject.toml +6 -3
  9. diffpy_structure-3.2.2/requirements/build.txt +0 -0
  10. diffpy_structure-3.2.2/requirements/conda.txt +2 -0
  11. diffpy_structure-3.2.2/requirements/docs.txt +4 -0
  12. diffpy_structure-3.2.2/requirements/pip.txt +2 -0
  13. diffpy_structure-3.2.2/requirements/test.txt +6 -0
  14. {diffpy_structure-3.2.1rc0 → diffpy_structure-3.2.2}/src/diffpy/structure/atom.py +1 -1
  15. {diffpy_structure-3.2.1rc0 → diffpy_structure-3.2.2}/src/diffpy/structure/structure.py +6 -4
  16. {diffpy_structure-3.2.1rc0 → diffpy_structure-3.2.2}/src/diffpy.structure.egg-info/PKG-INFO +8 -9
  17. {diffpy_structure-3.2.1rc0 → diffpy_structure-3.2.2}/src/diffpy.structure.egg-info/SOURCES.txt +47 -2
  18. diffpy_structure-3.2.2/src/diffpy.structure.egg-info/requires.txt +2 -0
  19. diffpy_structure-3.2.2/tests/conftest.py +29 -0
  20. diffpy_structure-3.2.2/tests/test_atom.py +155 -0
  21. diffpy_structure-3.2.2/tests/test_lattice.py +261 -0
  22. diffpy_structure-3.2.2/tests/test_loadstructure.py +68 -0
  23. diffpy_structure-3.2.2/tests/test_p_cif.py +390 -0
  24. diffpy_structure-3.2.2/tests/test_p_discus.py +151 -0
  25. diffpy_structure-3.2.2/tests/test_p_pdffit.py +246 -0
  26. diffpy_structure-3.2.2/tests/test_parsers.py +340 -0
  27. diffpy_structure-3.2.2/tests/test_spacegroups.py +129 -0
  28. diffpy_structure-3.2.2/tests/test_structure.py +605 -0
  29. diffpy_structure-3.2.2/tests/test_supercell.py +91 -0
  30. diffpy_structure-3.2.2/tests/test_symmetryutilities.py +511 -0
  31. diffpy_structure-3.2.2/tests/test_version.py +10 -0
  32. diffpy_structure-3.2.2/tests/testdata/BubbleRaftShort.xcfg +523 -0
  33. diffpy_structure-3.2.2/tests/testdata/CdSe_bulk.stru +33 -0
  34. diffpy_structure-3.2.2/tests/testdata/LiCl-bad.cif +231 -0
  35. diffpy_structure-3.2.2/tests/testdata/Ni-bad.stru +32 -0
  36. diffpy_structure-3.2.2/tests/testdata/Ni-discus.stru +9 -0
  37. diffpy_structure-3.2.2/tests/testdata/Ni.stru +33 -0
  38. diffpy_structure-3.2.2/tests/testdata/Ni_prim123.stru +45 -0
  39. diffpy_structure-3.2.2/tests/testdata/Ni_ref.cif +20 -0
  40. diffpy_structure-3.2.2/tests/testdata/PbTe.cif +227 -0
  41. diffpy_structure-3.2.2/tests/testdata/TeI-unkocc.cif +37 -0
  42. diffpy_structure-3.2.2/tests/testdata/TeI.cif +37 -0
  43. diffpy_structure-3.2.2/tests/testdata/ZnSb_RT_Q28X_VM_20_fxiso.rstr +405 -0
  44. diffpy_structure-3.2.2/tests/testdata/arginine.pdb +28 -0
  45. diffpy_structure-3.2.2/tests/testdata/badspacegroup.cif +49 -0
  46. diffpy_structure-3.2.2/tests/testdata/bucky-bad1.xyz +61 -0
  47. diffpy_structure-3.2.2/tests/testdata/bucky-bad2.xyz +62 -0
  48. diffpy_structure-3.2.2/tests/testdata/bucky-plain-bad.xyz +60 -0
  49. diffpy_structure-3.2.2/tests/testdata/bucky-plain.xyz +60 -0
  50. diffpy_structure-3.2.2/tests/testdata/bucky-raw.xyz +60 -0
  51. diffpy_structure-3.2.2/tests/testdata/bucky.xyz +65 -0
  52. diffpy_structure-3.2.2/tests/testdata/curlybrackets.cif +120 -0
  53. diffpy_structure-3.2.2/tests/testdata/customsg.cif +44 -0
  54. diffpy_structure-3.2.2/tests/testdata/graphite.cif +44 -0
  55. diffpy_structure-3.2.2/tests/testdata/hexagon-raw-bad.xyz +6 -0
  56. diffpy_structure-3.2.2/tests/testdata/hexagon-raw.xy +6 -0
  57. diffpy_structure-3.2.2/tests/testdata/hexagon-raw.xyz +6 -0
  58. diffpy_structure-3.2.2/tests/testdata/nosites.cif +44 -0
  59. diffpy_structure-3.2.1rc0/MANIFEST.in +0 -14
  60. diffpy_structure-3.2.1rc0/src/diffpy/Structure.py +0 -35
  61. {diffpy_structure-3.2.1rc0 → diffpy_structure-3.2.2}/setup.cfg +0 -0
  62. {diffpy_structure-3.2.1rc0 → diffpy_structure-3.2.2}/src/diffpy/__init__.py +0 -0
  63. {diffpy_structure-3.2.1rc0 → diffpy_structure-3.2.2}/src/diffpy/structure/__init__.py +0 -0
  64. {diffpy_structure-3.2.1rc0 → diffpy_structure-3.2.2}/src/diffpy/structure/_legacy_importer.py +0 -0
  65. {diffpy_structure-3.2.1rc0 → diffpy_structure-3.2.2}/src/diffpy/structure/apps/__init__.py +0 -0
  66. {diffpy_structure-3.2.1rc0 → diffpy_structure-3.2.2}/src/diffpy/structure/apps/anyeye.py +0 -0
  67. {diffpy_structure-3.2.1rc0 → diffpy_structure-3.2.2}/src/diffpy/structure/apps/transtru.py +0 -0
  68. {diffpy_structure-3.2.1rc0 → diffpy_structure-3.2.2}/src/diffpy/structure/expansion/__init__.py +0 -0
  69. {diffpy_structure-3.2.1rc0 → diffpy_structure-3.2.2}/src/diffpy/structure/expansion/makeellipsoid.py +0 -0
  70. {diffpy_structure-3.2.1rc0 → diffpy_structure-3.2.2}/src/diffpy/structure/expansion/shapeutils.py +0 -0
  71. {diffpy_structure-3.2.1rc0 → diffpy_structure-3.2.2}/src/diffpy/structure/expansion/supercell_mod.py +0 -0
  72. {diffpy_structure-3.2.1rc0 → diffpy_structure-3.2.2}/src/diffpy/structure/lattice.py +0 -0
  73. {diffpy_structure-3.2.1rc0 → diffpy_structure-3.2.2}/src/diffpy/structure/mmlibspacegroups.py +0 -0
  74. {diffpy_structure-3.2.1rc0 → diffpy_structure-3.2.2}/src/diffpy/structure/parsers/__init__.py +0 -0
  75. {diffpy_structure-3.2.1rc0 → diffpy_structure-3.2.2}/src/diffpy/structure/parsers/p_auto.py +0 -0
  76. {diffpy_structure-3.2.1rc0 → diffpy_structure-3.2.2}/src/diffpy/structure/parsers/p_cif.py +0 -0
  77. {diffpy_structure-3.2.1rc0 → diffpy_structure-3.2.2}/src/diffpy/structure/parsers/p_discus.py +0 -0
  78. {diffpy_structure-3.2.1rc0 → diffpy_structure-3.2.2}/src/diffpy/structure/parsers/p_pdb.py +0 -0
  79. {diffpy_structure-3.2.1rc0 → diffpy_structure-3.2.2}/src/diffpy/structure/parsers/p_pdffit.py +0 -0
  80. {diffpy_structure-3.2.1rc0 → diffpy_structure-3.2.2}/src/diffpy/structure/parsers/p_rawxyz.py +0 -0
  81. {diffpy_structure-3.2.1rc0 → diffpy_structure-3.2.2}/src/diffpy/structure/parsers/p_xcfg.py +0 -0
  82. {diffpy_structure-3.2.1rc0 → diffpy_structure-3.2.2}/src/diffpy/structure/parsers/p_xyz.py +0 -0
  83. {diffpy_structure-3.2.1rc0 → diffpy_structure-3.2.2}/src/diffpy/structure/parsers/parser_index_mod.py +0 -0
  84. {diffpy_structure-3.2.1rc0 → diffpy_structure-3.2.2}/src/diffpy/structure/parsers/structureparser.py +0 -0
  85. {diffpy_structure-3.2.1rc0 → diffpy_structure-3.2.2}/src/diffpy/structure/pdffitstructure.py +0 -0
  86. {diffpy_structure-3.2.1rc0 → diffpy_structure-3.2.2}/src/diffpy/structure/sgtbxspacegroups.py +0 -0
  87. {diffpy_structure-3.2.1rc0 → diffpy_structure-3.2.2}/src/diffpy/structure/spacegroupmod.py +0 -0
  88. {diffpy_structure-3.2.1rc0 → diffpy_structure-3.2.2}/src/diffpy/structure/spacegroups.py +0 -0
  89. {diffpy_structure-3.2.1rc0 → diffpy_structure-3.2.2}/src/diffpy/structure/structureerrors.py +0 -0
  90. {diffpy_structure-3.2.1rc0 → diffpy_structure-3.2.2}/src/diffpy/structure/symmetryutilities.py +0 -0
  91. {diffpy_structure-3.2.1rc0 → diffpy_structure-3.2.2}/src/diffpy/structure/utils.py +0 -0
  92. {diffpy_structure-3.2.1rc0 → diffpy_structure-3.2.2}/src/diffpy/structure/version.py +0 -0
  93. {diffpy_structure-3.2.1rc0 → diffpy_structure-3.2.2}/src/diffpy.structure.egg-info/dependency_links.txt +0 -0
  94. {diffpy_structure-3.2.1rc0 → diffpy_structure-3.2.2}/src/diffpy.structure.egg-info/top_level.txt +0 -0
@@ -1,6 +1,7 @@
1
1
  Authors
2
2
  =======
3
3
 
4
+ Billinge Group and community contributors,
4
5
  Pavol Juhas,
5
6
  Christopher L. Farrow,
6
7
  Xiaohao Yang,
@@ -15,7 +15,7 @@ Copyright (c) 2014, Australian Synchrotron Research Program Inc., ("ASRP")
15
15
 
16
16
  Copyright (c) 2014-2019, Brookhaven Science Associates, Brookhaven National Laboratory
17
17
 
18
- Copyright (c) 2024, The Trustees of Columbia University in the City of New York.
18
+ Copyright (c) 2024, The Trustees of Columbia University in the City of New York.
19
19
  All rights reserved.
20
20
 
21
21
  The "DiffPy-CMI" is distributed subject to the following license conditions:
@@ -9,13 +9,13 @@ Copyright 2006-2007, Board of Trustees of Michigan State University,
9
9
  Copyright 2008-2012, The Trustees of Columbia University in the
10
10
  City of New York. (Copyright holder indicated in each source file).
11
11
 
12
- Copyright (c) 2024, The Trustees of Columbia University in the City of New York.
12
+ Copyright (c) 2024, The Trustees of Columbia University in the City of New York.
13
13
  All rights reserved.
14
14
 
15
15
  For more information please visit the project web-page:
16
16
 
17
17
  http://www.diffpy.org/
18
-
18
+
19
19
  or email Prof. Simon Billinge at sb2896@columbia.edu
20
20
 
21
21
  Redistribution and use in source and binary forms, with or without
@@ -1,5 +1,5 @@
1
1
  .. code-block:: text
2
-
2
+
3
3
  The Artistic License 2.0
4
4
 
5
5
  Copyright (c) 2000-2006, The Perl Foundation.
@@ -0,0 +1,12 @@
1
+ graft src
2
+ graft tests
3
+ graft requirements
4
+
5
+ include AUTHORS.rst LICENSE*.rst README.rst
6
+
7
+ # Exclude all bytecode files and __pycache__ directories
8
+ global-exclude *.py[cod] # Exclude all .pyc, .pyo, and .pyd files.
9
+ global-exclude .DS_Store # Exclude Mac filesystem artifacts.
10
+ global-exclude __pycache__ # Exclude Python cache directories.
11
+ global-exclude .git* # Exclude git files and directories.
12
+ global-exclude .idea # Exclude PyCharm project settings.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: diffpy.structure
3
- Version: 3.2.1rc0
3
+ Version: 3.2.2
4
4
  Summary: Crystal structure container and parsers for structure formats.
5
5
  Author-email: "Simon J.L. Billinge group" <simon.billinge@gmail.com>
6
6
  Maintainer-email: "Simon J.L. Billinge group" <simon.billinge@gmail.com>
@@ -27,6 +27,8 @@ License-File: LICENSE.rst
27
27
  License-File: LICENSE_DANSE.rst
28
28
  License-File: LICENSE_pymmlib.rst
29
29
  License-File: AUTHORS.rst
30
+ Requires-Dist: numpy
31
+ Requires-Dist: pycifrw
30
32
 
31
33
  |Icon| |title|_
32
34
  ===============
@@ -45,8 +47,8 @@ License-File: AUTHORS.rst
45
47
  .. |Black| image:: https://img.shields.io/badge/code_style-black-black
46
48
  :target: https://github.com/psf/black
47
49
 
48
- .. |CI| image:: https://github.com/diffpy/diffpy.structure/actions/workflows/main.yml/badge.svg
49
- :target: https://github.com/diffpy/diffpy.structure/actions/workflows/main.yml
50
+ .. |CI| image:: https://github.com/diffpy/diffpy.structure/actions/workflows/matrix-and-codecov-on-merge-to-main.yml/badge.svg
51
+ :target: https://github.com/diffpy/diffpy.structure/actions/workflows/matrix-and-codecov-on-merge-to-main.yml
50
52
 
51
53
  .. |Codecov| image:: https://codecov.io/gh/diffpy/diffpy.structure/branch/main/graph/badge.svg
52
54
  :target: https://codecov.io/gh/diffpy/diffpy.structure
@@ -77,6 +79,7 @@ of symmetry constraints for atom positions and displacement parameters.
77
79
  diffpy.structure includes definitions of all space groups in over 500
78
80
  symmetry settings.
79
81
 
82
+
80
83
  For more information about the diffpy.structure library, please consult our `online documentation <https://diffpy.github.io/diffpy.structure>`_.
81
84
 
82
85
  Citation
@@ -116,11 +119,7 @@ Then, to fully install ``diffpy.structure`` in our active environment, run ::
116
119
 
117
120
  Another option is to use ``pip`` to download and install the latest release from
118
121
  `Python Package Index <https://pypi.python.org>`_.
119
- To install using ``pip`` into your ``diffpy.structure_env`` environment, we will also have to install dependencies ::
120
-
121
- pip install -r https://raw.githubusercontent.com/diffpy/diffpy.structure/main/requirements/run.txt
122
-
123
- and then install the package ::
122
+ To install using ``pip`` into your ``diffpy.structure_env`` environment, type ::
124
123
 
125
124
  pip install diffpy.structure
126
125
 
@@ -135,7 +134,7 @@ Support and Contribute
135
134
 
136
135
  `Diffpy user group <https://groups.google.com/g/diffpy-users>`_ is the discussion forum for general questions and discussions about the use of diffpy.structure. Please join the diffpy.structure users community by joining the Google group. The diffpy.structure project welcomes your expertise and enthusiasm!
137
136
 
138
- If you see a bug or want to request a feature, please `report it as an issue <https://github.com/diffpy/diffpy.structure/issues>`_ and/or `submit a fix as a PR <https://github.com/diffpy/diffpy.structure/pulls>`_. You can also post it to the `Diffpy user group <https://groups.google.com/g/diffpy-users>`_.
137
+ If you see a bug or want to request a feature, please `report it as an issue <https://github.com/diffpy/diffpy.structure/issues>`_ and/or `submit a fix as a PR <https://github.com/diffpy/diffpy.structure/pulls>`_. You can also post it to the `Diffpy user group <https://groups.google.com/g/diffpy-users>`_.
139
138
 
140
139
  Feel free to fork the project and contribute. To install diffpy.structure
141
140
  in a development mode, with its sources being directly used by Python
@@ -15,8 +15,8 @@
15
15
  .. |Black| image:: https://img.shields.io/badge/code_style-black-black
16
16
  :target: https://github.com/psf/black
17
17
 
18
- .. |CI| image:: https://github.com/diffpy/diffpy.structure/actions/workflows/main.yml/badge.svg
19
- :target: https://github.com/diffpy/diffpy.structure/actions/workflows/main.yml
18
+ .. |CI| image:: https://github.com/diffpy/diffpy.structure/actions/workflows/matrix-and-codecov-on-merge-to-main.yml/badge.svg
19
+ :target: https://github.com/diffpy/diffpy.structure/actions/workflows/matrix-and-codecov-on-merge-to-main.yml
20
20
 
21
21
  .. |Codecov| image:: https://codecov.io/gh/diffpy/diffpy.structure/branch/main/graph/badge.svg
22
22
  :target: https://codecov.io/gh/diffpy/diffpy.structure
@@ -47,6 +47,7 @@ of symmetry constraints for atom positions and displacement parameters.
47
47
  diffpy.structure includes definitions of all space groups in over 500
48
48
  symmetry settings.
49
49
 
50
+
50
51
  For more information about the diffpy.structure library, please consult our `online documentation <https://diffpy.github.io/diffpy.structure>`_.
51
52
 
52
53
  Citation
@@ -86,11 +87,7 @@ Then, to fully install ``diffpy.structure`` in our active environment, run ::
86
87
 
87
88
  Another option is to use ``pip`` to download and install the latest release from
88
89
  `Python Package Index <https://pypi.python.org>`_.
89
- To install using ``pip`` into your ``diffpy.structure_env`` environment, we will also have to install dependencies ::
90
-
91
- pip install -r https://raw.githubusercontent.com/diffpy/diffpy.structure/main/requirements/run.txt
92
-
93
- and then install the package ::
90
+ To install using ``pip`` into your ``diffpy.structure_env`` environment, type ::
94
91
 
95
92
  pip install diffpy.structure
96
93
 
@@ -105,7 +102,7 @@ Support and Contribute
105
102
 
106
103
  `Diffpy user group <https://groups.google.com/g/diffpy-users>`_ is the discussion forum for general questions and discussions about the use of diffpy.structure. Please join the diffpy.structure users community by joining the Google group. The diffpy.structure project welcomes your expertise and enthusiasm!
107
104
 
108
- If you see a bug or want to request a feature, please `report it as an issue <https://github.com/diffpy/diffpy.structure/issues>`_ and/or `submit a fix as a PR <https://github.com/diffpy/diffpy.structure/pulls>`_. You can also post it to the `Diffpy user group <https://groups.google.com/g/diffpy-users>`_.
105
+ If you see a bug or want to request a feature, please `report it as an issue <https://github.com/diffpy/diffpy.structure/issues>`_ and/or `submit a fix as a PR <https://github.com/diffpy/diffpy.structure/pulls>`_. You can also post it to the `Diffpy user group <https://groups.google.com/g/diffpy-users>`_.
109
106
 
110
107
  Feel free to fork the project and contribute. To install diffpy.structure
111
108
  in a development mode, with its sources being directly used by Python
@@ -1,10 +1,10 @@
1
1
  [build-system]
2
- requires = ["setuptools>=62.0", "setuptools-git-versioning<2"]
2
+ requires = ["setuptools>=62.0", "setuptools-git-versioning>=2.0"]
3
3
  build-backend = "setuptools.build_meta"
4
4
 
5
5
  [project]
6
6
  name = "diffpy.structure"
7
- dynamic=['version']
7
+ dynamic=['version', 'dependencies']
8
8
  authors = [
9
9
  { name="Simon J.L. Billinge group", email="simon.billinge@gmail.com" },
10
10
  ]
@@ -45,9 +45,12 @@ dirty_template = "{tag}"
45
45
  [tool.setuptools.packages.find]
46
46
  where = ["src"] # list of folders that contain the packages (["."] by default)
47
47
  include = ["*"] # package names should match these glob patterns (["*"] by default)
48
- exclude = ["diffpy.structure.tests*"] # exclude packages matching these glob patterns (empty by default)
48
+ exclude = [] # exclude packages matching these glob patterns (empty by default)
49
49
  namespaces = false # to disable scanning PEP 420 namespaces (true by default)
50
50
 
51
+ [tool.setuptools.dynamic]
52
+ dependencies = {file = ["requirements/pip.txt"]}
53
+
51
54
  [tool.black]
52
55
  line-length = 115
53
56
  include = '\.pyi?$'
File without changes
@@ -0,0 +1,2 @@
1
+ numpy
2
+ pycifrw
@@ -0,0 +1,4 @@
1
+ sphinx
2
+ sphinx_rtd_theme
3
+ doctr
4
+ m2r
@@ -0,0 +1,2 @@
1
+ numpy
2
+ pycifrw
@@ -0,0 +1,6 @@
1
+ flake8
2
+ pytest
3
+ codecov
4
+ coverage
5
+ pytest-cov
6
+ pytest-env
@@ -536,7 +536,7 @@ class _AtomCartesianCoordinates(numpy.ndarray):
536
536
  self._atom.xyz[:] = self._atom.lattice.fractional(self)
537
537
  return
538
538
 
539
- def __array_wrap__(self, out_arr, context=None):
539
+ def __array_wrap__(self, out_arr, context=None, return_scalar=None):
540
540
  """Ensure math operations on this type yield standard numpy array."""
541
541
  return out_arr.view(numpy.ndarray)
542
542
 
@@ -711,8 +711,9 @@ class Structure(list):
711
711
  element = _linkAtomAttribute(
712
712
  "element",
713
713
  """Character array of `Atom` types. Assignment updates
714
- the element attribute of the respective `Atoms`.""",
715
- toarray=numpy.char.array,
714
+ the element attribute of the respective `Atoms`.
715
+ Set the maximum length of the element string to 5 characters.""",
716
+ toarray=lambda items: numpy.char.array(items, itemsize=5),
716
717
  )
717
718
 
718
719
  xyz = _linkAtomAttribute(
@@ -742,8 +743,9 @@ class Structure(list):
742
743
  label = _linkAtomAttribute(
743
744
  "label",
744
745
  """Character array of `Atom` names. Assignment updates
745
- the label attribute of all `Atoms`.""",
746
- toarray=numpy.char.array,
746
+ the label attribute of all `Atoms`.
747
+ Set the maximum length of the label string to 5 characters.""",
748
+ toarray=lambda items: numpy.char.array(items, itemsize=5),
747
749
  )
748
750
 
749
751
  occupancy = _linkAtomAttribute(
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: diffpy.structure
3
- Version: 3.2.1rc0
3
+ Version: 3.2.2
4
4
  Summary: Crystal structure container and parsers for structure formats.
5
5
  Author-email: "Simon J.L. Billinge group" <simon.billinge@gmail.com>
6
6
  Maintainer-email: "Simon J.L. Billinge group" <simon.billinge@gmail.com>
@@ -27,6 +27,8 @@ License-File: LICENSE.rst
27
27
  License-File: LICENSE_DANSE.rst
28
28
  License-File: LICENSE_pymmlib.rst
29
29
  License-File: AUTHORS.rst
30
+ Requires-Dist: numpy
31
+ Requires-Dist: pycifrw
30
32
 
31
33
  |Icon| |title|_
32
34
  ===============
@@ -45,8 +47,8 @@ License-File: AUTHORS.rst
45
47
  .. |Black| image:: https://img.shields.io/badge/code_style-black-black
46
48
  :target: https://github.com/psf/black
47
49
 
48
- .. |CI| image:: https://github.com/diffpy/diffpy.structure/actions/workflows/main.yml/badge.svg
49
- :target: https://github.com/diffpy/diffpy.structure/actions/workflows/main.yml
50
+ .. |CI| image:: https://github.com/diffpy/diffpy.structure/actions/workflows/matrix-and-codecov-on-merge-to-main.yml/badge.svg
51
+ :target: https://github.com/diffpy/diffpy.structure/actions/workflows/matrix-and-codecov-on-merge-to-main.yml
50
52
 
51
53
  .. |Codecov| image:: https://codecov.io/gh/diffpy/diffpy.structure/branch/main/graph/badge.svg
52
54
  :target: https://codecov.io/gh/diffpy/diffpy.structure
@@ -77,6 +79,7 @@ of symmetry constraints for atom positions and displacement parameters.
77
79
  diffpy.structure includes definitions of all space groups in over 500
78
80
  symmetry settings.
79
81
 
82
+
80
83
  For more information about the diffpy.structure library, please consult our `online documentation <https://diffpy.github.io/diffpy.structure>`_.
81
84
 
82
85
  Citation
@@ -116,11 +119,7 @@ Then, to fully install ``diffpy.structure`` in our active environment, run ::
116
119
 
117
120
  Another option is to use ``pip`` to download and install the latest release from
118
121
  `Python Package Index <https://pypi.python.org>`_.
119
- To install using ``pip`` into your ``diffpy.structure_env`` environment, we will also have to install dependencies ::
120
-
121
- pip install -r https://raw.githubusercontent.com/diffpy/diffpy.structure/main/requirements/run.txt
122
-
123
- and then install the package ::
122
+ To install using ``pip`` into your ``diffpy.structure_env`` environment, type ::
124
123
 
125
124
  pip install diffpy.structure
126
125
 
@@ -135,7 +134,7 @@ Support and Contribute
135
134
 
136
135
  `Diffpy user group <https://groups.google.com/g/diffpy-users>`_ is the discussion forum for general questions and discussions about the use of diffpy.structure. Please join the diffpy.structure users community by joining the Google group. The diffpy.structure project welcomes your expertise and enthusiasm!
137
136
 
138
- If you see a bug or want to request a feature, please `report it as an issue <https://github.com/diffpy/diffpy.structure/issues>`_ and/or `submit a fix as a PR <https://github.com/diffpy/diffpy.structure/pulls>`_. You can also post it to the `Diffpy user group <https://groups.google.com/g/diffpy-users>`_.
137
+ If you see a bug or want to request a feature, please `report it as an issue <https://github.com/diffpy/diffpy.structure/issues>`_ and/or `submit a fix as a PR <https://github.com/diffpy/diffpy.structure/pulls>`_. You can also post it to the `Diffpy user group <https://groups.google.com/g/diffpy-users>`_.
139
138
 
140
139
  Feel free to fork the project and contribute. To install diffpy.structure
141
140
  in a development mode, with its sources being directly used by Python
@@ -5,11 +5,16 @@ LICENSE_pymmlib.rst
5
5
  MANIFEST.in
6
6
  README.rst
7
7
  pyproject.toml
8
- src/diffpy/Structure.py
8
+ requirements/build.txt
9
+ requirements/conda.txt
10
+ requirements/docs.txt
11
+ requirements/pip.txt
12
+ requirements/test.txt
9
13
  src/diffpy/__init__.py
10
14
  src/diffpy.structure.egg-info/PKG-INFO
11
15
  src/diffpy.structure.egg-info/SOURCES.txt
12
16
  src/diffpy.structure.egg-info/dependency_links.txt
17
+ src/diffpy.structure.egg-info/requires.txt
13
18
  src/diffpy.structure.egg-info/top_level.txt
14
19
  src/diffpy/structure/__init__.py
15
20
  src/diffpy/structure/_legacy_importer.py
@@ -42,4 +47,44 @@ src/diffpy/structure/parsers/p_rawxyz.py
42
47
  src/diffpy/structure/parsers/p_xcfg.py
43
48
  src/diffpy/structure/parsers/p_xyz.py
44
49
  src/diffpy/structure/parsers/parser_index_mod.py
45
- src/diffpy/structure/parsers/structureparser.py
50
+ src/diffpy/structure/parsers/structureparser.py
51
+ tests/conftest.py
52
+ tests/test_atom.py
53
+ tests/test_lattice.py
54
+ tests/test_loadstructure.py
55
+ tests/test_p_cif.py
56
+ tests/test_p_discus.py
57
+ tests/test_p_pdffit.py
58
+ tests/test_parsers.py
59
+ tests/test_spacegroups.py
60
+ tests/test_structure.py
61
+ tests/test_supercell.py
62
+ tests/test_symmetryutilities.py
63
+ tests/test_version.py
64
+ tests/testdata/BubbleRaftShort.xcfg
65
+ tests/testdata/CdSe_bulk.stru
66
+ tests/testdata/LiCl-bad.cif
67
+ tests/testdata/Ni-bad.stru
68
+ tests/testdata/Ni-discus.stru
69
+ tests/testdata/Ni.stru
70
+ tests/testdata/Ni_prim123.stru
71
+ tests/testdata/Ni_ref.cif
72
+ tests/testdata/PbTe.cif
73
+ tests/testdata/TeI-unkocc.cif
74
+ tests/testdata/TeI.cif
75
+ tests/testdata/ZnSb_RT_Q28X_VM_20_fxiso.rstr
76
+ tests/testdata/arginine.pdb
77
+ tests/testdata/badspacegroup.cif
78
+ tests/testdata/bucky-bad1.xyz
79
+ tests/testdata/bucky-bad2.xyz
80
+ tests/testdata/bucky-plain-bad.xyz
81
+ tests/testdata/bucky-plain.xyz
82
+ tests/testdata/bucky-raw.xyz
83
+ tests/testdata/bucky.xyz
84
+ tests/testdata/curlybrackets.cif
85
+ tests/testdata/customsg.cif
86
+ tests/testdata/graphite.cif
87
+ tests/testdata/hexagon-raw-bad.xyz
88
+ tests/testdata/hexagon-raw.xy
89
+ tests/testdata/hexagon-raw.xyz
90
+ tests/testdata/nosites.cif
@@ -0,0 +1,29 @@
1
+ import json
2
+ from pathlib import Path
3
+
4
+ import pytest
5
+
6
+
7
+ @pytest.fixture
8
+ def user_filesystem(tmp_path):
9
+ base_dir = Path(tmp_path)
10
+ home_dir = base_dir / "home_dir"
11
+ home_dir.mkdir(parents=True, exist_ok=True)
12
+ cwd_dir = base_dir / "cwd_dir"
13
+ cwd_dir.mkdir(parents=True, exist_ok=True)
14
+
15
+ home_config_data = {"username": "home_username", "email": "home@email.com"}
16
+ with open(home_dir / "diffpyconfig.json", "w") as f:
17
+ json.dump(home_config_data, f)
18
+
19
+ yield tmp_path
20
+
21
+
22
+ @pytest.fixture
23
+ def datafile():
24
+ """Fixture to dynamically load any test file."""
25
+
26
+ def _load(filename):
27
+ return "tests/testdata/" + filename
28
+
29
+ return _load
@@ -0,0 +1,155 @@
1
+ #!/usr/bin/env python
2
+ ##############################################################################
3
+ #
4
+ # diffpy.structure Complex Modeling Initiative
5
+ # (c) 2016 Brookhaven Science Associates,
6
+ # Brookhaven National Laboratory.
7
+ # All rights reserved.
8
+ #
9
+ # File coded by: Pavol Juhas
10
+ #
11
+ # See AUTHORS.txt for a list of people who contributed.
12
+ # See LICENSE.txt for license information.
13
+ #
14
+ ##############################################################################
15
+
16
+ """
17
+ Unit tests for the Atom class.
18
+ """
19
+
20
+
21
+ import unittest
22
+
23
+ import numpy
24
+
25
+ from diffpy.structure.atom import Atom
26
+ from diffpy.structure.lattice import Lattice
27
+
28
+ # ----------------------------------------------------------------------------
29
+
30
+
31
+ class TestAtom(unittest.TestCase):
32
+
33
+ def test___init__(self):
34
+ """check Atom.__init__()"""
35
+ a = Atom()
36
+ self.assertEqual("", a.element)
37
+ self.assertTrue((a.xyz == 0).all())
38
+ self.assertEqual("", a.label)
39
+ self.assertEqual(1.0, a.occupancy)
40
+ self.assertFalse(a.anisotropy)
41
+ self.assertTrue((a.U == 0).all())
42
+ self.assertTrue(a.lattice is None)
43
+ # check initialization with arguments
44
+ a1 = Atom("C", xyz=(1, 2, 3), Uisoequiv=0.005)
45
+ self.assertEqual("C", a1.element)
46
+ self.assertTrue(numpy.array_equal([1, 2, 3], a1.xyz))
47
+ self.assertFalse(a1.anisotropy)
48
+ self.assertEqual(0.005, a1.Uisoequiv)
49
+ # initialize with anisotropic displacement parameters
50
+ uani = numpy.identity(3, dtype=float) * numpy.array([1, 2, 3]) * 0.01
51
+ a2 = Atom("C", U=uani)
52
+ self.assertTrue(numpy.array_equal(uani, a2.U))
53
+ self.assertTrue(a2.anisotropy)
54
+ a3 = Atom("C", Uisoequiv=0.02, anisotropy=True)
55
+ self.assertTrue(a3.anisotropy)
56
+ self.assertEqual(a3.U[2, 2], 0.02)
57
+ self.assertRaises(ValueError, Atom, "C", Uisoequiv=0.02, U=uani)
58
+ return
59
+
60
+ # def test_msdLat(self):
61
+ # """check Atom.msdLat()
62
+ # """
63
+ # return
64
+ #
65
+ # def test_msdCart(self):
66
+ # """check Atom.msdCart()
67
+ # """
68
+ # return
69
+ #
70
+ # def test___repr__(self):
71
+ # """check Atom.__repr__()
72
+ # """
73
+ # return
74
+ #
75
+ # def test___copy__(self):
76
+ # """check Atom.__copy__()
77
+ # """
78
+ # return
79
+
80
+ def test_xyz_cartn(self):
81
+ """check Atom.xyz_cartn property"""
82
+ hexagonal = Lattice(1, 1, 1, 90, 90, 120)
83
+ a0 = Atom("C", [0, 0, 0], lattice=hexagonal)
84
+ a1 = Atom("C", [1, 1, 1], lattice=hexagonal)
85
+ self.assertTrue(all(a0.xyz_cartn == 0))
86
+ rc1 = numpy.array([0.75**0.5, 0.5, 1])
87
+ self.assertTrue(numpy.allclose(rc1, a1.xyz_cartn))
88
+ a1.xyz_cartn[2] = 0
89
+ self.assertTrue(numpy.allclose([1, 1, 0], a1.xyz))
90
+ a1.xyz_cartn[:2] = 0
91
+ self.assertTrue(all(a1.xyz == 0))
92
+ a3 = Atom("C", [1, 2, 3])
93
+ self.assertTrue(numpy.array_equal(a3.xyz, a3.xyz_cartn))
94
+ a3.xyz_cartn = 1.3
95
+ self.assertTrue(all(1.3 == a3.xyz_cartn))
96
+ self.assertTrue(all(1.3 == a3.xyz))
97
+ return
98
+
99
+
100
+ # def test__get_anisotropy(self):
101
+ # """check Atom._get_anisotropy()
102
+ # """
103
+ # return
104
+ #
105
+ # def test__set_anisotropy(self):
106
+ # """check Atom._set_anisotropy()
107
+ # """
108
+ # return
109
+ #
110
+ # def test__get_U(self):
111
+ # """check Atom._get_U()
112
+ # """
113
+ # return
114
+ #
115
+ # def test__set_U(self):
116
+ # """check Atom._set_U()
117
+ # """
118
+ # return
119
+ #
120
+ # def test__get_Uij(self):
121
+ # """check Atom._get_Uij()
122
+ # """
123
+ # return
124
+ #
125
+ # def test__set_Uij(self):
126
+ # """check Atom._set_Uij()
127
+ # """
128
+ # return
129
+ #
130
+ # def test__get_Uisoequiv(self):
131
+ # """check Atom._get_Uisoequiv()
132
+ # """
133
+ # return
134
+ #
135
+ # def test__set_Uisoequiv(self):
136
+ # """check Atom._set_Uisoequiv()
137
+ # """
138
+ # return
139
+ #
140
+ # def test__get_Bisoequiv(self):
141
+ # """check Atom._get_Bisoequiv()
142
+ # """
143
+ # return
144
+ #
145
+ # def test__set_Bisoequiv(self):
146
+ # """check Atom._set_Bisoequiv()
147
+ # """
148
+ # return
149
+
150
+ # End of class TestAtom
151
+
152
+ # ----------------------------------------------------------------------------
153
+
154
+ if __name__ == "__main__":
155
+ unittest.main()