Skip to content

Commit 153f843

Browse files
committed
finishing the recut
1 parent 8a29941 commit 153f843

14 files changed

+225
-154
lines changed

.codecov.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ coverage:
2020
target: auto
2121
if_no_uploads: error
2222
if_not_found: success
23-
if_ci_failed: failure
23+
if_ci_failed: error
2424
paths: '!*/tests/.*'
2525

2626
tests:

.coveragerc

+5-24
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,13 @@
1-
# Configuration of the coverage.py tool for reporting test coverage.
2-
1+
[run]
2+
source =
3+
diffpy.utils
34
[report]
4-
# RE patterns for lines to be excluded from consideration.
5-
exclude_lines =
6-
## Have to re-enable the standard pragma
7-
pragma: no cover
8-
## Don't complain if tests don't hit defensive assertion code:
9-
raise AssertionError
10-
raise NotImplementedError
11-
^[ ]*assert False
12-
13-
## Don't complain if non-runnable code isn't run:
14-
^[ ]*@unittest.skip\b
15-
^[ ]{4}unittest.main()
16-
if __name__ == .__main__.:
175
omit =
186
*/python?.?/*
197
*/site-packages/nose/*
208
# ignore _version.py and versioneer.py
219
.*version.*
2210
*_version.py
23-
# ignore wx directory
24-
*/wx/*
2511

26-
27-
[run]
28-
source =
29-
src/diffpy/utils/
30-
omit =
31-
## exclude debug.py from codecov report
32-
*/tests/debug.py
12+
exclude_lines =
13+
if __name__ == '__main__':

.flake8

+2-3
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@ exclude =
44
__pycache__,
55
build,
66
dist,
7-
versioneer.py,
8-
doc/manual/source/conf.py
7+
doc/source/conf.py
98
max-line-length = 115
10-
# Ignore some style 'errors' produced while formatting by 'black' (see link below)
9+
# Ignore some style 'errors' produced while formatting by 'black'
1110
# https://black.readthedocs.io/en/stable/guides/using_black_with_other_tools.html#labels-why-pycodestyle-warnings
1211
extend-ignore = E203

.gitignore

+69-19
Original file line numberDiff line numberDiff line change
@@ -1,49 +1,99 @@
1+
# Byte-compiled / optimized / DLL files
2+
__pycache__/
13
*.py[cod]
4+
*$py.class
25

36
# C extensions
47
*.so
58

6-
# Packages
7-
*.egg
8-
*.egg-info
9-
dist
10-
build
11-
eggs
12-
parts
13-
bin
14-
var
15-
sdist
16-
temp
17-
develop-eggs
9+
# Distribution / packaging
10+
.Python
11+
env/
12+
build/
13+
develop-eggs/
14+
dist/
15+
downloads/
16+
eggs/
17+
.eggs/
18+
lib/
19+
lib64/
20+
parts/
21+
sdist/
22+
var/
23+
venv/
24+
*.egg-info/
1825
.installed.cfg
19-
lib
20-
lib64
21-
tags
26+
*.egg
27+
bin/
28+
temp/
29+
tags/
2230
errors.err
2331

32+
# PyInstaller
33+
# Usually these files are written by a python script from a template
34+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
35+
*.manifest
36+
*.spec
37+
2438
# Installer logs
2539
pip-log.txt
40+
pip-delete-this-directory.txt
2641
MANIFEST
2742

2843
# Unit test / coverage reports
44+
htmlcov/
45+
.tox/
2946
.coverage
30-
.tox
47+
.coverage.*
48+
.cache
3149
nosetests.xml
50+
coverage.xml
51+
*,cover
52+
.hypothesis/
3253

3354
# Translations
3455
*.mo
56+
*.pot
3557

3658
# Mr Developer
3759
.mr.developer.cfg
3860
.project
3961
.pydevproject
4062

