Skip to content

Commit 1e3d023

Browse files
Re-cookiecut (#89)
* Move tests folder to top * Revert commit * Add codecov, remove gitattributes * Add test tests * Add .gitignore and precommit * Add MANIFEST * Add pyproject.toml * Add authors * Add requirements * Add readme * Add doc * Add 2023 to copyright in doc * Add 2023 to license.rst * [pre-commit.ci] auto fixes from pre-commit hooks * Add newds * Remove null in matrix codecov * Remove null in matrix --------- Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent c7d4910 commit 1e3d023

21 files changed

+142
-107
lines changed

Diff for: .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:

Diff for: .coveragerc

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ omit =
66
*/python?.?/*
77
*/site-packages/nose/*
88
# ignore _version.py and versioneer.py
9-
*version.*
9+
.*version.*
1010
*_version.py
1111

1212
exclude_lines =

Diff for: .gitattributes

-1
This file was deleted.

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
- main
77

88
jobs:
9-
check-news-item:
9+
build:
1010
uses: Billingegroup/release-scripts/.github/workflows/_check-news-item.yml@v0
1111
with:
1212
project: diffpy.snmf

Diff for: .github/workflows/matrix-and-codecov-on-merge-to-main.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ on:
1111
workflow_dispatch:
1212

1313
jobs:
14-
CI:
14+
coverage:
1515
uses: Billingegroup/release-scripts/.github/workflows/_matrix-and-codecov-on-merge-to-main.yml@v0
1616
with:
1717
project: diffpy.snmf

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
workflow_dispatch:
88

99
jobs:
10-
publish-docs-on-release:
10+
docs:
1111
uses: Billingegroup/release-scripts/.github/workflows/_publish-docs-on-release.yml@v0
1212
with:
1313
project: diffpy.snmf

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

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ on:
88
workflow_dispatch:
99

1010
jobs:
11-
tests-on-pr:
11+
validate:
1212
uses: Billingegroup/release-scripts/.github/workflows/_tests-on-pr.yml@v0
1313
with:
1414
project: diffpy.snmf

Diff for: .gitignore

+32-29
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,14 @@ lib64/
2020
parts/
2121
sdist/
2222
var/
23+
venv/
2324
*.egg-info/
2425
.installed.cfg
2526
*.egg
27+
bin/
28+
temp/
29+
tags/
30+
errors.err
2631

2732
# PyInstaller
2833
# Usually these files are written by a python script from a template
@@ -33,6 +38,7 @@ var/
3338
# Installer logs
3439
pip-log.txt
3540
pip-delete-this-directory.txt
41+
MANIFEST
3642

3743
# Unit test / coverage reports
3844
htmlcov/
@@ -49,48 +55,45 @@ coverage.xml
4955
*.mo
5056
*.pot
5157

58+
# Mr Developer
59+
.mr.developer.cfg
60+
.project
61+
.pydevproject
62+
5263
# Django stuff:
5364
*.log
54-
local_settings.py
55-
56-
# Flask stuff:
57-
instance/
58-
.webassets-cache
59-
60-
# Scrapy stuff:
61-
.scrapy
6265

6366
# Sphinx documentation
64-
docs/_build/
67+
docs/build/
68+
docs/source/generated/
69+
70+
# pytest
71+
.pytest_cache/
6572

6673
# PyBuilder
6774
target/
6875

69-
# IPython Notebook
70-
.ipynb_checkpoints
71-
72-
# pyenv
73-
.python-version
76+
# Editor files
77+
# mac
78+
.DS_Store
79+
*~
7480

75-
# celery beat schedule file
76-
celerybeat-schedule
81+
# vim
82+
*.swp
83+
*.swo
7784

78-
# dotenv
79-
.env
85+
# pycharm
86+
.idea/
8087

81-
# virtualenv
82-
venv/
83-
ENV/
88+
# VSCode
89+
.vscode/
8490

85-
# Spyder project settings
86-
.spyderproject
91+
# Ipython Notebook
92+
.ipynb_checkpoints
8793

88-
# Rope project settings
89-
.ropeproject
94+
# version information
95+
setup.cfg
96+
/src/diffpy/*/version.cfg
9097

91-
# pycharm
92-
.idea/
93-
# Mac
94-
.DS_Store
9598
# Rever
9699
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: AUTHORS.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Authors
22
=======
33

4-
Billinge Group and community contibutors.
4+
Billinge Group and community contributors.
55

66
Contributors
77
------------

Diff for: MANIFEST.in

+12-14
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,12 @@
1-
include AUTHORS.rst
2-
include LICENSE
3-
include README.rst
4-
include requirements.txt
5-
6-
recursive-exclude * __pycache__
7-
recursive-exclude * *.py[co]
8-
9-
recursive-include docs *.rst conf.py Makefile make.bat
10-
11-
include diffpy.snmf/version.py
12-
13-
# If including data files in the package, add them like:
14-
# include path/to/data_file
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.

Diff for: README.rst

+4-8
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,8 @@
1515
.. |Black| image:: https://img.shields.io/badge/code_style-black-black
1616
:target: https://github.com/psf/black
1717

18-
.. |CI| image:: https://github.com/diffpy/diffpy.snmf/actions/workflows/main.yml/badge.svg
19-
:target: https://github.com/diffpy/diffpy.snmf/actions/workflows/main.yml
18+
.. |CI| image:: https://github.com/diffpy/diffpy.snmf/actions/workflows/matrix-and-codecov-on-merge-to-main.yml/badge.svg
19+
:target: https://github.com/diffpy/diffpy.snmf/actions/workflows/matrix-and-codecov-on-merge-to-main.yml
2020

2121
.. |Codecov| image:: https://codecov.io/gh/diffpy/diffpy.snmf/branch/main/graph/badge.svg
2222
:target: https://codecov.io/gh/diffpy/diffpy.snmf
@@ -83,11 +83,7 @@ Then, to fully install ``diffpy.snmf`` in our active environment, run ::
8383

8484
Another option is to use ``pip`` to download and install the latest release from
8585
`Python Package Index <https://pypi.python.org>`_.
86-
To install using ``pip`` into your ``diffpy.snmf_env`` environment, we will also have to install dependencies ::
87-
88-
pip install -r https://raw.githubusercontent.com/diffpy/diffpy.snmf/main/requirements/run.txt
89-
90-
and then install the package ::
86+
To install using ``pip`` into your ``diffpy.snmf_env`` environment, type ::
9187

9288
pip install diffpy.snmf
9389

@@ -102,7 +98,7 @@ Support and Contribute
10298

10399
`Diffpy user group <https://groups.google.com/g/diffpy-users>`_ is the discussion forum for general questions and discussions about the use of diffpy.snmf. Please join the diffpy.snmf users community by joining the Google group. The diffpy.snmf project welcomes your expertise and enthusiasm!
104100

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

107103
Feel free to fork the project and contribute. To install diffpy.snmf
108104
in a development mode, with its sources being directly used by Python

Diff for: doc/make.bat

+36-36
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,36 @@
1-
@ECHO OFF
2-
3-
pushd %~dp0
4-
5-
REM Command file for Sphinx documentation
6-
7-
if "%SPHINXBUILD%" == "" (
8-
set SPHINXBUILD=sphinx-build
9-
)
10-
set SOURCEDIR=source
11-
set BUILDDIR=build
12-
set SPHINXPROJ=PackagingScientificPython
13-
14-
if "%1" == "" goto help
15-
16-
%SPHINXBUILD% >NUL 2>NUL
17-
if errorlevel 9009 (
18-
echo.
19-
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
20-
echo.installed, then set the SPHINXBUILD environment variable to point
21-
echo.to the full path of the 'sphinx-build' executable. Alternatively you
22-
echo.may add the Sphinx directory to PATH.
23-
echo.
24-
echo.If you don't have Sphinx installed, grab it from
25-
echo.http://sphinx-doc.org/
26-
exit /b 1
27-
)
28-
29-
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
30-
goto end
31-
32-
:help
33-
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
34-
35-
:end
36-
popd
1+
@ECHO OFF
2+
3+
pushd %~dp0
4+
5+
REM Command file for Sphinx documentation
6+
7+
if "%SPHINXBUILD%" == "" (
8+
set SPHINXBUILD=sphinx-build
9+
)
10+
set SOURCEDIR=source
11+
set BUILDDIR=build
12+
set SPHINXPROJ=PackagingScientificPython
13+
14+
if "%1" == "" goto help
15+
16+
%SPHINXBUILD% >NUL 2>NUL
17+
if errorlevel 9009 (
18+
echo.
19+
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
20+
echo.installed, then set the SPHINXBUILD environment variable to point
21+
echo.to the full path of the 'sphinx-build' executable. Alternatively you
22+
echo.may add the Sphinx directory to PATH.
23+
echo.
24+
echo.If you don't have Sphinx installed, grab it from
25+
echo.http://sphinx-doc.org/
26+
exit /b 1
27+
)
28+
29+
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
30+
goto end
31+
32+
:help
33+
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
34+
35+
:end
36+
popd

Diff for: doc/source/index.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Welcome to SNMF's Documentation!
22
====================================
33

44
``SNMF``: This library implements the stretched non negative matrix factorization (sNMF) and sparse stretched NMF
5-
(ssNMF) algorithms described in the paper "Stretched Non-negative Matrix Factorization" by Ran Gu et al. (2023),
5+
(ssNMF) algorithms described in the paper "Stretched Non-negative Matrix Factorization" by Ran Gu et al. (2023),
66
which is referenced under the Citation section below.
77

88
This algorithm is designed to do an NMF factorization on a set of signals ignoring any uniform stretching of the signal
@@ -63,7 +63,7 @@ Jame R. Neilson, Karena W. Chapman, Qiang Du, and Simon J. L. Billinge.
6363
This software implementation was developed by members of the Billinge Group at Columbia University and Brookhaven
6464
National Laboratory including Ran Gu, Adeolu Ajayi, Qiang Du, and Simon J. L. Billinge.
6565

66-
For a detailed list of contributors, check `here
66+
For a detailed list of contributors, check `here
6767
<https://github.com/diffpy/diffpy.snmf/graphs/contributors>`_.
6868

6969
To get started, please go to :ref:`quick_start`

Diff for: doc/source/license.rst

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,9 @@ OPEN SOURCE LICENSE AGREEMENT
99
=============================
1010
BSD 3-Clause License
1111

12-
Copyright (c) 2023-2024, The Trustees of Columbia University in
12+
Copyright (c) 2023-2024, The Trustees of Columbia University in
1313
the City of New York.
14-
All Rights Reserved.
14+
All Rights Reserved.
1515

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

Diff for: doc/source/release.rst

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
:tocdepth: -1
2+
13
.. index:: release notes
24

3-
.. include:: /../../CHANGELOG.rst
5+
.. include:: ../../CHANGELOG.rst

Diff for: news/recut.rst

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
**Added:**
2+
3+
* <news item>
4+
5+
**Changed:**
6+
7+
* <news item>
8+
9+
**Deprecated:**
10+
11+
* <news item>
12+
13+
**Removed:**
14+
15+
* <news item>
16+
17+
**Fixed:**
18+
19+
* re-cookiecuter repo to groupd's package standard
20+
21+
**Security:**
22+
23+
* <news item>

Diff for: pyproject.toml

+6-3
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
[build-system]
2-
requires = ["setuptools>=62.0", "setuptools-git-versioning<2"]
2+
requires = ["setuptools>=62.0", "setuptools-git-versioning>=2.0"]
33
build-backend = "setuptools.build_meta"
44

55
[project]
66
name = "diffpy.snmf"
7-
dynamic=['version']
7+
dynamic=['version', 'dependencies']
88
authors = [
99
{ name="Simon J.L. Billinge group", email="[email protected]" },
1010
]
@@ -45,9 +45,12 @@ dirty_template = "{tag}"
4545
[tool.setuptools.packages.find]
4646
where = ["src"] # list of folders that contain the packages (["."] by default)
4747
include = ["*"] # package names should match these glob patterns (["*"] by default)
48-
exclude = ["diffpy.snmf.tests*"] # exclude packages matching these glob patterns (empty by default)
48+
exclude = [] # exclude packages matching these glob patterns (empty by default)
4949
namespaces = false # to disable scanning PEP 420 namespaces (true by default)
5050

51+
[tool.setuptools.dynamic]
52+
dependencies = {file = ["requirements/run.txt"]}
53+
5154
[tool.black]
5255
line-length = 115
5356
include = '\.pyi?$'

Diff for: requirements/build.txt

-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +0,0 @@
1-
python
2-
setuptools

0 commit comments

Comments
 (0)