Skip to content

Commit

Permalink
Re-cookiecut (#89)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
bobleesj and pre-commit-ci[bot] authored Sep 26, 2024
1 parent c7d4910 commit 1e3d023
Show file tree
Hide file tree
Showing 21 changed files with 142 additions and 107 deletions.
2 changes: 1 addition & 1 deletion .codecov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ coverage:
target: auto
if_no_uploads: error
if_not_found: success
if_ci_failed: failure
if_ci_failed: error
paths: '!*/tests/.*'

tests:
Expand Down
2 changes: 1 addition & 1 deletion .coveragerc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ omit =
*/python?.?/*
*/site-packages/nose/*
# ignore _version.py and versioneer.py
*version.*
.*version.*
*_version.py

exclude_lines =
Expand Down
1 change: 0 additions & 1 deletion .gitattributes

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/check-news-item.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- main

jobs:
check-news-item:
build:
uses: Billingegroup/release-scripts/.github/workflows/_check-news-item.yml@v0
with:
project: diffpy.snmf
2 changes: 1 addition & 1 deletion .github/workflows/matrix-and-codecov-on-merge-to-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ on:
workflow_dispatch:

jobs:
CI:
coverage:
uses: Billingegroup/release-scripts/.github/workflows/_matrix-and-codecov-on-merge-to-main.yml@v0
with:
project: diffpy.snmf
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-docs-on-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ on:
workflow_dispatch:

jobs:
publish-docs-on-release:
docs:
uses: Billingegroup/release-scripts/.github/workflows/_publish-docs-on-release.yml@v0
with:
project: diffpy.snmf
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/tests-on-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
workflow_dispatch:

jobs:
tests-on-pr:
validate:
uses: Billingegroup/release-scripts/.github/workflows/_tests-on-pr.yml@v0
with:
project: diffpy.snmf
Expand Down
61 changes: 32 additions & 29 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,14 @@ lib64/
parts/
sdist/
var/
venv/
*.egg-info/
.installed.cfg
*.egg
bin/
temp/
tags/
errors.err

# PyInstaller
# Usually these files are written by a python script from a template
Expand All @@ -33,6 +38,7 @@ var/
# Installer logs
pip-log.txt
pip-delete-this-directory.txt
MANIFEST

# Unit test / coverage reports
htmlcov/
Expand All @@ -49,48 +55,45 @@ coverage.xml
*.mo
*.pot

# Mr Developer
.mr.developer.cfg
.project
.pydevproject

# Django stuff:
*.log
local_settings.py

# Flask stuff:
instance/
.webassets-cache

# Scrapy stuff:
.scrapy

# Sphinx documentation
docs/_build/
docs/build/
docs/source/generated/

# pytest
.pytest_cache/

# PyBuilder
target/

# IPython Notebook
.ipynb_checkpoints

# pyenv
.python-version
# Editor files
# mac
.DS_Store
*~

# celery beat schedule file
celerybeat-schedule
# vim
*.swp
*.swo

# dotenv
.env
# pycharm
.idea/

# virtualenv
venv/
ENV/
# VSCode
.vscode/

# Spyder project settings
.spyderproject
# Ipython Notebook
.ipynb_checkpoints

# Rope project settings
.ropeproject
# version information
setup.cfg
/src/diffpy/*/version.cfg

# pycharm
.idea/
# Mac
.DS_Store
# Rever
rever/
5 changes: 4 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@ repos:
- id: check-yaml
- id: end-of-file-fixer
- id: trailing-whitespace
exclude: '\.(rst|txt)$'
- id: check-case-conflict
- id: check-merge-conflict
- id: check-toml
- id: check-added-large-files
- repo: https://github.com/psf/black
rev: 24.4.2
hooks:
Expand Down
2 changes: 1 addition & 1 deletion AUTHORS.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Authors
=======

Billinge Group and community contibutors.
Billinge Group and community contributors.

Contributors
------------
Expand Down
26 changes: 12 additions & 14 deletions MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
include AUTHORS.rst
include LICENSE
include README.rst
include requirements.txt

recursive-exclude * __pycache__
recursive-exclude * *.py[co]

recursive-include docs *.rst conf.py Makefile make.bat

include diffpy.snmf/version.py

# If including data files in the package, add them like:
# include path/to/data_file
graft src
graft tests
graft requirements

include AUTHORS.rst LICENSE*.rst README.rst

# Exclude all bytecode files and __pycache__ directories
global-exclude *.py[cod] # Exclude all .pyc, .pyo, and .pyd files.
global-exclude .DS_Store # Exclude Mac filesystem artifacts.
global-exclude __pycache__ # Exclude Python cache directories.
global-exclude .git* # Exclude git files and directories.
global-exclude .idea # Exclude PyCharm project settings.
12 changes: 4 additions & 8 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
.. |Black| image:: https://img.shields.io/badge/code_style-black-black
:target: https://github.com/psf/black

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

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

Another option is to use ``pip`` to download and install the latest release from
`Python Package Index <https://pypi.python.org>`_.
To install using ``pip`` into your ``diffpy.snmf_env`` environment, we will also have to install dependencies ::

pip install -r https://raw.githubusercontent.com/diffpy/diffpy.snmf/main/requirements/run.txt

and then install the package ::
To install using ``pip`` into your ``diffpy.snmf_env`` environment, type ::

pip install diffpy.snmf

Expand All @@ -102,7 +98,7 @@ Support and Contribute

`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!

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>`_.
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>`_.

Feel free to fork the project and contribute. To install diffpy.snmf
in a development mode, with its sources being directly used by Python
Expand Down
72 changes: 36 additions & 36 deletions doc/make.bat
Original file line number Diff line number Diff line change
@@ -1,36 +1,36 @@
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=source
set BUILDDIR=build
set SPHINXPROJ=PackagingScientificPython

if "%1" == "" goto help

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.http://sphinx-doc.org/
exit /b 1
)

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%

:end
popd
@ECHO OFF

pushd %~dp0

REM Command file for Sphinx documentation

if "%SPHINXBUILD%" == "" (
set SPHINXBUILD=sphinx-build
)
set SOURCEDIR=source
set BUILDDIR=build
set SPHINXPROJ=PackagingScientificPython

if "%1" == "" goto help

%SPHINXBUILD% >NUL 2>NUL
if errorlevel 9009 (
echo.
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
echo.installed, then set the SPHINXBUILD environment variable to point
echo.to the full path of the 'sphinx-build' executable. Alternatively you
echo.may add the Sphinx directory to PATH.
echo.
echo.If you don't have Sphinx installed, grab it from
echo.http://sphinx-doc.org/
exit /b 1
)

%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%
goto end

:help
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS%

:end
popd
4 changes: 2 additions & 2 deletions doc/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ Welcome to SNMF's Documentation!
====================================

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

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

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

To get started, please go to :ref:`quick_start`
Expand Down
4 changes: 2 additions & 2 deletions doc/source/license.rst
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ OPEN SOURCE LICENSE AGREEMENT
=============================
BSD 3-Clause License

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

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
Expand Down
4 changes: 3 additions & 1 deletion doc/source/release.rst
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
:tocdepth: -1

.. index:: release notes

.. include:: /../../CHANGELOG.rst
.. include:: ../../CHANGELOG.rst
23 changes: 23 additions & 0 deletions news/recut.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
**Added:**

* <news item>

**Changed:**

* <news item>

**Deprecated:**

* <news item>

**Removed:**

* <news item>

**Fixed:**

* re-cookiecuter repo to groupd's package standard

**Security:**

* <news item>
9 changes: 6 additions & 3 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
[build-system]
requires = ["setuptools>=62.0", "setuptools-git-versioning<2"]
requires = ["setuptools>=62.0", "setuptools-git-versioning>=2.0"]
build-backend = "setuptools.build_meta"

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

[tool.setuptools.dynamic]
dependencies = {file = ["requirements/run.txt"]}

[tool.black]
line-length = 115
include = '\.pyi?$'
Expand Down
2 changes: 0 additions & 2 deletions requirements/build.txt
Original file line number Diff line number Diff line change
@@ -1,2 +0,0 @@
python
setuptools
Loading

0 comments on commit 1e3d023

Please sign in to comment.