Skip to content

Commit 6286a4d

Browse files
authored
Merge pull request #25 from stevenhua0320/doc-2
skpkg: change README, license coverage year, and other files to scikit level-5 standard
2 parents ef4a19a + 2082643 commit 6286a4d

File tree

8 files changed

+326
-63
lines changed

8 files changed

+326
-63
lines changed

AUTHORS.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
Authors
2+
=======
3+
4+
Xiaohao Yang and Billinge Group members
5+
6+
Contributors
7+
------------
8+
9+
For a list of contributors, visit
10+
https://github.com/diffpy/diffpy.srxplanar/graphs/contributors

CHANGELOG.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
=============
2+
Release notes
3+
=============
4+
5+
.. current developments

CODE-OF-CONDUCT.rst

Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
=====================================
2+
Contributor Covenant Code of Conduct
3+
=====================================
4+
5+
Our Pledge
6+
----------
7+
8+
We as members, contributors, and leaders pledge to make participation in our
9+
community a harassment-free experience for everyone, regardless of age, body
10+
size, visible or invisible disability, ethnicity, sex characteristics, gender
11+
identity and expression, level of experience, education, socioeconomic status,
12+
nationality, personal appearance, race, caste, color, religion, or sexual
13+
identity and orientation.
14+
15+
We pledge to act and interact in ways that contribute to an open, welcoming,
16+
diverse, inclusive, and healthy community.
17+
18+
Our Standards
19+
-------------
20+
21+
Examples of behavior that contributes to a positive environment for our
22+
community include:
23+
24+
* Demonstrating empathy and kindness toward other people
25+
* Being respectful of differing opinions, viewpoints, and experiences
26+
* Giving and gracefully accepting constructive feedback
27+
* Accepting responsibility and apologizing to those affected by our mistakes,
28+
and learning from the experience
29+
* Focusing on what is best not just for us as individuals, but for the overall
30+
community
31+
32+
Examples of unacceptable behavior include:
33+
34+
* The use of sexualized language or imagery, and sexual attention or advances of
35+
any kind
36+
* Trolling, insulting or derogatory comments, and personal or political attacks
37+
* Public or private harassment
38+
* Publishing others' private information, such as a physical or email address,
39+
without their explicit permission
40+
* Other conduct which could reasonably be considered inappropriate in a
41+
professional setting
42+
43+
Enforcement Responsibilities
44+
----------------------------
45+
46+
Community leaders are responsible for clarifying and enforcing our standards of
47+
acceptable behavior and will take appropriate and fair corrective action in
48+
response to any behavior that they deem inappropriate, threatening, offensive,
49+
or harmful.
50+
51+
Community leaders have the right and responsibility to remove, edit, or reject
52+
comments, commits, code, wiki edits, issues, and other contributions that are
53+
not aligned to this Code of Conduct, and will communicate reasons for moderation
54+
decisions when appropriate.
55+
56+
Scope
57+
-----
58+
59+
This Code of Conduct applies within all community spaces, and also applies when
60+
an individual is officially representing the community in public spaces.
61+
Examples of representing our community include using an official email address,
62+
posting via an official social media account, or acting as an appointed
63+
representative at an online or offline event.
64+
65+
Enforcement
66+
-----------
67+
68+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
69+
reported to the community leaders responsible for enforcement at
70+
sb2896@columbia.edu. All complaints will be reviewed and investigated promptly and fairly.
71+
72+
All community leaders are obligated to respect the privacy and security of the
73+
reporter of any incident.
74+
75+
Enforcement Guidelines
76+
----------------------
77+
78+
Community leaders will follow these Community Impact Guidelines in determining
79+
the consequences for any action they deem in violation of this Code of Conduct:
80+
81+
1. Correction
82+
****************
83+
84+
**Community Impact**: Use of inappropriate language or other behavior deemed
85+
unprofessional or unwelcome in the community.
86+
87+
**Consequence**: A private, written warning from community leaders, providing
88+
clarity around the nature of the violation and an explanation of why the
89+
behavior was inappropriate. A public apology may be requested.
90+
91+
2. Warning
92+
*************
93+
94+
**Community Impact**: A violation through a single incident or series of
95+
actions.
96+
97+
**Consequence**: A warning with consequences for continued behavior. No
98+
interaction with the people involved, including unsolicited interaction with
99+
those enforcing the Code of Conduct, for a specified period of time. This
100+
includes avoiding interactions in community spaces as well as external channels
101+
like social media. Violating these terms may lead to a temporary or permanent
102+
ban.
103+
104+
3. Temporary Ban
105+
******************
106+
107+
**Community Impact**: A serious violation of community standards, including
108+
sustained inappropriate behavior.
109+
110+
**Consequence**: A temporary ban from any sort of interaction or public
111+
communication with the community for a specified period of time. No public or
112+
private interaction with the people involved, including unsolicited interaction
113+
with those enforcing the Code of Conduct, is allowed during this period.
114+
Violating these terms may lead to a permanent ban.
115+
116+
4. Permanent Ban
117+
******************
118+
119+
**Community Impact**: Demonstrating a pattern of violation of community
120+
standards, including sustained inappropriate behavior, harassment of an
121+
individual, or aggression toward or disparagement of classes of individuals.
122+
123+
**Consequence**: A permanent ban from any sort of public interaction within the
124+
community.
125+
126+
Attribution
127+
-----------
128+
129+
This Code of Conduct is adapted from the `Contributor Covenant <https://www.contributor-covenant.org/version/2/1/code_of_conduct.html>`_.
130+
131+
Community Impact Guidelines were inspired by `Mozilla's code of conduct enforcement ladder <https://github.com/mozilla/inclusion>`_.
132+
133+
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>`_

LICENSE.rst

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
BSD 3-Clause License
2+
3+
Copyright (c) 2008-2025, The Trustees of Columbia University in the City of New York.
4+
Copyright (c) 1994-2014, Christoph Gohlke
5+
All rights reserved.
6+
7+
Redistribution and use in source and binary forms, with or without
8+
modification, are permitted provided that the following conditions are met:
9+
10+
1. Redistributions of source code must retain the above copyright notice, this
11+
list of conditions and the following disclaimer.
12+
13+
2. Redistributions in binary form must reproduce the above copyright notice,
14+
this list of conditions and the following disclaimer in the documentation
15+
and/or other materials provided with the distribution.
16+
17+
3. Neither the name of the copyright holder nor the names of its contributors
18+
may be used to endorse or promote products derived from this software
19+
without specific prior written permission.
20+
21+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
22+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
23+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
24+
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
25+
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26+
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
27+
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
28+
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
29+
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30+
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.

MANIFEST.in

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
1-
recursive-include diffpy *
2-
include AUTHORS.txt LICENSE.txt README.md
3-
include setup.cfg
4-
exclude MANIFEST.in
5-
recursive-exclude diffpy *.pyc
1+
graft src
2+
graft tests
3+
graft requirements
4+
5+
include AUTHORS.rst LICENSE*.rst README.rst
6+
7+
# Exclude all bytecode files and __pycache__ directories
8+
global-exclude *.py[cod] # Exclude all .pyc, .pyo, and .pyd files.
9+
global-exclude .DS_Store # Exclude Mac filesystem artifacts.
10+
global-exclude __pycache__ # Exclude Python cache directories.
11+
global-exclude .git* # Exclude git files and directories.
12+
global-exclude .idea # Exclude PyCharm project settings.

README.rst

Lines changed: 90 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -1,95 +1,127 @@
1-
diffpy.srxplanar
2-
========================================================================
1+
|Icon| |title|_
2+
===============
3+
4+
.. |title| replace:: diffpy.srxplanar
5+
.. _title: https://diffpy.github.io/diffpy.srxplanar
6+
7+
.. |Icon| image:: https://avatars.githubusercontent.com/diffpy
8+
:target: https://diffpy.github.io/diffpy.srxplanar
9+
:height: 100px
10+
11+
|PyPI| |Forge| |PythonVersion| |PR|
12+
13+
|CI| |Codecov| |Black| |Tracking|
14+
15+
.. |Black| image:: https://img.shields.io/badge/code_style-black-black
16+
:target: https://github.com/psf/black
17+
18+
.. |CI| image:: https://github.com/diffpy/diffpy.cmi/actions/workflows/matrix-and-codecov-on-merge-to-main.yml/badge.svg
19+
:target: https://github.com/diffpy/diffpy.cmi/actions/workflows/matrix-and-codecov-on-merge-to-main.yml
20+
21+
.. |Codecov| image:: https://codecov.io/gh/diffpy/diffpy.srxplanar/branch/main/graph/badge.svg
22+
:target: https://codecov.io/gh/diffpy/diffpy.srxplanar
23+
24+
.. |Forge| image:: https://img.shields.io/conda/vn/conda-forge/diffpy.cmi
25+
:target: https://anaconda.org/conda-forge/diffpy.srxplanar
26+
27+
.. |PR| image:: https://img.shields.io/badge/PR-Welcome-29ab47ff
28+
:target: https://github.com/diffpy/diffpy.srxplanar/pulls
29+
30+
.. |PyPI| image:: https://img.shields.io/pypi/v/diffpy.srxplanar
31+
:target: https://pypi.org/project/diffpy.srxplanar/
32+
33+
.. |PythonVersion| image:: https://img.shields.io/pypi/pyversions/diffpy.srxplanar
34+
:target: https://pypi.org/project/diffpy.srxplanar/
35+
36+
.. |Tracking| image:: https://img.shields.io/badge/issue_tracking-github-blue
37+
:target: https://github.com/diffpy/diffpy.srxplanar/issues
38+
39+
This is part of xPDFsuite package.
340

441
diffpy.srxplanar package provides 2D diffraction image integration using
542
non splitting pixel algorithm. And it can estimate and propagate statistic
6-
uncertainty of raw counts and integrated intensity. If you are using this
7-
software. If you use this program to do productive scientific research that
43+
uncertainty of raw counts and integrated intensity.
44+
45+
To learn more about diffpy.srxplanar library, see the examples directory
46+
included in this distribution or the API documentation at
47+
48+
http://diffpy.github.io/diffpy.srxplanar/
49+
50+
For more information about the diffpy.srxplanar library, please consult our `online documentation <https://diffpy.github.io/diffpy.srxplanar>`_.
51+
52+
Citation
53+
--------
54+
55+
If you use this program to do productive scientific research that
856
leads to publication, we kindly ask that you acknowledge use of the program
957
by citing the following paper in your publication:
1058

