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 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__': 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 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 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 diff --git a/AUTHORS.txt b/AUTHORS.rst similarity index 90% rename from AUTHORS.txt rename to AUTHORS.rst index 2c1d7f81..8cae8521 100644 --- a/AUTHORS.txt +++ b/AUTHORS.rst @@ -1,3 +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. @@ -9,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 @@ -30,7 +43,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 +59,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 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 +===== 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 `_ diff --git a/LICENSE.txt b/LICENSE.rst similarity index 100% rename from LICENSE.txt rename to LICENSE.rst 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 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:** + +*