Skip to content
Merged
10 changes: 0 additions & 10 deletions src/diffpy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,3 @@
# See LICENSE.rst for license information.
#
##############################################################################
"""diffpy - tools for structure analysis by diffraction.

Blank namespace package for module diffpy."""


from pkgutil import extend_path

__path__ = extend_path(__path__, __name__)

# End of file
17 changes: 11 additions & 6 deletions src/diffpy/pdffit2/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,22 @@
# File coded by: Billinge Group members and community contributors.
#
# See GitHub contributions for a more detailed list of contributors.
# https://github.com/diffpy/diffpy.pdffit2/graphs/contributors
# https://github.com/diffpy/diffpy.pdffit2/graphs/contributors # noqa: E501
#
# See LICENSE.rst for license information.
#
##############################################################################
"""Definition of __version__."""

# We do not use the other three variables, but can be added back if needed.
# __all__ = ["__date__", "__git_commit__", "__timestamp__", "__version__"]

import datetime
import json
import urllib.request
from importlib.metadata import version

# obtain version information
from importlib.metadata import PackageNotFoundError, version
from pathlib import Path


Expand Down Expand Up @@ -57,9 +62,9 @@ def get_pypi_release_date(package_name, timeout=5):
return str(release_date)


__version__ = version("diffpy.pdffit2")
__date__ = get_pypi_release_date("diffpy.pdffit2")

# End of file

# Release date: 2025-02-07
try:
__version__ = version("diffpy.pdffit2")
except PackageNotFoundError:
__version__ = "unknown"
3 changes: 2 additions & 1 deletion tests/test_exceptions.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,8 @@

import pytest

from diffpy.pdffit2 import PdfFit, pdffit2
from diffpy.pdffit2 import pdffit2
from diffpy.pdffit2.pdffit import PdfFit


class read_structExceptions(unittest.TestCase):
Expand Down
3 changes: 2 additions & 1 deletion tests/test_pdffit.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@

import pytest

from diffpy.pdffit2 import PdfFit, pdffit2
from diffpy.pdffit2 import pdffit2
from diffpy.pdffit2.pdffit import PdfFit
from diffpy.structure import loadStructure

# ----------------------------------------------------------------------------
Expand Down
2 changes: 1 addition & 1 deletion tests/test_phase_fractions.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

import pytest

from diffpy.pdffit2 import PdfFit
from diffpy.pdffit2.pdffit import PdfFit


##############################################################################
Expand Down
3 changes: 2 additions & 1 deletion tests/test_shape_factors.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
import numpy
import pytest

from diffpy.pdffit2 import PdfFit, pdffit2
from diffpy.pdffit2 import pdffit2
from diffpy.pdffit2.pdffit import PdfFit


def spherefactor(r, d):
Expand Down
Loading