Skip to content

Commit 15bdf3f

Browse files
add untrack files in cookiecutter (#117)
* add untrack files in cookiecutter * add .gitignore & .pre-commit-config.yaml to cookiecutter * [pre-commit.ci] auto fixes from pre-commit hooks --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent c856057 commit 15bdf3f

11 files changed

+228
-66
lines changed

Diff for: .github/workflows/check-news-item.yml

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: Check for News
2+
3+
on:
4+
pull_request_target:
5+
branches:
6+
- main
7+
8+
jobs:
9+
build:
10+
uses: Billingegroup/release-scripts/.github/workflows/_check-news-item.yml@v0
11+
with:
12+
project: diffpy.srmise
+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
release:
8+
types:
9+
- prereleased
10+
- published
11+
workflow_dispatch:
12+
13+
jobs:
14+
coverage:
15+
uses: Billingegroup/release-scripts/.github/workflows/_matrix-and-codecov-on-merge-to-main.yml@v0
16+
with:
17+
project: diffpy.srmise
18+
c_extension: false
19+
headless: false
20+
secrets:
21+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}

Diff for: .github/workflows/publish-docs-on-release.yml

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: Build and Deploy Docs
2+
3+
on:
4+
release:
5+
types:
6+
- published
7+
workflow_dispatch:
8+
9+
jobs:
10+
docs:
11+
uses: Billingegroup/release-scripts/.github/workflows/_publish-docs-on-release.yml@v0
12+
with:
13+
project: diffpy.srmise
14+
c_extension: false

Diff for: .github/workflows/tests-on-pr.yml

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
name: Tests on PR
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
workflow_dispatch:
9+
10+
jobs:
11+
validate:
12+
uses: Billingegroup/release-scripts/.github/workflows/_tests-on-pr.yml@v0
13+
with:
14+
project: diffpy.srmise
15+
c_extension: false
16+
headless: false

Diff for: .gitignore

+73-18
Original file line numberDiff line numberDiff line change
@@ -1,44 +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
40-
.settings
62+
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
4193