63+
# Django stuff:
64+
*.log
65+
66+
# Sphinx documentation
67+
docs/build/
68+
docs/source/generated/
69+
70+
# pytest
71+
.pytest_cache/
72+
73+
# PyBuilder
74+
target/
75+
76+
# Editor files
77+
# mac
78+
.DS_Store
79+
*~
80+
81+
# vim
82+
*.swp
83+
*.swo
84+
85+
# pycharm
86+
.idea/
87+
88+
# VSCode
89+
.vscode/
90+
91+
# Ipython Notebook
92+
.ipynb_checkpoints
93+
4194
# version information
4295
setup.cfg
4396
/src/diffpy/*/version.cfg
4497

4598
# Rever
4699
rever/
47-
48-
# PyCharm
49-
.idea/

MANIFEST.in

+10-13
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
1-
recursive-include src *
2-
include AUTHORS.txt LICENSE*.txt README.rst
3-
recursive-exclude src *.py[co]
4-
global-exclude .gitattributes .gitignore .gitarchive.cfg
5-
global-exclude .DS_Store
1+
graft src
2+
graft tests
3+
graft requirements
64

7-
# Avoid user content in setup.cfg to make distribution reproducible.
8-
exclude setup.cfg
5+
include AUTHORS.rst LICENSE*.rst README.rst
96

10-
# Exclude git-tracked files spuriously added by setuptools_scm
11-
exclude .coveragerc
12-
exclude .travis*
13-
prune conda-recipe
14-
prune devutils
15-
prune doc
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

+73-40
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,39 @@
1-
.. image:: https://github.com/diffpy/diffpy.utils/actions/workflows/main.yml/badge.svg
2-
:target: https://github.com/diffpy/diffpy.utils/actions/workflows/main.yml
1+
|Icon| |title|_
2+
===============
33

4-
.. image:: https://codecov.io/gh/diffpy/diffpy.utils/branch/main/graph/badge.svg
5-
:target: https://codecov.io/gh/diffpy/diffpy.utils
4+
.. |title| replace:: diffpy.utils
5+
.. _title: https://diffpy.github.io/diffpy.utils
66

7+
.. |Icon| image:: https://avatars.githubusercontent.com/diffpy
8+
:target: https://diffpy.github.io/diffpy.utils
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.utils/actions/workflows/codecov-on-merge-to-main.yml/badge.svg
19+
:target: https://github.com/diffpy/diffpy.utils/actions/workflows/codecov-on-merge-to-main.yml
20+
21+
.. |Codecov| image:: https://codecov.io/gh/diffpy/diffpy.utils/branch/main/graph/badge.svg
22+
:target: https://codecov.io/gh/diffpy/diffpy.utils
23+
24+
.. |Forge| image:: https://img.shields.io/conda/vn/conda-forge/diffpy.utils
25+
:target: https://anaconda.org/conda-forge/diffpy.utils
26+
27+
.. |PR| image:: https://img.shields.io/badge/PR-Welcome-29ab47ff
28+
29+
.. |PyPi| image:: https://img.shields.io/pypi/v/diffpy.utils
30+
:target: https://pypi.org/project/diffpy.utils/
31+
32+
.. |PythonVersion| image:: https://img.shields.io/pypi/pyversions/diffpy.utils
33+
:target: https://pypi.org/project/diffpy.utils/
34+
35+
.. |Tracking| image:: https://img.shields.io/badge/issue_tracking-github-blue
36+
:target: https://github.com/diffpy/diffpy.utils/issues
737

838
diffpy.utils
939
========================================================================
@@ -16,78 +46,81 @@ program. The package also includes an interpolation function based on the
1646
Whittaker-Shannon formula that can be used to resample a PDF or other profile
1747
function over a new grid.
1848

19-
For more information about the diffpy.utils library, see the users manual at
20-
http://diffpy.github.io/diffpy.utils.
49+
Citation
50+
--------
51+
52+
If you use diffpy.utils in a scientific publication, we would like you to cite this package as
53+
54+
diffpy.utils Package, https://github.com/diffpy/diffpy.utils
2155

22-
INSTALLATION
23-
------------------------------------------------------------------------
56+
Installation
57+
------------
2458

2559
The preferred method is to use `Miniconda Python
2660
<https://docs.conda.io/projects/miniconda/en/latest/miniconda-install.html>`_
2761
and install from the "conda-forge" channel of Conda packages.
2862

2963
To add "conda-forge" to the conda channels, run the following in a terminal. ::
3064

31-
conda config --add channels conda-forge
65+
conda config --add channels conda-forge
3266

3367
We want to install our packages in a suitable conda environment.
34-
The following creates and activates a new environment named ``diffpy-utils`` ::
68+
The following creates and activates a new environment named ``diffpy.utils_env`` ::
3569

36-
conda create -n diffpy-utils python=3
37-
conda activate diffpy-utils
70+
conda create -n diffpy.utils_env python=3
71+
conda activate diffpy.utils_env
3872

3973
Then, to fully install ``diffpy.utils`` in our active environment, run ::
4074

41-
conda install diffpy.utils
75+
conda install diffpy.utils
4276

4377
Another option is to use ``pip`` to download and install the latest release from
4478
`Python Package Index <https://pypi.python.org>`_.
45-
To install using ``pip`` into your ``diffpy-utils`` environment, we will also have to install dependencies ::
79+
To install using ``pip`` into your ``diffpy.utils_env`` environment, we will also have to install dependencies ::
4680

47-
pip install numpy
48-
pip install diffpy.utils
81+
pip install -r https://raw.githubusercontent.com/diffpy/diffpy.utils/main/requirements/run.txt
4982

50-
For those planning to use functions in the ``diffpy.utils.wx`` module, you will also need to install ``wxPython``.
51-
Both of the following lines will install this package. ::
83+
and then install the package ::
5284

53-
conda install wxPython
54-
pip install wxPython
85+
pip install diffpy.utils
5586

5687
If you prefer to install from sources, after installing the dependencies, obtain the source archive from
5788
`GitHub <https://github.com/diffpy/diffpy.utils/>`_. Once installed, ``cd`` into your ``diffpy.utils`` directory
5889
and run the following ::
5990

60-
pip install .
91+
pip install .
6192

62-
To check the installation integrity, if the following passes all checks, you are good! ::
93+
Support and Contribute
94+
----------------------
6395

64-
pip install pytest
65-
python -m diffpy.utils.tests.run
96+
`Diffpy user group <https://groups.google.com/g/diffpy-users>`_ is the discussion forum for general questions and discussions about the use of diffpy.utils. Please join the diffpy.utils users community by joining the Google group. The diffpy.utils project welcomes your expertise and enthusiasm!
6697

98+
If you see a bug or want to request a feature, please `report it as an issue <https://github.com/diffpy/diffpy.utils/issues>`_ and/or `submit a fix as a PR <https://github.com/diffpy/diffpy.utils/pulls>`_. You can also post it to the `Diffpy user group <https://groups.google.com/g/diffpy-users>`_.
6799

68-
DEVELOPMENT
69-
------------------------------------------------------------------------
70-
71-
diffpy.utils is an open-source software developed as a part of the
72-
DiffPy-CMI complex modeling initiative at the Brookhaven National
73-
Laboratory. The diffpy.utils sources are hosted at
74-
https://github.com/diffpy/diffpy.utils.
75-
76-
Feel free to fork the project and contribute. To install diffpy.utils
100+
Feel free to fork the project and contribute. To install diffpy.utils
77101
in a development mode, with its sources being directly used by Python
78102
rather than copied to a package directory, use the following in the root
79103
directory ::
80104

81-
pip install -e .
105+
pip install -e .
106+
107+
To ensure code quality and to prevent accidental commits into the default branch, please set up the use of our pre-commit
108+
hooks.
109+
110+
1. Install pre-commit in your working environment by running ``conda install pre-commit``.
82111

83-
Note that this is only supported for `setuptools` version 62.0 and above.
112+
2. Initialize pre-commit (one time only) ``pre-commit install``.
84113

114+
Thereafter your code will be linted by black and isort and checked against flake8 before you can commit.
115+
If it fails by black or isort, just rerun and it should pass (black and isort will modify the files so should
116+
pass after they are modified). If the flake8 test fails please see the error messages and fix them manually before
117+
trying to commit again.
85118

86-
CONTACTS
87-
------------------------------------------------------------------------
119+
Improvements and fixes are always appreciated.
88120

89-
For more information on diffpy.utils please visit the project web-page
121+
Before contribuing, please read our `Code of Conduct <https://github.com/diffpy/diffpy.utils/blob/main/CODE_OF_CONDUCT.rst>`_.
90122

91-
http://www.diffpy.org/
123+
Contact
124+
-------
92125

93-
or email Prof. Simon Billinge at [email protected].
126+
For more information on diffpy.utils please visit the project `web-page <https://diffpy.github.io/>`_ or email Prof. Simon Billinge at [email protected].

doc/Makefile

+5-4
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ SPHINXOPTS =
66
SPHINXBUILD = sphinx-build
77
PAPER =
88
BUILDDIR = build
9+
BASENAME = $(subst .,,$(subst $() $(),,diffpy.utils))
910

1011
# User-friendly check for sphinx-build
1112
ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1)
@@ -85,17 +86,17 @@ qthelp:
8586
@echo
8687
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
8788
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
88-
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/diffpyutils.qhcp"
89+
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/$(BASENAME).qhcp"
8990
@echo "To view the help file:"
90-
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/diffpyutils.qhc"
91+
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/$(BASENAME).qhc"
9192

9293
devhelp:
9394
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
9495
@echo
9596
@echo "Build finished."
9697
@echo "To view the help file:"
97-
@echo "# mkdir -p $$HOME/.local/share/devhelp/diffpyutils"
98-
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/diffpyutils"
98+
@echo "# mkdir -p $$HOME/.local/share/devhelp/$(BASENAME)"
99+
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/$(BASENAME)"
99100
@echo "# devhelp"
100101

101102
epub:

0 commit comments

Comments
 (0)