Skip to content

Commit 5cef9b1

Browse files
authored
Merge pull request #83 from diffpy/cookie
Cookie
2 parents aff9b35 + c54e503 commit 5cef9b1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+1844
-1036
lines changed

Diff for: CHANGELOG.rst

-17
Original file line numberDiff line numberDiff line change
@@ -4,23 +4,6 @@ Release Notes
44

55
.. current developments
66
7-
Version 3.2.0 - 2024-7-2
8-
--------------------------
9-
**Added:**
10-
11-
**Changed:**
12-
13-
**Deprecated:**
14-
15-
**Removed:**
16-
17-
**Fixed:**
18-
19-
- Repo structure modified to the new diffpy standard
20-
21-
**Security:**
22-
23-
247
Version 3.1.0 - 2022-12-04
258
--------------------------
269

Diff for: README.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ by citing the following paper in your publication:
6666
Requirements
6767
------------------------------------------------------------------------
6868

69-
The diffpy.structure package requires Python 3.7 or later or 2.7 and
69+
The diffpy.structure package requires Python 3.7 or later and
7070
the following software:
7171

7272
* ``setuptools`` - software distribution tools for Python

Diff for: doc/source/api/diffpy.structure.applications.rst

-28
This file was deleted.

Diff for: doc/source/api/diffpy.structure.rst

-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,6 @@ Subpackages
1616

1717
diffpy.structure.parsers
1818
diffpy.structure.expansion
19-
diffpy.structure.applications
2019
diffpy.structure.apps
2120

2221
Submodules

Diff for: doc/source/conf.py

+12
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,8 @@
4848
"m2r",
4949
]
5050

51+
autodoc_member_order = "groupwise"
52+
5153
# Add any paths that contain templates here, relative to this directory.
5254
templates_path = ["_templates"]
5355

@@ -118,6 +120,12 @@
118120
# Display all warnings for missing links.
119121
nitpicky = True
120122

123+
nitpick_ignore = [
124+
("py:class", "array_like"),
125+
("py:class", "Parser"),
126+
("py:class", "CifFile"),
127+
]
128+
121129
# -- Options for HTML output ----------------------------------------------
122130

123131
# The theme to use for HTML and HTML Help pages. See the documentation for
@@ -289,3 +297,7 @@
289297

290298
# Example configuration for intersphinx: refer to the Python standard library.
291299
# intersphinx_mapping = {'http://docs.python.org/': None}
300+
intersphinx_mapping = {
301+
"python": ("https://docs.python.org/3", None),
302+
"numpy": ("https://numpy.org/doc/stable/", None),
303+
}

Diff for: news/changlog.rst

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
**Added:**
2+
3+
* <news item>
4+
5+
**Changed:**
6+
7+
* All docstrings style updated to numpydoc.
8+
9+
**Deprecated:**
10+
11+
* Deprecated the `diffpy.structure.applications` module. Use
12+
`diffpy.structure.apps` instead.
13+
14+
**Removed:**
15+
16+
* Removed all `six` compatibility code. The package is now going to
17+
Python > 3.10.
18+
19+
**Fixed:**
20+
21+
* Repo structure modified to the new diffpy standard.
22+
23+
**Security:**
24+
25+
* <news item>

Diff for: requirements/run.txt

-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
numpy < 2.0.0 # Need to fix deprecations before 2.0.0 compat
22
pycifrw
3-
six

Diff for: src/diffpy/Structure.py

+4-3
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,13 @@
1313
#
1414
##############################################################################
1515

16-
"""
17-
Support import of old camel-case module names with DeprecationWarning.
16+
"""Support import of old camel-case module names with `DeprecationWarning`.
1817
1918
The imported camel-case modules are aliases for the current module
20-
instances. Their `__name__` attributes are thus all in lower-case.
19+
instances. Their `__name__` attributes are thus all in lower-case.
2120
21+
Warning
22+
-------
2223
This module is deprecated and will be removed in the future.
2324
"""
2425

Diff for: src/diffpy/structure/__init__.py

+24-17
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,26 @@
1313
#
1414
##############################################################################
1515

16-
"""classes related to structure of materials
17-
Classes:
18-
Atom
19-
Lattice
20-
Structure
21-
PDFFitStructure
16+
"""
17+
Crystal structure container and parsers for structure formats.
18+
19+
Classes related to the structure of materials:
20+
* Atom
21+
* Lattice
22+
* Structure
23+
* PDFFitStructure
24+
25+
Other classes:
26+
* SpaceGroup
27+
* SymOp
28+
* ExpandAsymmetricUnit
29+
* GeneratorSite
30+
* SymmetryConstraints
31+
2232
Exceptions:
23-
StructureFormatError
24-
LatticeError
25-
SymmetryError
33+
* StructureFormatError
34+
* LatticeError
35+
* SymmetryError
2636
"""
2737