4294
# version information
4395
setup.cfg
44-
/diffpy/srmise/version.cfg
96+
/src/diffpy/*/version.cfg
97+
98+
# Rever
99+
rever/

Diff for: .pre-commit-config.yaml

+4-1
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,10 @@ repos:
1616
- id: check-yaml
1717
- id: end-of-file-fixer
1818
- id: trailing-whitespace
19-
exclude: '\.(rst|txt)$'
19+
- id: check-case-conflict
20+
- id: check-merge-conflict
21+
- id: check-toml
22+
- id: check-added-large-files
2023
- repo: https://github.com/psf/black
2124
rev: 24.4.2
2225
hooks:

Diff for: doc/manual/source/extending.rst

+12-12
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,14 @@ subpackges, as shown below.
2727
* .. py:class:: BaseFunction
2828

2929
+ .. py:class:: BaselineFunction
30-
30+
3131
- .. py:class:: FromSequence
3232
- .. py:class:: NanoSpherical
3333
- .. py:class:: Polynomial
3434
- *etc.*
35-
35+
3636
+ .. py:class:: PeakFunction
37-
37+
3838
- .. py:class:: Gaussian
3939
- .. py:class:: GaussianOverR
4040
- *etc.*
@@ -57,7 +57,7 @@ for examples.
5757
.. py:method:: estimate_parameters(r, y)
5858
5959
Return a Numpy array of parameters estimated from the data.
60-
60+
6161
:param r: Grid on which the data are defined.
6262
:param y: The data.
6363
:type r: `Sequence`
@@ -69,9 +69,9 @@ for examples.
6969

7070

7171
.. py:method:: _jacobian_raw(pars, r, free)
72-
72+
7373
Return Jacobian for parameters evaluated over `r`.
74-
74+
7575
:param pars: The parameters of the baseline.
7676
:param r: Scalar or grid on which to calculate the Jacobian.
7777
:param free: Boolean values indicating if corresponding parameter is free (True) or fixed (False).
@@ -84,7 +84,7 @@ for examples.
8484
.. py:method:: _transform_derivativesraw(pars, in_format, out_format)
8585
8686
Return the gradient matrix of `pars` represented in format 'out_format'.
87-
87+
8888
:param pars: The parameters of the baseline.
8989
:param in_format: The format of `pars`.
9090
:param out_format: The desired format of `pars`.
@@ -97,7 +97,7 @@ for examples.
9797
.. py:method:: _transform_parametersraw(pars, in_format, out_format)
9898
9999
Return parameters transformed into format 'out_format'.
100-
100+
101101
:param pars: The parameters of the baseline.
102102
:param in_format: The format of `pars`.
103103
:param out_format: The desired format of `pars`.
@@ -106,11 +106,11 @@ for examples.
106106
:type out_format: `str`
107107
:returns: The transformed parameters.
108108
:rtype: `numpy.ndarray`
109-
109+
110110
.. py:method:: _valueraw(pars, r)
111111
112112
Return value of baseline with given parameters at r.
113-
113+
114114
:param pars: The parameters of the baseline.
115115
:param r: Scalar or grid on which to calculate the baseline.
116116
:type pars: `Sequence(float)`
@@ -130,12 +130,12 @@ following differences:
130130
1) The ``estimate_parameters`` method is required.
131131
2) The "position" key must be defined in the ``parameterdict`` class member.
132132
3) Peak functions must implement the additional method ``scale_at``.
133-
133+
134134
.. py:method:: scale_at(pars, r, scale)
135135
136136
Return peak parameters such that the value at ``r`` is scaled by ``scale``
137137
while the position of the peak's maxima remains unchanged.
138-
138+
139139
:param pars: The parameters of the peak.
140140
:param r: Position where the peak will be rescaled.
141141
:param scale: A scale factor > 0.

Diff for: doc/manual/source/index.rst

+33-33
Original file line numberDiff line numberDiff line change
@@ -10,38 +10,38 @@ Last updated |today|.
1010

1111
Tool for unbiased peak extraction from atomic pair distribution functions.
1212

13-
The diffpy.srmise package is an implementation of the `ParSCAPE algorithm
14-
<https://dx.doi.org/10.1107/S2053273315005276>`_ for peak extraction from
15-
atomic pair distribution functions (PDFs). It is designed to function even
16-
when *a priori* knowledge of the physical sample is limited, utilizing the
17-
Akaike Information Criterion (AIC) to estimate whether peaks are
18-
statistically justified relative to alternate models. Three basic use cases
19-
are anticipated for diffpy.srmise. The first is peak fitting a user-supplied
20-
collections of peaks. The second is peak extraction from a PDF with no (or
21-
only partial) user-supplied peaks. The third is an AIC-driven multimodeling
22-
analysis where the output of multiple diffpy.srmise trials are ranked.
23-
24-
The framework for peak extraction defines peak-like clusters within the data,
25-
extracts a single peak within each cluster, and iteratively combines nearby
26-
clusters while performing a recursive search on the residual to identify
27-
occluded peaks. Eventually this results in a single global cluster
28-
containing many peaks fit over all the data. Over- and underfitting are
29-
discouraged by use of the AIC when adding or removing (during a pruning step)
30-
peaks. Termination effects, which can lead to physically spurious peaks in
31-
the PDF, are incorporated in the mathematical peak model and the pruning step
32-
attempts to remove peaks which are fit better as termination ripples due to
33-
another peak.
34-
35-
Where possible, diffpy.srmise provides physically reasonable default values
36-
for extraction parameters. However, the PDF baseline should be estimated by
37-
the user before extraction, or by performing provisional peak extraction with
38-
varying baseline parameters. The package defines a linear (crystalline)
39-
baseline, arbitrary polynomial baseline, a spherical nanoparticle baseline,
40-
and an arbitrary baseline interpolated from a list of user-supplied values.
41-
In addition, PDFs with accurate experimentally-determined uncertainties are
42-
necessary to provide the most reliable results, but historically such PDFs
43-
are rare. In the absence of accurate uncertainties an ad hoc uncertainty
44-
must be specified.
13+
The diffpy.srmise package is an implementation of the `ParSCAPE algorithm
14+
<https://dx.doi.org/10.1107/S2053273315005276>`_ for peak extraction from
15+
atomic pair distribution functions (PDFs). It is designed to function even
16+
when *a priori* knowledge of the physical sample is limited, utilizing the
17+
Akaike Information Criterion (AIC) to estimate whether peaks are
18+
statistically justified relative to alternate models. Three basic use cases
19+
are anticipated for diffpy.srmise. The first is peak fitting a user-supplied
20+
collections of peaks. The second is peak extraction from a PDF with no (or
21+
only partial) user-supplied peaks. The third is an AIC-driven multimodeling
22+
analysis where the output of multiple diffpy.srmise trials are ranked.
23+
24+
The framework for peak extraction defines peak-like clusters within the data,
25+
extracts a single peak within each cluster, and iteratively combines nearby
26+
clusters while performing a recursive search on the residual to identify
27+
occluded peaks. Eventually this results in a single global cluster
28+
containing many peaks fit over all the data. Over- and underfitting are
29+
discouraged by use of the AIC when adding or removing (during a pruning step)
30+
peaks. Termination effects, which can lead to physically spurious peaks in
31+
the PDF, are incorporated in the mathematical peak model and the pruning step
32+
attempts to remove peaks which are fit better as termination ripples due to
33+
another peak.
34+
35+
Where possible, diffpy.srmise provides physically reasonable default values
36+
for extraction parameters. However, the PDF baseline should be estimated by
37+
the user before extraction, or by performing provisional peak extraction with
38+
varying baseline parameters. The package defines a linear (crystalline)
39+
baseline, arbitrary polynomial baseline, a spherical nanoparticle baseline,
40+
and an arbitrary baseline interpolated from a list of user-supplied values.
41+
In addition, PDFs with accurate experimentally-determined uncertainties are
42+
necessary to provide the most reliable results, but historically such PDFs
43+
are rare. In the absence of accurate uncertainties an ad hoc uncertainty
44+
must be specified.
4545

4646

4747
===================
@@ -81,7 +81,7 @@ Where next?
8181

8282
tutorial/index.rst
8383
extending.rst
84-
84+
8585
======================================
8686
API
8787
======================================

Diff for: doc/source/api/diffpy.srmise.example_package.rst

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
.. _example_package documentation:
2+
3+
|title|
4+
=======
5+
6+
.. |title| replace:: diffpy.srmise.example_package package
7+
8+
.. automodule:: diffpy.srmise.example_package
9+
:members:
10+
:undoc-members:
11+
:show-inheritance:
12+
13+
|foo|
14+
-----
15+
16+
.. |foo| replace:: diffpy.srmise.example_package.foo module
17+
18+
.. automodule:: diffpy.srmise.example_package.foo
19+
:members:
20+
:undoc-members:
21+
:show-inheritance:
22+
23+
|bar|
24+
-----
25+
26+
.. |bar| replace:: diffpy.srmise.example_package.bar module
27+
28+
.. automodule:: diffpy.srmise.example_package.foo
29+
:members:
30+
:undoc-members:
31+
:show-inheritance:

0 commit comments

Comments
 (0)