Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .flake8
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
# As of now, flake8 does not natively support configuration via pyproject.toml
# https://github.com/microsoft/vscode-flake8/issues/135
[flake8]
exclude =
.git,
__pycache__,
build,
dist,
doc/source/conf.py
docs/source/conf.py
max-line-length = 115
# Ignore some style 'errors' produced while formatting by 'black'
# https://black.readthedocs.io/en/stable/guides/using_black_with_other_tools.html#labels-why-pycodestyle-warnings
Expand Down
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/release_checklist.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ Please let the maintainer know that all checks are done and the package is ready
<!-- After the maintainer releases the PyPI package, please check the following when creating a PR for conda-forge release.-->

- [ ] Ensure that the full release has appeared on PyPI successfully.
- [ ] New package dependencies listed in `conda.txt` and `test.txt` are added to `meta.yaml` in the feedstock.
- [ ] New package dependencies listed in `conda.txt` and `tests.txt` are added to `meta.yaml` in the feedstock.
- [ ] Close any open issues on the feedstock. Reach out to the maintainer if you have questions.
- [ ] Tag the maintainer for conda-forge release.

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-wheel-release-upload.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
- "*" # Trigger on all tags initially, but tag and release privilege are verified in _build-wheel-release-upload.yml

jobs:
release:
build-release:
uses: scikit-package/release-scripts/.github/workflows/_build-wheel-release-upload.yml@v0
with:
project: diffpy.pdffit2
Expand Down
1 change: 1 addition & 0 deletions .isort.cfg
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
[settings]
# Keep import statement below line_length character limit
line_length = 115
multi_line_output = 3
include_trailing_comma = True
2 changes: 1 addition & 1 deletion .readthedocs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ python:
- requirements: requirements/docs.txt

sphinx:
configuration: doc/source/conf.py
configuration: docs/source/conf.py
133 changes: 133 additions & 0 deletions CODE-OF-CONDUCT.rst
Original file line number Diff line number Diff line change
@@ -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, socioeconomic 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 <https://www.contributor-covenant.org/version/2/1/code_of_conduct.html>`_.

Community Impact Guidelines were inspired by `Mozilla's code of conduct enforcement ladder <https://github.com/mozilla/inclusion>`_.

For answers to common questions about this code of conduct, see the `FAQ <https://www.contributor-covenant.org/faq>`_. `Translations are available <https://www.contributor-covenant.org/translations>`_
52 changes: 23 additions & 29 deletions LICENSE.rst
Original file line number Diff line number Diff line change
Expand Up @@ -21,32 +21,26 @@ For more information please visit the project web-page:
or email Prof. Simon Billinge at sb2896@columbia.edu

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:

* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.

* Redistributions in binary form must reproduce the above copyright
notice, this list of conditions and the following disclaimer in the
documentation and/or other materials provided with the distribution.

* Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY COPYRIGHT HOLDER "AS IS". COPYRIGHT HOLDER
EXPRESSLY DISCLAIMS ANY AND ALL WARRANTIES AND CONDITIONS, EITHER
EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY, TITLE, FITNESS, ADEQUACY OR SUITABILITY
FOR A PARTICULAR PURPOSE, AND ANY WARRANTIES OF FREEDOM FROM
INFRINGEMENT OF ANY DOMESTIC OR FOREIGN PATENT, COPYRIGHTS, TRADE
SECRETS OR OTHER PROPRIETARY RIGHTS OF ANY PARTY. IN NO EVENT SHALL
COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR ANY DIRECT, INDIRECT,
INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
THIS SOFTWARE OR RELATING TO THIS AGREEMENT, EVEN IF ADVISED OF THE
POSSIBILITY OF SUCH DAMAGE.
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its contributors
may be used to endorse or promote products derived from this software
without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
18 changes: 18 additions & 0 deletions cookiecutter.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
{
"maintainer_name": "Simon Billinge",
"maintainer_email": "sb2896@columbia.edu",
"maintainer_github_username": "sbillinge",
"contributors": "Pavol Juhas, Chris Farrow, Simon Billinge, Billinge Group members",
"license_holders": "The Trustees of Columbia University in the City of New York",
"project_name": "diffpy.pdffit2",
"github_username_or_orgname": "diffpy",
"github_repo_name": "diffpy.pdffit2",
"conda_pypi_package_dist_name": "diffpy.pdffit2",
"package_dir_name": "diffpy.pdffit2",
"project_short_description": "PDFfit2 - real space structure refinement program.",
"project_keywords": "PDF, structure refinement",
"minimum_supported_python_version": "3.11",
"maximum_supported_python_version": "3.13",
"project_needs_c_code_compiled": "Yes",
"project_has_gui_tests": "No"
}
13 changes: 7 additions & 6 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/usr/bin/env python
# -*- coding: utf-8 -*-
#
# diffpy.pdffit2 documentation build configuration file, created by
# diffpy.pdffit2 documentation build configuration file, created by # noqa: E501
# sphinx-quickstart on Thu Jan 30 15:49:41 2014.
#
# This file is execfile()d with the current directory set to its
Expand All @@ -22,17 +22,19 @@
try:
fullversion = version("diffpy.pdffit2")
except Exception:
fullversion = "No version found. The correct version will appear in the released version."
fullversion = "No version found. The correct version will appear in the released version." # noqa: E501

# If extensions (or modules to document with autodoc) are in another directory,
# add these directories to sys.path here. If the directory is relative to the
# documentation root, use Path().resolve() to make it absolute, like shown here.
# documentation root, use Path().resolve() to make it absolute, like shown here. # noqa: E501
# sys.path.insert(0, str(Path(".").resolve()))
sys.path.insert(0, str(Path("../..").resolve()))
sys.path.insert(0, str(Path("../../src").resolve()))

# abbreviations
ab_authors = "Billinge group and community members."
ab_authors = (
"Pavol Juhas, Chris Farrow, Simon Billinge, Billinge Group members"
)

# -- General configuration ------------------------------------------------

Expand All @@ -56,7 +58,6 @@
autodoc_mock_imports = [
"diffpy.pdffit2.pdffit2",
]

# Add any paths that contain templates here, relative to this directory.
templates_path = ["_templates"]

Expand Down Expand Up @@ -144,7 +145,7 @@
"github_user": "diffpy",
"github_repo": "diffpy.pdffit2",
"github_version": "main",
"conf_py_path": "/doc/source/",
"conf_py_path": "/docs/source/",
}

# Theme options are theme-specific and customize the look and feel of a theme
Expand Down
33 changes: 33 additions & 0 deletions src/diffpy/pdffit2/pdffit2_app.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import argparse

from diffpy.pdffit2.version import __version__ # noqa


def main():
parser = argparse.ArgumentParser(
prog="diffpy.pdffit2",
description=(
"PDFfit2 - real space structure refinement program.\n\n"
"For more information, visit: "
"https://github.com/diffpy/diffpy.pdffit2/"
),
formatter_class=argparse.RawDescriptionHelpFormatter,
)

parser.add_argument(
"--version",
action="store_true",
help="Show the program's version number and exit",
)

args = parser.parse_args()

if args.version:
print(f"diffpy.pdffit2 {__version__}")
else:
# Default behavior when no arguments are given
parser.print_help()


if __name__ == "__main__":
main()
2 changes: 1 addition & 1 deletion tests/test_version.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"""Unit tests for __version__.py."""

import diffpy.pdffit2
import diffpy.pdffit2 # noqa


def test_package_version():
Expand Down
Loading