From e286ea6e8609f5a9cddac2204a8374c7d18ac52e Mon Sep 17 00:00:00 2001 From: Caden Myers Date: Thu, 1 Aug 2024 12:08:55 -0400 Subject: [PATCH 01/23] remove setup.py --- setup.py | 161 ------------------------------------------------------- 1 file changed, 161 deletions(-) delete mode 100755 setup.py diff --git a/setup.py b/setup.py deleted file mode 100755 index 1738fd08..00000000 --- a/setup.py +++ /dev/null @@ -1,161 +0,0 @@ -#!/usr/bin/env python - -# Installation script for diffpy.pdfgui - -"""PDFgui - graphical user interface for real space structure refinement. - -Packages: diffpy.pdfgui -Scripts: pdfgui -""" - -import os -import re -import sys - -from setuptools import find_packages, setup - -# Use this version when git data are not available, like in git zip archive. -# Update when tagging a new release. -FALLBACK_VERSION = "2.0.4" - -# determine if we run with Python 3. -PY3 = sys.version_info[0] == 3 - -# versioncfgfile holds version data for git commit hash and date. -# It must reside in the same directory as version.py. -MYDIR = os.path.dirname(os.path.abspath(__file__)) -versioncfgfile = os.path.join(MYDIR, "src/diffpy/pdfgui/version.cfg") -gitarchivecfgfile = os.path.join(MYDIR, ".gitarchive.cfg") - - -def gitinfo(): - from subprocess import PIPE, Popen - - kw = dict(stdout=PIPE, cwd=MYDIR, universal_newlines=True) - proc = Popen(["git", "describe", "--tags", "--match=v[[:digit:]]*"], **kw) - desc = proc.stdout.read() - proc = Popen(["git", "log", "-1", "--format=%H %ct %ci"], **kw) - glog = proc.stdout.read() - rv = {} - rv["version"] = ".post".join(desc.strip().split("-")[:2]).lstrip("v") - rv["commit"], rv["timestamp"], rv["date"] = glog.strip().split(None, 2) - return rv - - -def getversioncfg(): - if PY3: - from configparser import RawConfigParser - else: - from ConfigParser import RawConfigParser - vd0 = dict(version=FALLBACK_VERSION, commit="", date="", timestamp=0) - # first fetch data from gitarchivecfgfile, ignore if it is unexpanded - g = vd0.copy() - cp0 = RawConfigParser(vd0) - cp0.read(gitarchivecfgfile) - if len(cp0.get("DEFAULT", "commit")) > 20: - g = cp0.defaults() - mx = re.search(r"\btag: v(\d[^,]*)", g.pop("refnames")) - if mx: - g["version"] = mx.group(1) - # then try to obtain version data from git. - gitdir = os.path.join(MYDIR, ".git") - if os.path.exists(gitdir) or "GIT_DIR" in os.environ: - try: - g = gitinfo() - except OSError: - pass - # finally, check and update the active version file - cp = RawConfigParser() - cp.read(versioncfgfile) - d = cp.defaults() - rewrite = not d or (g["commit"] and (g["version"] != d.get("version") or g["commit"] != d.get("commit"))) - if rewrite: - cp.set("DEFAULT", "version", g["version"]) - cp.set("DEFAULT", "commit", g["commit"]) - cp.set("DEFAULT", "date", g["date"]) - cp.set("DEFAULT", "timestamp", g["timestamp"]) - with open(versioncfgfile, "w") as fp: - cp.write(fp) - return cp - - -versiondata = getversioncfg() - - -def dirglob(d, *patterns): - from glob import glob - - rv = [] - for p in patterns: - rv += glob(os.path.join(d, p)) - return rv - - -with open(os.path.join(MYDIR, "README.rst")) as fp: - long_description = fp.read() - -# define distribution -setup_args = dict( - name="diffpy.pdfgui", - version="3.0.5", - packages=find_packages(os.path.join(MYDIR, "src")), - package_dir={"": "src"}, - include_package_data=True, - test_suite="diffpy.pdfgui.tests", - entry_points={ - "gui_scripts": [ - "pdfgui=diffpy.pdfgui.applications.pdfgui:main", - ], - }, - data_files=[ - ("icons", dirglob("icons", "*.png", "*.ico")), - ("doc", dirglob("doc", "*.pdf")), - ("doc/manual", dirglob("doc/manual", "*.html", "*.pdf")), - ("doc/manual/images", dirglob("doc/manual/images", "*.png")), - ("doc/tutorial", dirglob("doc/tutorial", "*")), - ], - # manual and tutorial files should not be zipped - zip_safe=False, - install_requires=[ - "six", - "diffpy.structure>=3", - "diffpy.pdffit2", - "diffpy.utils", - ], - author="Simon J.L. Billinge", - author_email="sb2896@columbia.edu", - maintainer="Pavol Juhas", - maintainer_email="pavol.juhas@gmail.com", - url="https://github.com/diffpy/diffpy.pdfgui", - description="GUI for PDF simulation and structure refinement.", - long_description=long_description, - long_description_content_type="text/x-rst", - license="BSD", - keywords="PDF structure refinement GUI", - classifiers=[ - # List of possible values at - # http://pypi.python.org/pypi?:action=list_classifiers - "Development Status :: 5 - Production/Stable", - "Environment :: MacOS X", - "Environment :: Win32 (MS Windows)", - "Environment :: X11 Applications", - "Intended Audience :: Science/Research", - "License :: OSI Approved :: BSD License", - "Operating System :: MacOS", - "Operating System :: Microsoft :: Windows", - "Operating System :: POSIX", - "Programming Language :: Python :: 2.7", - "Programming Language :: Python :: 3.7", - "Programming Language :: Python :: 3.8", - "Programming Language :: Python :: 3.9", - "Programming Language :: Python :: 3.10", - "Programming Language :: Python :: 3.10", - "Topic :: Scientific/Engineering :: Chemistry", - "Topic :: Scientific/Engineering :: Physics", - ], -) - -if __name__ == "__main__": - setup(**setup_args) - -# End of file From 323c58f4c82fb0547ed8b8de96a5b9866105a9fc Mon Sep 17 00:00:00 2001 From: Caden Myers Date: Thu, 1 Aug 2024 12:19:07 -0400 Subject: [PATCH 02/23] .codecov.yml, .coveragerc, .gitattributes, .gitignore --- .codecov.yml | 36 ++++++++++++++++++-- .coveragerc | 31 +++++++----------- .gitattributes | 8 +---- .gitignore | 89 ++++++++++++++++++++++++++++++++++++++++---------- 4 files changed, 118 insertions(+), 46 deletions(-) diff --git a/.codecov.yml b/.codecov.yml index 86671410..04dd6510 100644 --- a/.codecov.yml +++ b/.codecov.yml @@ -1,2 +1,34 @@ -fixes: - - ".*/site-packages/::src/" +# codecov can find this file anywhere in the repo, so we don't need to clutter +# the root folder. +#comment: false + +codecov: + notify: + require_ci_to_pass: no + +coverage: + status: + patch: + default: + target: '70' + if_no_uploads: error + if_not_found: success + if_ci_failed: failure + project: + default: false + library: + target: auto + if_no_uploads: error + if_not_found: success + if_ci_failed: error + paths: '!*/tests/.*' + + tests: + target: 97.9% + paths: '*/tests/.*' + if_not_found: success + +flags: + tests: + paths: + - tests/ diff --git a/.coveragerc b/.coveragerc index 63f0ec9c..77556cdf 100644 --- a/.coveragerc +++ b/.coveragerc @@ -1,22 +1,13 @@ -# Configuration of the coverage.py tool for reporting test coverage. - -[report] -# RE patterns for lines to be excluded from consideration. -exclude_lines = - # Have to re-enable the standard pragma - pragma: no cover - # Don't complain if tests don't hit defensive assertion code: - raise AssertionError - raise NotImplementedError - ^[ ]*assert False - - # Don't complain if non-runnable code isn't run: - ^[ ]*@unittest.skip\b - ^[ ]{4}unittest.main() - if __name__ == .__main__.: - - [run] +source = + diffpy.pdfgui +[report] omit = - # exclude debug.py from codecov report - */tests/debug.py + */python?.?/* + */site-packages/nose/* + # ignore _version.py and versioneer.py + .*version.* + *_version.py + +exclude_lines = + if __name__ == '__main__': diff --git a/.gitattributes b/.gitattributes index 9d58a8cd..0caa8f9f 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,7 +1 @@ -/.gitattributes export-ignore -/.gitignore export-ignore -/.travis.yml export-ignore -/conda-recipe/ export-ignore -/devutils export-ignore -.gitarchive.cfg export-subst -*.bat text eol=crlf +diffpy.pdfgui/_version.py export-subst diff --git a/.gitignore b/.gitignore index b1f18e26..a25212ea 100644 --- a/.gitignore +++ b/.gitignore @@ -1,44 +1,99 @@ +# Byte-compiled / optimized / DLL files +__pycache__/ *.py[cod] +*$py.class # C extensions *.so -# Packages -*.egg -*.egg-info -dist -build -eggs -parts -bin -var -sdist -temp -develop-eggs +# Distribution / packaging +.Python +env/ +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +venv/ +*.egg-info/ .installed.cfg -lib -lib64 -tags +*.egg +bin/ +temp/ +tags/ errors.err -.idea + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec # Installer logs pip-log.txt +pip-delete-this-directory.txt MANIFEST # Unit test / coverage reports +htmlcov/ +.tox/ .coverage -.tox +.coverage.* +.cache nosetests.xml +coverage.xml +*,cover +.hypothesis/ # Translations *.mo +*.pot # Mr Developer .mr.developer.cfg .project .pydevproject +# Django stuff: +*.log + +# Sphinx documentation +docs/build/ +docs/source/generated/ + +# pytest +.pytest_cache/ + +# PyBuilder +target/ + +# Editor files +# mac +.DS_Store +*~ + +# vim +*.swp +*.swo + +# pycharm +.idea/ + +# VSCode +.vscode/ + +# Ipython Notebook +.ipynb_checkpoints + # version information setup.cfg /src/diffpy/*/version.cfg + +# Rever +rever/ From ce7ad1bf7258dd17c926afbbe4d6d448fa515582 Mon Sep 17 00:00:00 2001 From: Caden Myers Date: Thu, 1 Aug 2024 12:34:48 -0400 Subject: [PATCH 03/23] CHANGELOG.rst, MANIFEST.in, pyproject.toml --- CHANGELOG.rst | 6 +++--- MANIFEST.in | 33 ++++++++++++--------------------- pyproject.toml | 50 ++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 65 insertions(+), 24 deletions(-) diff --git a/CHANGELOG.rst b/CHANGELOG.rst index fc5d6241..4280491e 100644 --- a/CHANGELOG.rst +++ b/CHANGELOG.rst @@ -1,6 +1,6 @@ -========================= -Diffpy.pdfgui Change Log -========================= +============= +Release Notes +============= .. current developments diff --git a/MANIFEST.in b/MANIFEST.in index ddcda5e8..85df1efd 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,23 +1,14 @@ -recursive-include src * -recursive-exclude src *.py[co] -include AUTHORS.txt LICENSE*.txt README* -recursive-include doc * -prune doc/epydoc -prune doc/manual/images/originals -exclude doc/manual/images/*.pdf -recursive-exclude doc/manual Makefile *.py *.texinfo -recursive-exclude doc/manual *.aux *.cp *.cps *.err *.log *.toc *.vr *.vrs -recursive-include icons *.png *.ico -recursive-exclude icons *.m *.xcf -global-exclude .gitattributes .gitignore .gitarchive.cfg -global-exclude .DS_Store +include AUTHORS.rst +include LICENSE +include README.rst +include requirements.txt -# Avoid user content in setup.cfg to make distribution reproducible. -exclude setup.cfg +recursive-exclude * __pycache__ +recursive-exclude * *.py[co] -# Exclude git-tracked files spuriously added by setuptools_scm -exclude .coveragerc -exclude .travis* -prune conda-recipe -prune devutils -#prune doc +recursive-include docs *.rst conf.py Makefile make.bat + +include diffpy.pdfgui/version.py + +# If including data files in the package, add them like: +# include path/to/data_file diff --git a/pyproject.toml b/pyproject.toml index e537e24a..35921cdb 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,3 +1,53 @@ +[build-system] +requires = ["setuptools>=62.0", "setuptools-git-versioning<2"] +build-backend = "setuptools.build_meta" + +[project] +name = "diffpy.pdfgui" +dynamic=['version'] +authors = [ + { name="Simon J.L. Billinge group", email="simon.billinge@gmail.com" }, +] +maintainers = [ + { name="Simon J.L. Billinge group", email="simon.billinge@gmail.com" }, +] +description = "GUI for PDF simulation and structure refinement." +keywords = ['PDF structure refinement GUI'] +readme = "README.rst" +requires-python = ">=3.10" +classifiers = [ + 'Development Status :: 5 - Production/Stable', + 'Environment :: Console', + 'Intended Audience :: Developers', + 'Intended Audience :: Science/Research', + 'License :: OSI Approved :: BSD License', + 'Operating System :: MacOS :: MacOS X', + 'Operating System :: Microsoft :: Windows', + 'Operating System :: POSIX', + 'Operating System :: Unix', + 'Programming Language :: Python :: 3.10', + 'Programming Language :: Python :: 3.11', + 'Programming Language :: Python :: 3.12', + 'Topic :: Scientific/Engineering :: Physics', + 'Topic :: Scientific/Engineering :: Chemistry', +] + +[project.urls] +Homepage = "https://github.com/diffpy/diffpy.pdfgui/" +Issues = "https://github.com/diffpy/diffpy.pdfgui/issues/" + +[tool.setuptools-git-versioning] +enabled = true +template = "{tag}" +dev_template = "{tag}" +dirty_template = "{tag}" + +[tool.setuptools.packages.find] +where = ["src"] # list of folders that contain the packages (["."] by default) +include = ["*"] # package names should match these glob patterns (["*"] by default) +exclude = ["diffpy.pdfgui.tests*"] # exclude packages matching these glob patterns (empty by default) +namespaces = false # to disable scanning PEP 420 namespaces (true by default) + [tool.black] line-length = 115 include = '\.pyi?$' From 368cfbf9748099b3d46c6bf522222200223011d5 Mon Sep 17 00:00:00 2001 From: Caden Myers Date: Thu, 1 Aug 2024 12:35:20 -0400 Subject: [PATCH 04/23] README.rst --- README.rst | 179 ++++++++++++++++++++++++----------------------------- 1 file changed, 82 insertions(+), 97 deletions(-) diff --git a/README.rst b/README.rst index bb30e2e4..7dfe9731 100644 --- a/README.rst +++ b/README.rst @@ -1,143 +1,128 @@ -.. image:: https://travis-ci.org/diffpy/diffpy.pdfgui.svg?branch=master - :target: https://travis-ci.org/diffpy/diffpy.pdfgui +|Icon| |title|_ +=============== -.. image:: https://codecov.io/gh/diffpy/diffpy.pdfgui/branch/master/graph/badge.svg - :target: https://codecov.io/gh/diffpy/diffpy.pdfgui +.. |title| replace:: diffpy.pdfgui +.. _title: https://diffpy.github.io/diffpy.pdfgui +.. |Icon| image:: https://avatars.githubusercontent.com/diffpy + :target: https://diffpy.github.io/diffpy.pdfgui + :height: 100px -PDFgui -======================================================================== +|PyPi| |Forge| |PythonVersion| |PR| -Graphical user interface program for structure refinements to atomic -pair distribution function. +|CI| |Codecov| |Black| |Tracking| -PDFgui is a friendly interface to the PDFfit2 refinement engine, with many -powerful extensions. To get started, please open the manual from the -help menu and follow the tutorial instructions. A detailed description -is available in the doc/Farrow-jpcm-2007.pdf paper. +.. |Black| image:: https://img.shields.io/badge/code_style-black-black + :target: https://github.com/psf/black +.. |CI| image:: https://github.com/diffpy/diffpy.pdfgui/actions/workflows/main.yml/badge.svg + :target: https://github.com/diffpy/diffpy.pdfgui/actions/workflows/main.yml -REQUIREMENTS ------------------------------------------------------------------------- +.. |Codecov| image:: https://codecov.io/gh/diffpy/diffpy.pdfgui/branch/main/graph/badge.svg + :target: https://codecov.io/gh/diffpy/diffpy.pdfgui -PDFgui requires Python 3.8+ or 2.7 and several third-party -libraries that are used by PDFgui and its components. +.. |Forge| image:: https://img.shields.io/conda/vn/conda-forge/diffpy.pdfgui + :target: https://anaconda.org/conda-forge/diffpy.pdfgui -* setuptools - tools for installing Python packages -* wxpython - graphical user interface toolkit for Python -* numpy - library for scientific computing with Python -* matplotlib - Python 2D plotting library -* diffpy.pdffit2 - computational engine for PDFgui, - https://github.com/diffpy/diffpy.pdffit2 -* diffpy.structure - simple storage and manipulation of atomic - structures, https://github.com/diffpy/diffpy.structure -* diffpy.utils - shared helper utilities for wx GUI, - https://github.com/diffpy/diffpy.utils +.. |PR| image:: https://img.shields.io/badge/PR-Welcome-29ab47ff -We recommend to use `Anaconda Python `_ -which allows to conveniently install PDFgui and all its software -dependencies with a single command. +.. |PyPi| image:: https://img.shields.io/pypi/v/diffpy.pdfgui + :target: https://pypi.org/project/diffpy.pdfgui/ -Please note that the Python3 PDFgui will read .ddp3 files. It is also -possible for it to read .ddp files that were saved by the Python2 PDFgui -but it will sometimes fail to read these. We are working on a solution -that will be available in a future version. +.. |PythonVersion| image:: https://img.shields.io/pypi/pyversions/diffpy.pdfgui + :target: https://pypi.org/project/diffpy.pdfgui/ -INSTALLATION ------------------------------------------------------------------------- +.. |Tracking| image:: https://img.shields.io/badge/issue_tracking-github-blue + :target: https://github.com/diffpy/diffpy.pdfgui/issues -The preferred method is to use Anaconda Python and install from the -"conda-forge" channel of Anaconda packages. `pdfgui` can be installed with `conda` :: +diffpy.pdfgui +======================================================================== - conda install -c conda-forge diffpy.pdfgui +Graphical user interface program for structure refinements to atomic +pair distribution function. -PDFgui can be then started from a terminal ("Anaconda Prompt" on -Windows) by executing the "pdfgui" program. An alternative -method on Windows is to start PDFgui through the DiffPy start menu. +PDFgui is a friendly interface to the PDFfit2 refinement engine, with many +powerful extensions. To get started, please open the manual from the +help menu and follow the tutorial instructions. A detailed description +is available in the doc/Farrow-jpcm-2007.pdf paper. -If you don't use Anaconda or prefer to install from sources, make -sure the required software is all in place :: +For more information about the diffpy.pdfgui library, please consult our `online documentation `_. - conda install -c conda-forge diffpy.utils diffpy.pdffit2 matplotlib wxpython +Citation +-------- -Then you are ready to install diffpy.pdfgui from source codes:: +If you use diffpy.pdfgui in a scientific publication, we would like you to cite this package as - python setup.py install + diffpy.pdfgui Package, https://github.com/diffpy/diffpy.pdfgui -By default the files are installed to standard system directories, -which may require the use of ``sudo`` for write privileges. If -administrator (root) access is not available, see the output from -``python setup.py install --help`` for options to install as a regular -user to user-writable locations. Note that installation to non-standard -directories may require adjustments to the PATH and PYTHONPATH -environment variables. The installation integrity can be verified by -changing to the HOME directory and running :: +Installation +------------ - python -m diffpy.pdfgui.tests.rundeps +The preferred method is to use `Miniconda Python +`_ +and install from the "conda-forge" channel of Conda packages. -To use PDFgui, you can simply type `pdfgui`, or run the following command :: +To add "conda-forge" to the conda channels, run the following in a terminal. :: - python diffpy.pdfgui/src/diffpy/pdfgui/application/pdfgui.py + conda config --add channels conda-forge -If it shows some error like "This program needs access to the screen.". For Mac, you could install `python.app` from conda -(`conda install python.app`), then run as follows :: +We want to install our packages in a suitable conda environment. +The following creates and activates a new environment named ``diffpy.pdfgui_env`` :: - python.app diffpy.pdfgui/src/diffpy/pdfgui/application/pdfgui.py + conda create -n diffpy.pdfgui_env python=3 + conda activate diffpy.pdfgui_env -With Anaconda PDFgui can be later upgraded to the latest released -version using :: +Then, to fully install ``diffpy.pdfgui`` in our active environment, run :: - conda update -c conda-forge diffpy.pdfgui + conda install diffpy.pdfgui -With other Python distributions the program can be upgraded to -the latest version as follows :: +Another option is to use ``pip`` to download and install the latest release from +`Python Package Index `_. +To install using ``pip`` into your ``diffpy.pdfgui_env`` environment, we will also have to install dependencies :: - easy_install --upgrade diffpy.pdfgui + pip install -r https://raw.githubusercontent.com/diffpy/diffpy.pdfgui/main/requirements/run.txt -If you would like to use other Python distributions except Anaconda, -it is necessary to install the required software separately. As an -example, on Ubuntu Linux some of the required software can be -installed using :: +and then install the package :: - sudo apt-get install \ - python-setuptools python-wxtools python-numpy \ - python-matplotlib + pip install diffpy.pdfgui -To install the remaining packages see the installation instructions -at their respective web pages. +If you prefer to install from sources, after installing the dependencies, obtain the source archive from +`GitHub `_. Once installed, ``cd`` into your ``diffpy.pdfgui`` directory +and run the following :: -Other software -```````````````````````````````````````````````````````````````````````` + pip install . -PDFgui can use an external structure viewer for displaying analyzed -structures. We have tested with several structure viewers such as +Support and Contribute +---------------------- -* AtomEye, http://li.mit.edu/A/Graphics/A/ -* PyMol, https://www.pymol.org -* VESTA, http://jp-minerals.org/vesta/en/ +`Diffpy user group `_ is the discussion forum for general questions and discussions about the use of diffpy.pdfgui. Please join the diffpy.pdfgui users community by joining the Google group. The diffpy.pdfgui project welcomes your expertise and enthusiasm! -Other viewers should work as well, as long as they understand one of -the output structure formats supported by PDFgui. +If you see a bug or want to request a feature, please `report it as an issue `_ and/or `submit a fix as a PR `_. You can also post it to the `Diffpy user group `_. +Feel free to fork the project and contribute. To install diffpy.pdfgui +in a development mode, with its sources being directly used by Python +rather than copied to a package directory, use the following in the root +directory :: -DEVELOPMENT ------------------------------------------------------------------------- + pip install -e . -PDFgui is an open-source software available in a git repository at -https://github.com/diffpy/diffpy.pdfgui. +To ensure code quality and to prevent accidental commits into the default branch, please set up the use of our pre-commit +hooks. -Feel free to fork the project and contribute. To install PDFgui -in a development mode where the source files are used directly -rather than copied to a system directory, use :: +1. Install pre-commit in your working environment by running ``conda install pre-commit``. - python setup.py develop --user +2. Initialize pre-commit (one time only) ``pre-commit install``. +Thereafter your code will be linted by black and isort and checked against flake8 before you can commit. +If it fails by black or isort, just rerun and it should pass (black and isort will modify the files so should +pass after they are modified). If the flake8 test fails please see the error messages and fix them manually before +trying to commit again. -CONTACTS ------------------------------------------------------------------------- +Improvements and fixes are always appreciated. -For more information on PDFgui please visit the project web-page: +Before contribuing, please read our `Code of Conduct `_. -https://www.diffpy.org/products/pdfgui.html +Contact +------- -or email Prof. Simon Billinge at sb2896@columbia.edu +For more information on diffpy.pdfgui please visit the project `web-page `_ or email Prof. Simon Billinge at sb2896@columbia.edu. From 42f460bf2a129f424cc830bdd6d39b5f0e16ba0b Mon Sep 17 00:00:00 2001 From: Caden Myers Date: Thu, 1 Aug 2024 12:35:51 -0400 Subject: [PATCH 05/23] README.rst --- README.rst | 30 +++++++++++++++++++++++++----- 1 file changed, 25 insertions(+), 5 deletions(-) diff --git a/README.rst b/README.rst index 7dfe9731..809d4f3c 100644 --- a/README.rst +++ b/README.rst @@ -46,12 +46,32 @@ powerful extensions. To get started, please open the manual from the help menu and follow the tutorial instructions. A detailed description is available in the doc/Farrow-jpcm-2007.pdf paper. -For more information about the diffpy.pdfgui library, please consult our `online documentation `_. -Citation --------- - -If you use diffpy.pdfgui in a scientific publication, we would like you to cite this package as +REQUIREMENTS +------------------------------------------------------------------------ + +PDFgui requires Python 3.8+ or 2.7 and several third-party +libraries that are used by PDFgui and its components. + +* setuptools - tools for installing Python packages +* wxpython - graphical user interface toolkit for Python +* numpy - library for scientific computing with Python +* matplotlib - Python 2D plotting library +* diffpy.pdffit2 - computational engine for PDFgui, + https://github.com/diffpy/diffpy.pdffit2 +* diffpy.structure - simple storage and manipulation of atomic + structures, https://github.com/diffpy/diffpy.structure +* diffpy.utils - shared helper utilities for wx GUI, + https://github.com/diffpy/diffpy.utils + +We recommend to use `Anaconda Python `_ +which allows to conveniently install PDFgui and all its software +dependencies with a single command. + +Please note that the Python3 PDFgui will read .ddp3 files. It is also +possible for it to read .ddp files that were saved by the Python2 PDFgui +but it will sometimes fail to read these. We are working on a solution +that will be available in a future version. diffpy.pdfgui Package, https://github.com/diffpy/diffpy.pdfgui From 88b2ebc5d2a48c9e7da6a230ff6bedd095d5397b Mon Sep 17 00:00:00 2001 From: Caden Myers Date: Thu, 1 Aug 2024 12:42:53 -0400 Subject: [PATCH 06/23] docs.yml and main.yml --- .github/workflows/docs.yml | 2 +- .github/workflows/main.yml | 51 +++++++++++++++++++------------------- 2 files changed, 27 insertions(+), 26 deletions(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index 2909d67f..a4661f5c 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -37,7 +37,7 @@ jobs: run: make -C doc html - name: Deploy - uses: peaceiris/actions-gh-pages@v4 + uses: peaceiris/actions-gh-pages@v3 with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: ./doc/build/html diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index e3ade008..80bbfb71 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -23,31 +23,32 @@ jobs: path: . fetch-depth: 0 # avoid shallow clone with no tags - - name: Install Mamba - run: | - wget "https://github.com/conda-forge/miniforge/releases/latest/download/Mambaforge-Linux-x86_64.sh" -O mambaforge.sh - bash mambaforge.sh -b -p $HOME/mambaforge - echo "$HOME/mambaforge/bin" >> $GITHUB_PATH - source $HOME/mambaforge/etc/profile.d/conda.sh - conda init bash + - name: initialize miniconda + # this uses a marketplace action that sets up miniconda in a way that makes + # it easier to use. I tried setting it up without this and it was a pain + uses: conda-incubator/setup-miniconda@v2 + with: + activate-environment: test + # environment.yml file is needed by this action. Because I don't want + # maintain this but rather maintain the requirements files it just has + # basic things in it like conda and pip + environment-file: ./environment.yml + python-version: 3 + auto-activate-base: false - - name: Create conda environment + - name: install diffpy.pdfgui requirements + shell: bash -l {0} run: | - source $HOME/mambaforge/etc/profile.d/conda.sh - conda create -n test_env python=3.12 xonsh regolith -c conda-forge -y - conda activate test_env - pip install case_insensitive_dict - - - name: Install dependencies + conda config --set always_yes yes --set changeps1 no + conda config --add channels conda-forge + conda activate test + conda install --file requirements/run.txt + conda install --file requirements/test.txt + pip install . + - name: Validate diffpy.pdfgui + shell: bash -l {0} run: | - source $HOME/mambaforge/etc/profile.d/conda.sh - conda activate test_env - mamba install --file requirements/run.txt - mamba install --file requirements/test.txt - pip install -e . - - - name: Use Xvfb Action - uses: GabrielBB/xvfb-action@v1 - with: - run: | - bash -c "source $HOME/mambaforge/etc/profile.d/conda.sh && conda activate test_env && python -m run_tests.py" + conda activate test + coverage run -m pytest -vv -s + coverage report -m + codecov From 0a4a8ddfea75f29d96781605c1c3d746d4eabc62 Mon Sep 17 00:00:00 2001 From: Caden Myers Date: Thu, 1 Aug 2024 12:48:40 -0400 Subject: [PATCH 07/23] copyright updates --- src/diffpy/__init__.py | 16 +++++----- src/diffpy/pdfgui/__init__.py | 21 +++++++------ src/diffpy/pdfgui/version.py | 55 +++++++++-------------------------- 3 files changed, 32 insertions(+), 60 deletions(-) diff --git a/src/diffpy/__init__.py b/src/diffpy/__init__.py index 50128bcc..42bc4ce3 100644 --- a/src/diffpy/__init__.py +++ b/src/diffpy/__init__.py @@ -1,15 +1,16 @@ #!/usr/bin/env python ############################################################################## # -# diffpy by DANSE Diffraction group -# Simon J. L. Billinge -# (c) 2008 trustees of the Michigan State University. -# All rights reserved. +# (c) 2008 trustees of the Michigan State University. +# (c) 2024 The Trustees of Columbia University in the City of New York. +# All rights reserved. # -# File coded by: Pavol Juhas +# File coded by: Billinge Group members and community contributors. # -# See AUTHORS.txt for a list of people who contributed. -# See LICENSE.txt for license information. +# See GitHub contributions for a more detailed list of contributors. +# https://github.com/diffpy/diffpy.pdfgui/graphs/contributors +# +# See LICENSE.rst for license information. # ############################################################################## @@ -23,5 +24,4 @@ __path__ = extend_path(__path__, __name__) - # End of file diff --git a/src/diffpy/pdfgui/__init__.py b/src/diffpy/pdfgui/__init__.py index c12002ca..a78889bc 100644 --- a/src/diffpy/pdfgui/__init__.py +++ b/src/diffpy/pdfgui/__init__.py @@ -1,23 +1,22 @@ #!/usr/bin/env python ############################################################################## # -# diffpy.pdfgui by DANSE Diffraction group -# Simon J. L. Billinge -# (c) 2006 trustees of the Michigan State University. -# All rights reserved. +# (c) 2006 trustees of the Michigan State University. +# (c) 2024 The Trustees of Columbia University in the City of New York. +# All rights reserved. # -# File coded by: Pavol Juhas +# File coded by: Billinge Group members and community contributors. # -# See AUTHORS.txt for a list of people who contributed. -# See LICENSE.txt for license information. +# See GitHub contributions for a more detailed list of contributors. +# https://github.com/diffpy/diffpy.pdfgui/graphs/contributors +# +# See LICENSE.rst for license information. # ############################################################################## -"""Constants: - __version__ -- full version of this PDFgui release -""" - +"""GUI for PDF simulation and structure refinement.""" +# package version from diffpy.pdfgui.version import __version__ # silence the pyflakes syntax checker diff --git a/src/diffpy/pdfgui/version.py b/src/diffpy/pdfgui/version.py index 416dcb46..c7eb817e 100644 --- a/src/diffpy/pdfgui/version.py +++ b/src/diffpy/pdfgui/version.py @@ -1,54 +1,27 @@ #!/usr/bin/env python ############################################################################## # -# PDFgui by DANSE Diffraction group -# Simon J. L. Billinge -# (c) 2008 trustees of the Michigan State University. -# All rights reserved. +# (c) 2008 trustees of the Michigan State University. +# (c) 2024 The Trustees of Columbia University in the City of New York. +# All rights reserved. # -# File coded by: Pavol Juhas +# File coded by: Billinge Group members and community contributors. # -# See AUTHORS.txt for a list of people who contributed. -# See LICENSE.txt for license information. +# See GitHub contributions for a more detailed list of contributors. +# https://github.com/diffpy/diffpy.pdfgui/graphs/contributors +# +# See LICENSE.rst for license information. # ############################################################################## -""" -Definition of __version__, __date__, __timestamp__, __git_commit__. - -Notes ------ -Variable `__gitsha__` is deprecated as of version 1.2. -Use `__git_commit__` instead. -""" - -__all__ = ["__date__", "__git_commit__", "__timestamp__", "__version__"] - -import os.path - -from pkg_resources import resource_filename - -# obtain version information from the version.cfg file -cp = dict(version="", date="", commit="", timestamp="0") -fcfg = resource_filename(__name__, "version.cfg") -if not os.path.isfile(fcfg): # pragma: no cover - from warnings import warn - - warn('Package metadata not found, execute "./setup.py egg_info".') - fcfg = os.devnull -with open(fcfg) as fp: - kwords = [[w.strip() for w in line.split(" = ", 1)] for line in fp if line[:1].isalpha() and " = " in line] -assert all(w[0] in cp for w in kwords), "received unrecognized keyword" -cp.update(kwords) +"""Definition of __version__.""" -__version__ = cp["version"] -__date__ = cp["date"] -__git_commit__ = cp["commit"] -__timestamp__ = int(cp["timestamp"]) +# We do not use the other three variables, but can be added back if needed. +# __all__ = ["__date__", "__git_commit__", "__timestamp__", "__version__"] -# TODO remove deprecated __gitsha__ in version 1.3. -__gitsha__ = __git_commit__ +# obtain version information +from importlib.metadata import version -del cp, fcfg, fp, kwords +__version__ = version("diffpy.pdfgui") # End of file From 06b1b4c5789228bb3e3cd6d0e81d6104d9f4e3b1 Mon Sep 17 00:00:00 2001 From: Caden Myers Date: Fri, 2 Aug 2024 11:36:18 -0400 Subject: [PATCH 08/23] v3 to v4 --- .github/workflows/docs.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index a4661f5c..2909d67f 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -37,7 +37,7 @@ jobs: run: make -C doc html - name: Deploy - uses: peaceiris/actions-gh-pages@v3 + uses: peaceiris/actions-gh-pages@v4 with: github_token: ${{ secrets.GITHUB_TOKEN }} publish_dir: ./doc/build/html From a1be5c19a938f805fa644ecbbeba22c48083722a Mon Sep 17 00:00:00 2001 From: Sparks29032 Date: Sat, 3 Aug 2024 22:54:52 -0400 Subject: [PATCH 09/23] deprecation_fix --- src/diffpy/pdfgui/gui/aboutdialog.py | 4 +-- src/diffpy/pdfgui/gui/pdfguiglobals.py | 18 +++++----- src/diffpy/pdfgui/tests/__init__.py | 47 +++++++++++++------------- src/diffpy/pdfgui/version.py | 6 +++- 4 files changed, 41 insertions(+), 34 deletions(-) diff --git a/src/diffpy/pdfgui/gui/aboutdialog.py b/src/diffpy/pdfgui/gui/aboutdialog.py index 51012e01..db7888ca 100644 --- a/src/diffpy/pdfgui/gui/aboutdialog.py +++ b/src/diffpy/pdfgui/gui/aboutdialog.py @@ -21,7 +21,7 @@ import wx.lib.agw.hyperlink from diffpy.pdfgui.gui.pdfguiglobals import iconpath -from diffpy.pdfgui.version import __date__, __version__ +from diffpy.pdfgui.version import __year__, __version__ _acknowledgement = """\ This software was developed by the Billinge-group as part of the Distributed @@ -42,7 +42,7 @@ computer programs for studying nanostructure in crystals, J. Phys.: Condens. Matter 19, 335219 (2007).""" -_copyright = "(c) 2005-{year},".format(year=__date__[:4]) +_copyright = "(c) 2005-{year},".format(year=__year__) _homepage = "https://www.diffpy.org" diff --git a/src/diffpy/pdfgui/gui/pdfguiglobals.py b/src/diffpy/pdfgui/gui/pdfguiglobals.py index 96f20538..a452f72f 100644 --- a/src/diffpy/pdfgui/gui/pdfguiglobals.py +++ b/src/diffpy/pdfgui/gui/pdfguiglobals.py @@ -17,7 +17,7 @@ import os.path -from pkg_resources import Requirement, resource_filename +from importlib_resources import files, as_file from diffpy.pdfgui.gui import debugoptions @@ -31,14 +31,15 @@ isAltered = False # Resolve APPDATADIR base path to application data files. -_mydir = os.path.abspath(resource_filename(__name__, "")) -_upbasedir = os.path.normpath(_mydir + "/../../..") -_development_mode = os.path.basename(_upbasedir) == "src" and os.path.isfile( - os.path.join(_upbasedir, "../setup.py") -) +with as_file(files(__name__)) as file: + _mydir = os.path.abspath(file) + _upbasedir = os.path.normpath(_mydir + "/../../..") + _development_mode = os.path.basename(_upbasedir) == "src" and os.path.isfile( + os.path.join(_upbasedir, "../setup.py") + ) # Requirement must have egg-info. Do not use in _development_mode. -_req = Requirement.parse("diffpy.pdfgui") +_req = "diffpy.pdfgui" # pavol # APPDATADIR = (os.path.dirname(_upbasedir) if _development_mode @@ -47,7 +48,8 @@ if _development_mode: APPDATADIR = os.path.dirname(_mydir) else: - APPDATADIR = os.path.join(resource_filename(_req, ""), "diffpy/pdfgui") + with as_file(files(_req)) as file: + APPDATADIR = os.path.join(file, "src/diffpy/pdfgui") APPDATADIR = os.path.abspath(APPDATADIR) diff --git a/src/diffpy/pdfgui/tests/__init__.py b/src/diffpy/pdfgui/tests/__init__.py index 863e9949..6d8875f8 100644 --- a/src/diffpy/pdfgui/tests/__init__.py +++ b/src/diffpy/pdfgui/tests/__init__.py @@ -38,31 +38,32 @@ def testsuite(pattern=""): from itertools import chain from os.path import dirname - from pkg_resources import resource_filename + from importlib_resources import files, as_file loader = unittest.defaultTestLoader - thisdir = resource_filename(__name__, "") - depth = __name__.count(".") + 1 - topdir = thisdir - for i in range(depth): - topdir = dirname(topdir) - suite_all = loader.discover(thisdir, top_level_dir=topdir) - # always filter the suite by pattern to test-cover the selection code. - suite = unittest.TestSuite() - rx = re.compile(pattern) - tsuites = list(chain.from_iterable(suite_all)) - tsok = all(isinstance(ts, unittest.TestSuite) for ts in tsuites) - if not tsok: # pragma: no cover - return suite_all - tcases = chain.from_iterable(tsuites) - for tc in tcases: - tcwords = tc.id().split(".") - shortname = ".".join(tcwords[-3:]) - if rx.search(shortname): - suite.addTest(tc) - # verify all tests are found for an empty pattern. - assert pattern or suite_all.countTestCases() == suite.countTestCases() - return suite + ref = files(__name__) + with as_file(ref) as thisdir: + depth = __name__.count(".") + 1 + topdir = thisdir + for i in range(depth): + topdir = dirname(topdir) + suite_all = loader.discover(thisdir, top_level_dir=topdir) + # always filter the suite by pattern to test-cover the selection code. + suite = unittest.TestSuite() + rx = re.compile(pattern) + tsuites = list(chain.from_iterable(suite_all)) + tsok = all(isinstance(ts, unittest.TestSuite) for ts in tsuites) + if not tsok: # pragma: no cover + return suite_all + tcases = chain.from_iterable(tsuites) + for tc in tcases: + tcwords = tc.id().split(".") + shortname = ".".join(tcwords[-3:]) + if rx.search(shortname): + suite.addTest(tc) + # verify all tests are found for an empty pattern. + assert pattern or suite_all.countTestCases() == suite.countTestCases() + return suite def test(): diff --git a/src/diffpy/pdfgui/version.py b/src/diffpy/pdfgui/version.py index c7eb817e..0a53b1d7 100644 --- a/src/diffpy/pdfgui/version.py +++ b/src/diffpy/pdfgui/version.py @@ -20,8 +20,12 @@ # __all__ = ["__date__", "__git_commit__", "__timestamp__", "__version__"] # obtain version information -from importlib.metadata import version +from importlib.metadata import version, distribution +# from importlib_resources import files, as_file +import os, time +# with as_file(distribution("diffpy.pdfgui")) as file: +__year__ = time.ctime(os.path.getctime(distribution("diffpy.pdfgui")._path))[-4:] __version__ = version("diffpy.pdfgui") # End of file From e558c8380a51660e55d6460784928bf5e75d8071 Mon Sep 17 00:00:00 2001 From: Sparks29032 Date: Sat, 3 Aug 2024 23:08:29 -0400 Subject: [PATCH 10/23] Daemon warnings --- src/diffpy/pdfgui/control/pdfguicontrol.py | 2 +- src/diffpy/pdfgui/gui/pdfguiglobals.py | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/diffpy/pdfgui/control/pdfguicontrol.py b/src/diffpy/pdfgui/control/pdfguicontrol.py index 15632a0d..d3c07a84 100644 --- a/src/diffpy/pdfgui/control/pdfguicontrol.py +++ b/src/diffpy/pdfgui/control/pdfguicontrol.py @@ -93,7 +93,7 @@ def run(self): def startQueue(self): """start queue manager""" - self.queueManager.setDaemon(True) + self.queueManager.ddaemon = True self.queueManager.start() def checkQueue(self): diff --git a/src/diffpy/pdfgui/gui/pdfguiglobals.py b/src/diffpy/pdfgui/gui/pdfguiglobals.py index a452f72f..3bd283a2 100644 --- a/src/diffpy/pdfgui/gui/pdfguiglobals.py +++ b/src/diffpy/pdfgui/gui/pdfguiglobals.py @@ -49,9 +49,10 @@ APPDATADIR = os.path.dirname(_mydir) else: with as_file(files(_req)) as file: - APPDATADIR = os.path.join(file, "src/diffpy/pdfgui") + APPDATADIR = os.path.join(file, "") APPDATADIR = os.path.abspath(APPDATADIR) +print(APPDATADIR) # Location of the HTML manual docMainFile = os.path.join(APPDATADIR, "doc/manual/pdfgui.html") From 6e9396eef96b3bd423cc39986dd305ffd17af137 Mon Sep 17 00:00:00 2001 From: Sparks29032 Date: Sun, 4 Aug 2024 01:48:43 -0400 Subject: [PATCH 11/23] pre-commit --- src/diffpy/pdfgui/gui/aboutdialog.py | 2 +- src/diffpy/pdfgui/gui/pdfguiglobals.py | 2 +- src/diffpy/pdfgui/tests/__init__.py | 2 +- src/diffpy/pdfgui/version.py | 8 +++++--- 4 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/diffpy/pdfgui/gui/aboutdialog.py b/src/diffpy/pdfgui/gui/aboutdialog.py index db7888ca..03de2ced 100644 --- a/src/diffpy/pdfgui/gui/aboutdialog.py +++ b/src/diffpy/pdfgui/gui/aboutdialog.py @@ -21,7 +21,7 @@ import wx.lib.agw.hyperlink from diffpy.pdfgui.gui.pdfguiglobals import iconpath -from diffpy.pdfgui.version import __year__, __version__ +from diffpy.pdfgui.version import __version__, __year__ _acknowledgement = """\ This software was developed by the Billinge-group as part of the Distributed diff --git a/src/diffpy/pdfgui/gui/pdfguiglobals.py b/src/diffpy/pdfgui/gui/pdfguiglobals.py index 3bd283a2..fc5f5e57 100644 --- a/src/diffpy/pdfgui/gui/pdfguiglobals.py +++ b/src/diffpy/pdfgui/gui/pdfguiglobals.py @@ -17,7 +17,7 @@ import os.path -from importlib_resources import files, as_file +from importlib_resources import as_file, files from diffpy.pdfgui.gui import debugoptions diff --git a/src/diffpy/pdfgui/tests/__init__.py b/src/diffpy/pdfgui/tests/__init__.py index 6d8875f8..a0a02efa 100644 --- a/src/diffpy/pdfgui/tests/__init__.py +++ b/src/diffpy/pdfgui/tests/__init__.py @@ -38,7 +38,7 @@ def testsuite(pattern=""): from itertools import chain from os.path import dirname - from importlib_resources import files, as_file + from importlib_resources import as_file, files loader = unittest.defaultTestLoader ref = files(__name__) diff --git a/src/diffpy/pdfgui/version.py b/src/diffpy/pdfgui/version.py index 0a53b1d7..f05e9201 100644 --- a/src/diffpy/pdfgui/version.py +++ b/src/diffpy/pdfgui/version.py @@ -19,10 +19,12 @@ # We do not use the other three variables, but can be added back if needed. # __all__ = ["__date__", "__git_commit__", "__timestamp__", "__version__"] -# obtain version information -from importlib.metadata import version, distribution # from importlib_resources import files, as_file -import os, time +import os +import time + +# obtain version information +from importlib.metadata import distribution, version # with as_file(distribution("diffpy.pdfgui")) as file: __year__ = time.ctime(os.path.getctime(distribution("diffpy.pdfgui")._path))[-4:] From 73a5f1c126993746b9326b907a622a0debf1273e Mon Sep 17 00:00:00 2001 From: Sparks29032 Date: Sun, 4 Aug 2024 01:53:35 -0400 Subject: [PATCH 12/23] add pytest.ini --- pytest.ini | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 pytest.ini diff --git a/pytest.ini b/pytest.ini new file mode 100644 index 00000000..87226211 --- /dev/null +++ b/pytest.ini @@ -0,0 +1,2 @@ +[pytest] +python_files = test*.py From 64736f88c7496617208085aeec075935f5d8749a Mon Sep 17 00:00:00 2001 From: Sparks29032 Date: Sun, 4 Aug 2024 02:11:05 -0400 Subject: [PATCH 13/23] Fix matplotlib warnings --- src/diffpy/pdfgui/gui/extendedplotframe.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/diffpy/pdfgui/gui/extendedplotframe.py b/src/diffpy/pdfgui/gui/extendedplotframe.py index 297a7670..a1a052a8 100644 --- a/src/diffpy/pdfgui/gui/extendedplotframe.py +++ b/src/diffpy/pdfgui/gui/extendedplotframe.py @@ -183,8 +183,11 @@ def insertCurve(self, xData, yData, style): return: internal reference to the newly added curve """ stylestr, properties = self.__translateStyles(style) - curveRef = self.subplot.plot(xData, yData, stylestr, **properties)[0] - self.subplot.legend(**legendBoxProperties()) + if stylestr == "": # blank stylestring throws warning for duplicated information + curveRef = self.subplot.plot(xData, yData, **properties)[0] + else: + curveRef = self.subplot.plot(xData, yData, stylestr, **properties)[0] + self.subplot.legend([], **legendBoxProperties()) # add blank list argument to prevent warning try: self.datalims[curveRef] = (min(xData), max(xData), min(yData), max(yData)) except ValueError: @@ -314,7 +317,7 @@ def __translateStyles(self, style): # not 'points', so line properties are required as well lineStyle = lineStyleDict.get(style["line"], "-") # prefer solid lineWidth = style["width"] - stylestr += lineStyle + # stylestr += lineStyle # no need to add lineStyle to stylestr when in properties properties.update({"color": color, "linestyle": lineStyle, "linewidth": lineWidth}) if "legend" in style: From 7e15d1673fbdcec8902d885c4961e4d044a3d3d0 Mon Sep 17 00:00:00 2001 From: Sparky <59151395+Sparks29032@users.noreply.github.com> Date: Sun, 4 Aug 2024 17:00:32 -0400 Subject: [PATCH 14/23] Create build.txt --- requirements/build.txt | 1 + 1 file changed, 1 insertion(+) create mode 100644 requirements/build.txt diff --git a/requirements/build.txt b/requirements/build.txt new file mode 100644 index 00000000..58ad1bd3 --- /dev/null +++ b/requirements/build.txt @@ -0,0 +1 @@ +importlib_resources From f97ddb398e85c8e327247074fad5671680dda493 Mon Sep 17 00:00:00 2001 From: Sparky <59151395+Sparks29032@users.noreply.github.com> Date: Sun, 4 Aug 2024 17:01:31 -0400 Subject: [PATCH 15/23] Update main.yml --- .github/workflows/main.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 80bbfb71..18378e4f 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -42,6 +42,7 @@ jobs: conda config --set always_yes yes --set changeps1 no conda config --add channels conda-forge conda activate test + conda install --file requirements/build.txt conda install --file requirements/run.txt conda install --file requirements/test.txt pip install . From 4040d8943e1bd7fb19db141765d68a8eccd5ad3d Mon Sep 17 00:00:00 2001 From: Sparky <59151395+Sparks29032@users.noreply.github.com> Date: Sun, 4 Aug 2024 17:01:52 -0400 Subject: [PATCH 16/23] Update run.txt --- requirements/run.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/requirements/run.txt b/requirements/run.txt index 40bce3f0..18fd083f 100644 --- a/requirements/run.txt +++ b/requirements/run.txt @@ -1,4 +1,4 @@ -numpy==1.26 +numpy<2.0 wxpython diffpy.pdffit2 diffpy.utils From 8cb522dc05c729b4a8f45f71107db4afcee1eb8f Mon Sep 17 00:00:00 2001 From: Sparky <59151395+Sparks29032@users.noreply.github.com> Date: Sun, 4 Aug 2024 17:07:26 -0400 Subject: [PATCH 17/23] Update main.yml --- .github/workflows/main.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 18378e4f..80bbfb71 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -42,7 +42,6 @@ jobs: conda config --set always_yes yes --set changeps1 no conda config --add channels conda-forge conda activate test - conda install --file requirements/build.txt conda install --file requirements/run.txt conda install --file requirements/test.txt pip install . From aa00fc5683a721b177664af549ee38fae7036f74 Mon Sep 17 00:00:00 2001 From: Sparky <59151395+Sparks29032@users.noreply.github.com> Date: Sun, 4 Aug 2024 17:07:34 -0400 Subject: [PATCH 18/23] Delete requirements/build.txt --- requirements/build.txt | 1 - 1 file changed, 1 deletion(-) delete mode 100644 requirements/build.txt diff --git a/requirements/build.txt b/requirements/build.txt deleted file mode 100644 index 58ad1bd3..00000000 --- a/requirements/build.txt +++ /dev/null @@ -1 +0,0 @@ -importlib_resources From de0420649df80a5c9b7b41b038d023efffee4c83 Mon Sep 17 00:00:00 2001 From: Sparky <59151395+Sparks29032@users.noreply.github.com> Date: Sun, 4 Aug 2024 17:07:50 -0400 Subject: [PATCH 19/23] Update run.txt --- requirements/run.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/requirements/run.txt b/requirements/run.txt index 18fd083f..23796adc 100644 --- a/requirements/run.txt +++ b/requirements/run.txt @@ -1,3 +1,4 @@ +importlib_resources numpy<2.0 wxpython diffpy.pdffit2 From bb9fad3f81bc240ac571af31928851877ea4d9c1 Mon Sep 17 00:00:00 2001 From: Caden Myers Date: Tue, 6 Aug 2024 14:20:37 -0400 Subject: [PATCH 20/23] change np.array() to np.asarray() --- src/diffpy/pdfgui/control/fitdataset.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/diffpy/pdfgui/control/fitdataset.py b/src/diffpy/pdfgui/control/fitdataset.py index eb3d6a80..8b60f3eb 100644 --- a/src/diffpy/pdfgui/control/fitdataset.py +++ b/src/diffpy/pdfgui/control/fitdataset.py @@ -783,10 +783,10 @@ def grid_interpolation(x0, y0, x1, youtleft=0.0, youtright=0.0): Return numpy.array of interpolated y1 values. """ - x0 = numpy.array(x0, copy=False, dtype=float) - y0 = numpy.array(y0, copy=False, dtype=float) + x0 = numpy.asarray(x0, dtype=float) + y0 = numpy.asarray(y0, dtype=float) n0 = len(x0) - x1 = numpy.array(x1, copy=False, dtype=float) + x1 = numpy.asarray(x1, dtype=float) n1 = len(x1) y1 = youtright * numpy.ones(n1, dtype=float) if n0: From 3bf9313a69912b066c38cac1a37d0ed9b377224c Mon Sep 17 00:00:00 2001 From: Caden Myers Date: Wed, 7 Aug 2024 16:00:31 -0400 Subject: [PATCH 21/23] limiting pdfgui to python=3.11 --- pyproject.toml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 35921cdb..d637b419 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -14,7 +14,7 @@ maintainers = [ description = "GUI for PDF simulation and structure refinement." keywords = ['PDF structure refinement GUI'] readme = "README.rst" -requires-python = ">=3.10" +requires-python = [3.10, 3.11] classifiers = [ 'Development Status :: 5 - Production/Stable', 'Environment :: Console', @@ -27,7 +27,6 @@ classifiers = [ 'Operating System :: Unix', 'Programming Language :: Python :: 3.10', 'Programming Language :: Python :: 3.11', - 'Programming Language :: Python :: 3.12', 'Topic :: Scientific/Engineering :: Physics', 'Topic :: Scientific/Engineering :: Chemistry', ] From 5ea048c6503c399a1f128958faa9f6a07cacf816 Mon Sep 17 00:00:00 2001 From: Caden Myers Date: Wed, 7 Aug 2024 16:12:23 -0400 Subject: [PATCH 22/23] fix syntax --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index d637b419..f75fb6fd 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -14,7 +14,7 @@ maintainers = [ description = "GUI for PDF simulation and structure refinement." keywords = ['PDF structure refinement GUI'] readme = "README.rst" -requires-python = [3.10, 3.11] +requires-python = ">=3.10,<3.12" classifiers = [ 'Development Status :: 5 - Production/Stable', 'Environment :: Console', From 720c1d55ba5e5beec8e8c163d41cde5dbccd0862 Mon Sep 17 00:00:00 2001 From: Caden Myers Date: Thu, 8 Aug 2024 11:33:12 -0400 Subject: [PATCH 23/23] python >=3.10 --- pyproject.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index f75fb6fd..273ea25e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -14,7 +14,7 @@ maintainers = [ description = "GUI for PDF simulation and structure refinement." keywords = ['PDF structure refinement GUI'] readme = "README.rst" -requires-python = ">=3.10,<3.12" +requires-python = ">=3.10" classifiers = [ 'Development Status :: 5 - Production/Stable', 'Environment :: Console',