From 972a744fc895a602be0bc4f6f98472acb621ca45 Mon Sep 17 00:00:00 2001 From: Sam Andrello Date: Tue, 23 Jul 2024 14:10:36 -0400 Subject: [PATCH 01/15] Changelog --- CHANGELOG.md | 17 ----------------- CHANGELOG.rst | 26 ++++++++++++++++++++++++++ 2 files changed, 26 insertions(+), 17 deletions(-) delete mode 100644 CHANGELOG.md create mode 100644 CHANGELOG.rst diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index b101ecc6..00000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,17 +0,0 @@ -# Release notes - -No notable functional changes from 1.4.1 - -## Version 1.4.2 – 2023-12-09 - -### Added - -- Support for Python 3.11, 3.12 - -### Changed - -### Deprecated - -### Removed - -### Fixed diff --git a/CHANGELOG.rst b/CHANGELOG.rst new file mode 100644 index 00000000..55012a9d --- /dev/null +++ b/CHANGELOG.rst @@ -0,0 +1,26 @@ +============= +Release Notes +============= + +No notable functional changes from 1.4.1 + +-------------------------- +Version 1.4.2 – 2023-12-09 +-------------------------- + +Added +===== + +- Support for Python 3.11, 3.12 + +Changed +======= + +Deprecated +========== + +Removed +======= + +Fixed +===== From cc9ee36ad4644b011552b3a5c5515255379b16fc Mon Sep 17 00:00:00 2001 From: Sam Andrello Date: Tue, 23 Jul 2024 14:12:10 -0400 Subject: [PATCH 02/15] License --- LICENSE.txt => LICENSE.rst | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename LICENSE.txt => LICENSE.rst (100%) diff --git a/LICENSE.txt b/LICENSE.rst similarity index 100% rename from LICENSE.txt rename to LICENSE.rst From e1adbaf2b3a531ad108ec8dd21d365f4f5079b43 Mon Sep 17 00:00:00 2001 From: Sam Andrello Date: Tue, 23 Jul 2024 14:14:48 -0400 Subject: [PATCH 03/15] Authors --- AUTHORS.txt => AUTHORS.rst | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) rename AUTHORS.txt => AUTHORS.rst (92%) diff --git a/AUTHORS.txt b/AUTHORS.rst similarity index 92% rename from AUTHORS.txt rename to AUTHORS.rst index 2c1d7f81..16904008 100644 --- a/AUTHORS.txt +++ b/AUTHORS.rst @@ -1,3 +1,6 @@ +Authors +======= + This code was derived from the first PDFFIT program by Thomas Proffen. The sources were converted to C++ by Jacques Bloch and then extensively hacked, extended and purged from most glaring bugs by Chris Farrow and Pavol Juhas. @@ -30,7 +33,8 @@ found at http://danse.us. Any opinions, findings, and conclusions or recommendations expressed in this material are those of the author(s) and do not necessarily reflect the views of the NSF. -Acknowledgments: +Acknowledgments +--------------- We are truly grateful to all the people who have contributed, in all different ways, to this project: Thomas Proffen, Xiangyun Qiu, Pete @@ -45,3 +49,10 @@ especially HyunJeong Kim and Ahmad Masadeh for enthusiastic testing and feature requests; Last but not least, our long suffering family members, and the whole coffee and tea industries at large, without whom none of this would have been possible. + + +Contributors +------------ + +For a list of contributors, visit +https://github.com/diffpy/diffpy.pdffit2/graphs/contributors From 526d41ee861e6105b20f946097cb5db7c6eb61f3 Mon Sep 17 00:00:00 2001 From: Sam Andrello Date: Tue, 23 Jul 2024 14:15:40 -0400 Subject: [PATCH 04/15] Code of conduct added --- CODE_OF_CONDUCT.rst | 133 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 133 insertions(+) create mode 100644 CODE_OF_CONDUCT.rst diff --git a/CODE_OF_CONDUCT.rst b/CODE_OF_CONDUCT.rst new file mode 100644 index 00000000..ff9c3561 --- /dev/null +++ b/CODE_OF_CONDUCT.rst @@ -0,0 +1,133 @@ +===================================== + Contributor Covenant Code of Conduct +===================================== + +Our Pledge +---------- + +We as members, contributors, and leaders pledge to make participation in our +community a harassment-free experience for everyone, regardless of age, body +size, visible or invisible disability, ethnicity, sex characteristics, gender +identity and expression, level of experience, education, socio-economic status, +nationality, personal appearance, race, caste, color, religion, or sexual +identity and orientation. + +We pledge to act and interact in ways that contribute to an open, welcoming, +diverse, inclusive, and healthy community. + +Our Standards +------------- + +Examples of behavior that contributes to a positive environment for our +community include: + +* Demonstrating empathy and kindness toward other people +* Being respectful of differing opinions, viewpoints, and experiences +* Giving and gracefully accepting constructive feedback +* Accepting responsibility and apologizing to those affected by our mistakes, + and learning from the experience +* Focusing on what is best not just for us as individuals, but for the overall + community + +Examples of unacceptable behavior include: + +* The use of sexualized language or imagery, and sexual attention or advances of + any kind +* Trolling, insulting or derogatory comments, and personal or political attacks +* Public or private harassment +* Publishing others' private information, such as a physical or email address, + without their explicit permission +* Other conduct which could reasonably be considered inappropriate in a + professional setting + +Enforcement Responsibilities +---------------------------- + +Community leaders are responsible for clarifying and enforcing our standards of +acceptable behavior and will take appropriate and fair corrective action in +response to any behavior that they deem inappropriate, threatening, offensive, +or harmful. + +Community leaders have the right and responsibility to remove, edit, or reject +comments, commits, code, wiki edits, issues, and other contributions that are +not aligned to this Code of Conduct, and will communicate reasons for moderation +decisions when appropriate. + +Scope +----- + +This Code of Conduct applies within all community spaces, and also applies when +an individual is officially representing the community in public spaces. +Examples of representing our community include using an official email address, +posting via an official social media account, or acting as an appointed +representative at an online or offline event. + +Enforcement +----------- + +Instances of abusive, harassing, or otherwise unacceptable behavior may be +reported to the community leaders responsible for enforcement at +sb2896@columbia.edu. All complaints will be reviewed and investigated promptly and fairly. + +All community leaders are obligated to respect the privacy and security of the +reporter of any incident. + +Enforcement Guidelines +---------------------- + +Community leaders will follow these Community Impact Guidelines in determining +the consequences for any action they deem in violation of this Code of Conduct: + +1. Correction +**************** + +**Community Impact**: Use of inappropriate language or other behavior deemed +unprofessional or unwelcome in the community. + +**Consequence**: A private, written warning from community leaders, providing +clarity around the nature of the violation and an explanation of why the +behavior was inappropriate. A public apology may be requested. + +2. Warning +************* + +**Community Impact**: A violation through a single incident or series of +actions. + +**Consequence**: A warning with consequences for continued behavior. No +interaction with the people involved, including unsolicited interaction with +those enforcing the Code of Conduct, for a specified period of time. This +includes avoiding interactions in community spaces as well as external channels +like social media. Violating these terms may lead to a temporary or permanent +ban. + +3. Temporary Ban +****************** + +**Community Impact**: A serious violation of community standards, including +sustained inappropriate behavior. + +**Consequence**: A temporary ban from any sort of interaction or public +communication with the community for a specified period of time. No public or +private interaction with the people involved, including unsolicited interaction +with those enforcing the Code of Conduct, is allowed during this period. +Violating these terms may lead to a permanent ban. + +4. Permanent Ban +****************** + +**Community Impact**: Demonstrating a pattern of violation of community +standards, including sustained inappropriate behavior, harassment of an +individual, or aggression toward or disparagement of classes of individuals. + +**Consequence**: A permanent ban from any sort of public interaction within the +community. + +Attribution +----------- + +This Code of Conduct is adapted from the `Contributor Covenant `_. + +Community Impact Guidelines were inspired by `Mozilla's code of conduct enforcement ladder `_. + +For answers to common questions about this code of conduct, see the `FAQ `_. `Translations are available `_ From 09b5c8900f564e19913c4f9840ca10cd270768cb Mon Sep 17 00:00:00 2001 From: Sam Andrello Date: Tue, 23 Jul 2024 14:18:15 -0400 Subject: [PATCH 05/15] added isort config --- .isort.cfg | 4 ++++ 1 file changed, 4 insertions(+) create mode 100644 .isort.cfg diff --git a/.isort.cfg b/.isort.cfg new file mode 100644 index 00000000..e0926f42 --- /dev/null +++ b/.isort.cfg @@ -0,0 +1,4 @@ +[settings] +line_length = 115 +multi_line_output = 3 +include_trailing_comma = True From 587d2a3c46962d8ea1f9a9d533d057ceb2884e87 Mon Sep 17 00:00:00 2001 From: Sam Andrello Date: Tue, 23 Jul 2024 14:20:23 -0400 Subject: [PATCH 06/15] removed conda-recipe directory and references --- .pre-commit-config.yaml | 1 - conda-recipe/bld.bat | 7 ---- conda-recipe/build.sh | 25 ------------ conda-recipe/conda_build_config.yaml | 11 ----- conda-recipe/meta.yaml | 60 ---------------------------- conda-recipe/run_test.py | 5 --- 6 files changed, 109 deletions(-) delete mode 100644 conda-recipe/bld.bat delete mode 100644 conda-recipe/build.sh delete mode 100644 conda-recipe/conda_build_config.yaml delete mode 100644 conda-recipe/meta.yaml delete mode 100644 conda-recipe/run_test.py diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 8aedd156..1408788d 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -14,7 +14,6 @@ repos: rev: v4.6.0 hooks: - id: check-yaml - exclude: ^conda-recipe/meta\.yaml$ - id: end-of-file-fixer - id: trailing-whitespace exclude: '\.(rst|txt)$' diff --git a/conda-recipe/bld.bat b/conda-recipe/bld.bat deleted file mode 100644 index 3038f794..00000000 --- a/conda-recipe/bld.bat +++ /dev/null @@ -1,7 +0,0 @@ -%PYTHON% -m easy_install --no-deps . -if errorlevel 1 exit 1 - -:: Add more build steps here, if they are necessary. - -:: See http://docs.continuum.io/conda/build.html -:: for a list of environment variables that are set during the build process. diff --git a/conda-recipe/build.sh b/conda-recipe/build.sh deleted file mode 100644 index 70ddaf82..00000000 --- a/conda-recipe/build.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash - -# Produce stripped binaries on Linux. -if [[ "$(uname)" == Linux ]]; then - # conda-build does not set LDFLAGS on Linux. - export LDFLAGS="-s" -fi - -# allow use of default SDK on travis -if [[ "$(id -un)" == travis ]]; then - unset CONDA_BUILD_SYSROOT -# print informative message if SDK is not installed -elif [[ "$(uname)" == Darwin ]]; then - if [[ ! -e $CONDA_BUILD_SYSROOT ]]; then - echo "Please install macOS SDK to $CONDA_BUILD_SYSROOT" - exit 2 - fi -fi - -$PYTHON -m easy_install --no-deps . - -# Add more build steps here, if they are necessary. - -# See http://docs.continuum.io/conda/build.html -# for a list of environment variables that are set during the build process. diff --git a/conda-recipe/conda_build_config.yaml b/conda-recipe/conda_build_config.yaml deleted file mode 100644 index 4244b05c..00000000 --- a/conda-recipe/conda_build_config.yaml +++ /dev/null @@ -1,11 +0,0 @@ -python: - - 3.12 - - 3.11 - - 3.10 - - 3.9 - - 3.8 - - 3.7 - - 2.7 - -gsl: - - 2.4 diff --git a/conda-recipe/meta.yaml b/conda-recipe/meta.yaml deleted file mode 100644 index 9296ff4e..00000000 --- a/conda-recipe/meta.yaml +++ /dev/null @@ -1,60 +0,0 @@ -{% set setupdata = load_setup_py_data() %} - -package: - name: diffpy.pdffit2 - version: {{ setupdata['version'] }} - -source: - # git_url: https://github.com/diffpy/diffpy.pdffit2.git - git_url: .. - -build: - preserve_egg_dir: True - - # If this is a new build for the same version, increment the build - # number. If you do not include this key, it defaults to 0. - number: 0 - -requirements: - build: - - {{ compiler('cxx') }} # [py3k or not win] - - gsl {{ gsl }} - host: - - python {{ python }} - - pip - - setuptools - - run: - - python - - setuptools - - six - - diffpy.structure >=3 - -test: - # Python imports - imports: - - diffpy - - diffpy.pdffit2 - - diffpy.pdffit2.ipy_ext - - diffpy.pdffit2.tests - - # commands: - # You can put test commands to be run here. Use this to test that the - # entry points work. - - - # You can also put a file called run_test.py in the recipe that will be run - # at test time. - - # requires: - # Put any additional test requirements here. For example - # - nose - -about: - home: https://github.com/diffpy/diffpy.pdffit2 - summary: PDFfit2 - real space structure refinement program - license: Modified BSD License - license_file: LICENSE.txt - -# See http://docs.continuum.io/conda/build.html -# for more information about meta.yaml. diff --git a/conda-recipe/run_test.py b/conda-recipe/run_test.py deleted file mode 100644 index 1432eed6..00000000 --- a/conda-recipe/run_test.py +++ /dev/null @@ -1,5 +0,0 @@ -#!/usr/bin/env python - -import diffpy.pdffit2.tests - -assert diffpy.pdffit2.tests.test().wasSuccessful() From a5096413a7c0bb5b1a6ab177bef51c6797f66f72 Mon Sep 17 00:00:00 2001 From: Sam Andrello Date: Tue, 23 Jul 2024 14:21:37 -0400 Subject: [PATCH 07/15] codecov --- .codecov.yml | 36 ++++++++++++++++++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 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/ From 35a32c283de5a78265828ed2e4b02eed980fbcf3 Mon Sep 17 00:00:00 2001 From: Sam Andrello Date: Tue, 23 Jul 2024 14:24:14 -0400 Subject: [PATCH 08/15] coveragerc --- .coveragerc | 22 +++++++++++++--------- 1 file changed, 13 insertions(+), 9 deletions(-) diff --git a/.coveragerc b/.coveragerc index d0a0d16d..e20b9438 100644 --- a/.coveragerc +++ b/.coveragerc @@ -1,6 +1,16 @@ -# Configuration of the coverage.py tool for reporting test coverage. - +[run] +source = + diffpy.pdffit2 +omit = + ## exclude debug.py from codecov report + */tests/debug.py [report] +omit = + */python?.?/* + */site-packages/nose/* + # ignore _version.py and versioneer.py + .*version.* + *_version.py # RE patterns for lines to be excluded from consideration. exclude_lines = ## Have to re-enable the standard pragma @@ -13,10 +23,4 @@ exclude_lines = ## Don't complain if non-runnable code isn't run: ^[ ]*@unittest.skip\b ^[ ]{4}unittest.main() - if __name__ == .__main__.: - - -[run] -omit = - ## exclude debug.py from codecov report - */tests/debug.py + if __name__ == '__main__': From d9b499ed0da243575220b9ba36a8c61a6a71cc57 Mon Sep 17 00:00:00 2001 From: Sam Andrello Date: Tue, 23 Jul 2024 14:25:20 -0400 Subject: [PATCH 09/15] Remove travis.yml --- .travis.yml | 108 ---------------------------------------------------- 1 file changed, 108 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index d5979526..00000000 --- a/.travis.yml +++ /dev/null @@ -1,108 +0,0 @@ -dist: xenial -language: generic - -os: - - linux - - osx - -env: - - MYUSEMC=true MYPYTHON_VERSION=2.7 - - MYUSEMC=true MYPYTHON_VERSION=3.7 - - MYUSEMC=true MYPYTHON_VERSION=3.8 - - MYUSEMC=true MYPYTHON_VERSION=3.9 - - MYUSEMC=true MYPYTHON_VERSION=3.10 - - MYUSEMC=true MYPYTHON_VERSION=3.11 - - MYUSEMC=true MYPYTHON_VERSION=3.12 - - MYUSEMC=false - -matrix: - exclude: - - os: osx - env: MYUSEMC=false - -git: - depth: 999999 - -branches: - except: - - /^v[0-9]/ - - -before_install: - - MYNAME=diffpy.pdffit2 - - MYCOMMIT="$(git rev-parse HEAD)" - - umask 022 - - git fetch origin --tags - - if ${MYUSEMC}; then - NOAPT=true; NOMC=false; - else - NOAPT=false; NOMC=true; - MYPIPFLAGS="--user"; - fi - - MYMCREPO=https://repo.anaconda.com/miniconda - - case ${TRAVIS_OS_NAME} in - linux) - MYMCBUNDLE=Miniconda3-latest-Linux-x86_64.sh ;; - osx) - MYMCBUNDLE=Miniconda3-latest-MacOSX-x86_64.sh ;; - *) - echo "Unsupported operating system." >&2; - exit 2 ;; - esac - - MYRUNDIR=${PWD}/build/rundir - - - mkdir -p ~/pkgs - - mkdir -p ${MYRUNDIR} - - cp .coveragerc ${MYRUNDIR}/ - - - $NOMC || pushd ~/pkgs - - $NOMC || wget --timestamping ${MYMCREPO}/${MYMCBUNDLE} - - $NOMC || test -x ~/mc/bin/conda || bash ${MYMCBUNDLE} -b -f -p ~/mc - - $NOMC || popd - - $NOMC || source ~/mc/bin/activate base - - $NOMC || conda update --yes conda - - $NOMC || conda install --yes conda-build conda-verify jinja2 - # avoid warnings from setup.py - - $NOMC || conda install --yes gsl - - $NOMC || conda create --name=testenv --yes python=${MYPYTHON_VERSION} coverage - - $NOMC || conda config --add channels diffpy - - - $NOAPT || test "${TRAVIS_OS_NAME}" = "linux" || exit $? - - $NOAPT || PATH="$(echo "$PATH" | sed 's,:/opt/pyenv/[^:]*,,g')" - - $NOAPT || test "$(which python)" = "/usr/bin/python" || ( - which python; exit 1) - - $NOAPT || sudo apt-get update -qq - - $NOAPT || sudo apt-get install -y - build-essential libgsl0-dev python-dev - python-numpy python-setuptools python-pip - - $NOAPT || devutils/makesdist - - $NOAPT || MYTARBUNDLE="$(ls -t "${PWD}"/dist/*.tar.gz | head -1)" - - -install: - - $NOMC || conda build --python=${MYPYTHON_VERSION} conda-recipe - - $NOMC || conda render --python=${MYPYTHON_VERSION} --output conda-recipe | - sed 's,.*/,,; s/[.]tar[.]bz2$//; s/-/=/g' > /tmp/mypackage.txt - - $NOMC || source activate testenv - - $NOMC || conda install --yes --use-local --file=/tmp/mypackage.txt - - - $NOAPT || pip install $MYPIPFLAGS coverage - # TODO - restore pip install once it works. - # - $NOAPT || pip install $MYPIPFLAGS "${MYTARBUNDLE}" - - $NOAPT || easy_install --user "${MYTARBUNDLE}" - - - cd ${MYRUNDIR} - - MYGIT_REV=$(python -c "import ${MYNAME}.version as v; print(v.__git_commit__)") - - if [[ "${MYCOMMIT}" != "${MYGIT_REV}" ]]; then - echo "Version mismatch ${MYCOMMIT} vs ${MYGIT_REV}."; - exit 1; - fi - - -script: - - coverage run --source ${MYNAME} -m ${MYNAME}.tests.rundeps - - -after_success: - - pip install $MYPIPFLAGS codecov - - codecov From 9642398f1bb8c54af6d7751a1be97e8e6a84e65b Mon Sep 17 00:00:00 2001 From: Sam Andrello Date: Tue, 23 Jul 2024 14:26:48 -0400 Subject: [PATCH 10/15] MANIFEST.in --- MANIFEST.in | 24 ++++++++++++++++-------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/MANIFEST.in b/MANIFEST.in index 1b41a5df..517a2074 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -1,20 +1,28 @@ recursive-include diffpy * recursive-exclude diffpy *.py[co] *.so -recursive-include libpdffit2 *.[ch]* -recursive-include pdffit2module *.[ch]* +recursive-include docs *.rst conf.py Makefile make.bat + +recursive-include src/extensions/libpdffit2 *.[ch]* +recursive-include src/extensions/pdffit2module *.[ch]* recursive-include examples * -include AUTHORS.txt LICENSE*.txt README* -include Makefile -prune libpdffit2/tests +include AUTHORS.rst +include diffpy.pdffit2/version.py +include LICENSE +include README.rst +include requirements/ +prune src/extensions/libpdffit2/tests global-exclude .gitattributes .gitignore .gitarchive.cfg global-exclude .DS_Store +recursive-exclude * __pycache__ +recursive-exclude * *.py[co] + +# If including data files in the package, add them like: +# include path/to/data_file # Avoid user content in setup.cfg to make distribution reproducible. exclude setup.cfg # Exclude git-tracked files spuriously added by setuptools_scm exclude .coveragerc -exclude .travis* -prune conda-recipe -prune devutils +prune src/devutils prune doc From 3f0edaef519853b8a907b6684192b657389316d7 Mon Sep 17 00:00:00 2001 From: Sam Andrello Date: Tue, 23 Jul 2024 14:28:45 -0400 Subject: [PATCH 11/15] added news directory with template --- news/TEMPLATE.rst | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 news/TEMPLATE.rst diff --git a/news/TEMPLATE.rst b/news/TEMPLATE.rst new file mode 100644 index 00000000..790d30b1 --- /dev/null +++ b/news/TEMPLATE.rst @@ -0,0 +1,23 @@ +**Added:** + +* + +**Changed:** + +* + +**Deprecated:** + +* + +**Removed:** + +* + +**Fixed:** + +* + +**Security:** + +* From 83b573f5ebd9725acdf8384797c6f91a300dfd70 Mon Sep 17 00:00:00 2001 From: Sam Andrello Date: Tue, 23 Jul 2024 14:29:18 -0400 Subject: [PATCH 12/15] Removed .idea directory --- .idea/.gitignore | 8 -------- 1 file changed, 8 deletions(-) delete mode 100644 .idea/.gitignore diff --git a/.idea/.gitignore b/.idea/.gitignore deleted file mode 100644 index 13566b81..00000000 --- a/.idea/.gitignore +++ /dev/null @@ -1,8 +0,0 @@ -# Default ignored files -/shelf/ -/workspace.xml -# Editor-based HTTP Client requests -/httpRequests/ -# Datasource local storage ignored files -/dataSources/ -/dataSources.local.xml From 161e45e3322b7fcb591200e694f2c9574e068203 Mon Sep 17 00:00:00 2001 From: Sam Andrello Date: Tue, 23 Jul 2024 16:33:21 -0400 Subject: [PATCH 13/15] update authors with group statement --- AUTHORS.rst | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/AUTHORS.rst b/AUTHORS.rst index 16904008..8cae8521 100644 --- a/AUTHORS.rst +++ b/AUTHORS.rst @@ -1,6 +1,10 @@ Authors ======= +Billinge Group and community contibutors. + +---- + This code was derived from the first PDFFIT program by Thomas Proffen. The sources were converted to C++ by Jacques Bloch and then extensively hacked, extended and purged from most glaring bugs by Chris Farrow and Pavol Juhas. @@ -12,11 +16,17 @@ and Applied Mathematics Department of the Columbia University in New York. Currently the team consists of Simon Billinge + Pavol Juhas + Chris Farrow + Emil Bozin + Wenduo Zhou + Peng Tian + Timur Dykhne Please see the header of each source file for a detailed list of From 7af87f29601e3fd3398c2a7abd26f2d519022e57 Mon Sep 17 00:00:00 2001 From: Sam Andrello Date: Tue, 23 Jul 2024 16:35:28 -0400 Subject: [PATCH 14/15] revert conda-recipe removal --- .pre-commit-config.yaml | 1 + conda-recipe/bld.bat | 7 ++++ conda-recipe/build.sh | 25 ++++++++++++ conda-recipe/conda_build_config.yaml | 11 +++++ conda-recipe/meta.yaml | 60 ++++++++++++++++++++++++++++ conda-recipe/run_test.py | 4 ++ 6 files changed, 108 insertions(+) create mode 100644 conda-recipe/bld.bat create mode 100644 conda-recipe/build.sh create mode 100644 conda-recipe/conda_build_config.yaml create mode 100644 conda-recipe/meta.yaml create mode 100644 conda-recipe/run_test.py diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 1408788d..8aedd156 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -14,6 +14,7 @@ repos: rev: v4.6.0 hooks: - id: check-yaml + exclude: ^conda-recipe/meta\.yaml$ - id: end-of-file-fixer - id: trailing-whitespace exclude: '\.(rst|txt)$' diff --git a/conda-recipe/bld.bat b/conda-recipe/bld.bat new file mode 100644 index 00000000..3038f794 --- /dev/null +++ b/conda-recipe/bld.bat @@ -0,0 +1,7 @@ +%PYTHON% -m easy_install --no-deps . +if errorlevel 1 exit 1 + +:: Add more build steps here, if they are necessary. + +:: See http://docs.continuum.io/conda/build.html +:: for a list of environment variables that are set during the build process. diff --git a/conda-recipe/build.sh b/conda-recipe/build.sh new file mode 100644 index 00000000..70ddaf82 --- /dev/null +++ b/conda-recipe/build.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +# Produce stripped binaries on Linux. +if [[ "$(uname)" == Linux ]]; then + # conda-build does not set LDFLAGS on Linux. + export LDFLAGS="-s" +fi + +# allow use of default SDK on travis +if [[ "$(id -un)" == travis ]]; then + unset CONDA_BUILD_SYSROOT +# print informative message if SDK is not installed +elif [[ "$(uname)" == Darwin ]]; then + if [[ ! -e $CONDA_BUILD_SYSROOT ]]; then + echo "Please install macOS SDK to $CONDA_BUILD_SYSROOT" + exit 2 + fi +fi + +$PYTHON -m easy_install --no-deps . + +# Add more build steps here, if they are necessary. + +# See http://docs.continuum.io/conda/build.html +# for a list of environment variables that are set during the build process. diff --git a/conda-recipe/conda_build_config.yaml b/conda-recipe/conda_build_config.yaml new file mode 100644 index 00000000..4244b05c --- /dev/null +++ b/conda-recipe/conda_build_config.yaml @@ -0,0 +1,11 @@ +python: + - 3.12 + - 3.11 + - 3.10 + - 3.9 + - 3.8 + - 3.7 + - 2.7 + +gsl: + - 2.4 diff --git a/conda-recipe/meta.yaml b/conda-recipe/meta.yaml new file mode 100644 index 00000000..9296ff4e --- /dev/null +++ b/conda-recipe/meta.yaml @@ -0,0 +1,60 @@ +{% set setupdata = load_setup_py_data() %} + +package: + name: diffpy.pdffit2 + version: {{ setupdata['version'] }} + +source: + # git_url: https://github.com/diffpy/diffpy.pdffit2.git + git_url: .. + +build: + preserve_egg_dir: True + + # If this is a new build for the same version, increment the build + # number. If you do not include this key, it defaults to 0. + number: 0 + +requirements: + build: + - {{ compiler('cxx') }} # [py3k or not win] + - gsl {{ gsl }} + host: + - python {{ python }} + - pip + - setuptools + + run: + - python + - setuptools + - six + - diffpy.structure >=3 + +test: + # Python imports + imports: + - diffpy + - diffpy.pdffit2 + - diffpy.pdffit2.ipy_ext + - diffpy.pdffit2.tests + + # commands: + # You can put test commands to be run here. Use this to test that the + # entry points work. + + + # You can also put a file called run_test.py in the recipe that will be run + # at test time. + + # requires: + # Put any additional test requirements here. For example + # - nose + +about: + home: https://github.com/diffpy/diffpy.pdffit2 + summary: PDFfit2 - real space structure refinement program + license: Modified BSD License + license_file: LICENSE.txt + +# See http://docs.continuum.io/conda/build.html +# for more information about meta.yaml. diff --git a/conda-recipe/run_test.py b/conda-recipe/run_test.py new file mode 100644 index 00000000..f7099645 --- /dev/null +++ b/conda-recipe/run_test.py @@ -0,0 +1,4 @@ +#!/usr/bin/env python + +import diffpy.pdffit2.tests +assert diffpy.pdffit2.tests.test().wasSuccessful() From a505e23fd52204fcad26386ea549a203b8163f5e Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 23 Jul 2024 20:35:56 +0000 Subject: [PATCH 15/15] [pre-commit.ci] auto fixes from pre-commit hooks --- conda-recipe/run_test.py | 1 + 1 file changed, 1 insertion(+) diff --git a/conda-recipe/run_test.py b/conda-recipe/run_test.py index f7099645..1432eed6 100644 --- a/conda-recipe/run_test.py +++ b/conda-recipe/run_test.py @@ -1,4 +1,5 @@ #!/usr/bin/env python import diffpy.pdffit2.tests + assert diffpy.pdffit2.tests.test().wasSuccessful()