1159
Xiaohao Yang, Pavol Juhas, Simon J. L. Billinge, On the estimation of
1260
statistical uncertainties on powder diffraction and small angle
1361
scattering data from 2-D x-ray detectors, arXiv:1309.3614
1462

15-
To learn more about diffpy.srxplanar library, see the examples directory
16-
included in this distribution or the API documentation at
17-
18-
http://diffpy.github.io/diffpy.srxplanar/
63+
Installation
64+
------------
1965

20-
REQUIREMENTS
21-
------------------------------------------------------------------------
66+
The preferred method is to be installed with `xpdfsuite` package or the wheel file.
2267

23-
The diffpy.srxplanar requires Python 2.6 or 2.7 and the following software:
68+
To install the package with the wheel file, you can first download the wheel file, then type
2469

25-
* `setuptools` >=0.61(https://pypi.python.org/pypi/setuptools)
26-
* `numpy` >=1.60(http://www.numpy.org/)
27-
* `scipy` >=1.10(www.scipy.org/)
28-
* `FabIO` >=0.80(http://sourceforge.net/projects/fable/files/fabio/)
70+
`pip install /path/to/diffpy.srxplanar-X.Y.Z-py3-none-any.whl`.
2971

30-
If your python version < 2.7 (these two packages are included in 2.7 but not in 2.6)
3172

32-
* `ordereddict` https://pypi.python.org/pypi/ordereddict
33-
* `argparse` https://pypi.python.org/pypi/argparse
73+
This package also provides command-line utilities. To check the software has been installed correctly, type ::
3474

35-
On Ubuntu Linux the part of required software can be easily installed using
36-
the system package manager::
75+
diffpy.srxplanar --version
3776

38-
sudo aptitude install \
39-
python-setuptools python-numpy python-scipy
77+
You can also type the following command to verify the installation. ::
4078

41-
For Mac OS X machine with the MacPorts package manager one could do::
79+
python -c "import diffpy.srxplanar; print(diffpy.srxplanar.__version__)"
4280

43-
sudo port install \
44-
python27 py27-setuptools py27-numpy py27-scipy
4581

46-
When installing with MacPorts, make sure the MacPorts bin directory is the
47-
first in the system PATH and that python27 is selected as the default
48-
Python version in MacPorts::
82+
To view the basic usage and available commands, type ::
4983

50-
sudo port select --set python python27
84+
diffpy.srxplanar -h
5185

52-
For other Linux distributions use their respective package manager; note
53-
the packages may have slightly different names. diffpy.srxplanar should work
54-
on other Unix-like operating systems as well. Please, search the
55-
web for instructions how to install external dependencies on your particular
56-
system.
86+
Getting Started
87+
---------------
5788

58-
For other packages, please go to the webpage list above to download and install.
89+
You may consult our `online documentation <https://diffpy.github.io/diffpy.srxplanar>`_ for tutorials and API references.
5990

91+
Support and Contribute
92+
----------------------
6093

61-
INSTALLATION
62-
------------------------------------------------------------------------
94+
If you see a bug or want to request a feature, please `report it as an issue <https://github.com/diffpy/diffpy.srxplanar/issues>`_ and/or `submit a fix as a PR <https://github.com/diffpy/diffpy.srxplanar/pulls>`_.
6395

64-
To install the diffpy.srxplanar package::
96+
Feel free to fork the project. To install diffpy.srxplanar
97+
in a development mode, with its sources being directly used by Python
98+
rather than copied to a package directory, use the following in the root
99+
directory ::
65100

66-
python setup.py install
101+
pip install -e .
67102

68-
By default the files are installed in the system directories, which are
69-
usually only writeable by the root. See the usage info
70-
"./setup.py install --help" for options to install as a normal user under
71-
different location. Note that installation to non-standard directories may
72-
require adjustments to the PATH and PYTHONPATH environment variables.
103+
To ensure code quality and to prevent accidental commits into the default branch, please set up the use of our pre-commit
104+
hooks.
73105

74-
DEVELOPMENT
75-
------------------------------------------------------------------------
106+
1. Install pre-commit in your working environment by running ``conda install pre-commit``.
76107

77-
diffpy.srxplanar is an open-source software developed at the Columbia University
78-
The diffpy.srxplanar sources are hosted at
108+
2. Initialize pre-commit (one time only) ``pre-commit install``.
79109

80-
https://github.com/diffpy/diffpy.srxplanar
110+
Thereafter your code will be linted by black and isort and checked against flake8 before you can commit.
111+
If it fails by black or isort, just rerun and it should pass (black and isort will modify the files so should
112+
pass after they are modified). If the flake8 test fails please see the error messages and fix them manually before
113+
trying to commit again.
81114

82-
Feel free to fork the project and contribute. To install diffpy.srxplanar
83-
in a development mode, where the sources are directly used by Python
84-
rather than copied to a system directory, use::
115+
Improvements and fixes are always appreciated.
85116

86-
python setup.py develop --user
117+
Before contributing, please read our `Code of Conduct <https://github.com/diffpy/diffpy.srxplanar/blob/main/CODE-OF-CONDUCT.rst>`_.
87118

88-
CONTACTS
89-
------------------------------------------------------------------------
119+
Contact
120+
-------
90121

91-
For more information on diffpy.srxplanar please visit the project web-page:
122+
For more information on diffpy.srxplanar please visit the project `web-page <https://diffpy.github.io/>`_ or email Simon Billinge at sb2896@columbia.edu.
92123

93-
http://www.diffpy.org/
124+
Acknowledgements
125+
----------------
94126

95-
or email Prof. Simon Billinge at sb2896@columbia.edu
127+
``diffpy.srxplanar`` is built and maintained with `scikit-package <https://scikit-package.github.io/scikit-package/>`_.

0 commit comments

Comments
 (0)