2838
# Interface definitions ------------------------------------------------------
@@ -37,27 +47,24 @@
3747
# package version
3848
from diffpy.structure.version import __version__
3949

40-
"""Crystal structure container and parsers for structure formats."""
41-
4250
# top level routines
4351

4452

4553
def loadStructure(filename, fmt="auto", **kw):
46-
"""
47-
Load new structure object from the specified file.
54+
"""Load new structure object from the specified file.
4855
4956
Parameters
5057
----------
5158
5259
filename : str
5360
Path to the file to be loaded.
54-
fmt : str, optional
55-
Format of the structure file such as 'cif' or 'xyz'. Must be
61+
fmt : str, Optional
62+
Format of the structure file such as 'cif' or 'xyz'. Must be
5663
one of the formats listed by the `parsers.inputFormats` function.
5764
When 'auto', all supported formats are tried in a sequence.
58-
kw : misc, optional
65+
kw : Optional
5966
Extra keyword arguments that are passed to `parsers.getParser`
60-
function. These configure the dedicated Parser object that
67+
function. These configure the dedicated Parser object that
6168
is used to read content in filename.
6269
6370
Returns

Diff for: src/diffpy/structure/_legacy_importer.py

+10-40
Original file line numberDiff line numberDiff line change
@@ -17,33 +17,23 @@
1717
Support import of old camel-case module names with DeprecationWarning.
1818
1919
The imported camel-case modules are aliases for the current module
20-
instances. Their `__name__` attributes are thus all in lower-case.
20+
instances. Their `__name__` attributes are thus all in lower-case.
2121
22-
This module is deprecated and will be removed in the future.
22+
Note
23+
----
24+
this module must be only imported from `diffpy.Structure`.
2325
24-
NOTE: this module must be only imported from `diffpy.Structure`.
26+
Warning
27+
-------
28+
This module is deprecated and will be removed in the future.
2529
"""
2630

2731

32+
import importlib.abc
2833
import sys
2934
from warnings import warn
3035

31-
import six
32-
33-
if six.PY2:
34-
import importlib
35-
36-
class mock_importlib_abc(object):
37-
MetaPathFinder = object
38-
Loader = object
39-
40-
importlib.abc = mock_importlib_abc
41-
sys.modules.setdefault("importlib.abc", mock_importlib_abc)
42-
del mock_importlib_abc
43-
44-
import importlib.abc
45-
46-
WMSG = "Module {!r} is deprecated. Use {!r} instead."
36+
WMSG = "Module {!r} is deprecated. Use {!r} instead."
4737

4838
# ----------------------------------------------------------------------------
4939

@@ -63,25 +53,14 @@ def find_spec(self, fullname, path=None, target=None):
6353
spec.loader = MapRenamedStructureModule()
6454
return spec
6555

66-
if six.PY2:
67-
68-
def find_module(self, fullname, path):
69-
# only handle submodules of diffpy.Structure
70-
loader = None
71-
if fullname.startswith(self.prefix):
72-
loader = MapRenamedStructureModule()
73-
return loader
74-
7556

7657
# end of class FindRenamedStructureModule
7758

7859
# ----------------------------------------------------------------------------
7960

8061

8162
class MapRenamedStructureModule(importlib.abc.Loader):
82-
"""
83-
Loader for old camel-case module names.
84-
63+
"""Loader for old camel-case module names.
8564
Import the current module and alias it under the old name.
8665
"""
8766

@@ -95,15 +74,6 @@ def create_module(self, spec):
9574
def exec_module(self, module):
9675
return
9776

98-
if six.PY2:
99-
from collections import namedtuple
100-
101-
ModuleSpec = namedtuple("ModuleSpec", "name")
102-
103-
def load_module(self, fullname):
104-
spec = self.ModuleSpec(fullname)
105-
return self.create_module(spec)
106-
10777

10878
# end of class MapRenamedStructureModule
10979

Diff for: src/diffpy/structure/applications/__init__.py

-30
This file was deleted.

Diff for: src/diffpy/structure/applications/anyeye.py

-14
This file was deleted.

Diff for: src/diffpy/structure/applications/transtru.py

-14
This file was deleted.

Diff for: src/diffpy/structure/apps/__init__.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,5 +13,5 @@
1313
#
1414
##############################################################################
1515

16-
"""Script applications that use the diffpy.structure package.
16+
"""Script applications that use the `diffpy.structure` package.
1717
"""

0 commit comments

Comments
 (0)