Skip to content

Commit 4ebfac6

Browse files
authored
skpkg: migrate documentation, README, and public static files (#153)
* skpkg: migrate documentation * skpkg: add config files for authors, changelog, code of conduct, license * skpkg: add README.rst * skpkg: add news files * chore: add back necessary lines from the files * chore: fix files according to comments in the review
1 parent 0db4c3e commit 4ebfac6

File tree

8 files changed

+95
-15
lines changed

8 files changed

+95
-15
lines changed

CHANGELOG.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
=============
2-
Release Notes
2+
Release notes
33
=============
44

55
.. current developments

LICENSE.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
BSD 3-Clause License
22

3-
Copyright (c) 2023-2024, The Trustees of Columbia University
4-
in the City of New York.
3+
Copyright (c) 2023-2025, The Trustees of Columbia University in the City of New York.
54
All rights reserved.
65

76
Redistribution and use in source and binary forms, with or without

README.rst

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
:target: https://diffpy.github.io/diffpy.snmf
99
:height: 100px
1010

11-
|PyPi| |Forge| |PythonVersion| |PR|
11+
|PyPI| |Forge| |PythonVersion| |PR|
1212

1313
|CI| |Codecov| |Black| |Tracking|
1414

@@ -26,7 +26,7 @@
2626

2727
.. |PR| image:: https://img.shields.io/badge/PR-Welcome-29ab47ff
2828

29-
.. |PyPi| image:: https://img.shields.io/pypi/v/diffpy.snmf
29+
.. |PyPI| image:: https://img.shields.io/pypi/v/diffpy.snmf
3030
:target: https://pypi.org/project/diffpy.snmf/
3131

3232
.. |PythonVersion| image:: https://img.shields.io/pypi/pyversions/diffpy.snmf
@@ -132,4 +132,9 @@ Before contributing, please read our `Code of Conduct <https://github.com/diffpy
132132
Contact
133133
-------
134134

135-
For more information on diffpy.snmf please visit the project `web-page <https://diffpy.github.io/>`_ or email Prof. Simon Billinge at [email protected].
135+
For more information on diffpy.snmf please visit the project `web-page <https://diffpy.github.io/>`_ or email Simon J.L. Billinge group at [email protected].
136+
137+
Acknowledgements
138+
----------------
139+
140+
``diffpy.snmf`` is built and maintained with `scikit-package <https://scikit-package.github.io/scikit-package/>`_.

doc/source/conf.py

Lines changed: 38 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env python
22
# -*- coding: utf-8 -*-
33
#
4-
# diffpy.snmf documentation build configuration file, created by
4+
# diffpy.snmf documentation build configuration file, created by # noqa: E501
55
# sphinx-quickstart on Thu Jan 30 15:49:41 2014.
66
#
77
# This file is execfile()d with the current directory set to its
@@ -18,9 +18,15 @@
1818
from importlib.metadata import version
1919
from pathlib import Path
2020

21+
# Attempt to import the version dynamically from GitHub tag.
22+
try:
23+
fullversion = version("diffpy.snmf")
24+
except Exception:
25+
fullversion = "No version found. The correct version will appear in the released version." # noqa: E501
26+
2127
# If extensions (or modules to document with autodoc) are in another directory,
2228
# add these directories to sys.path here. If the directory is relative to the
23-
# documentation root, use Path().resolve() to make it absolute, like shown here.
29+
# documentation root, use Path().resolve() to make it absolute, like shown here. # noqa: E501
2430
# sys.path.insert(0, str(Path(".").resolve()))
2531
sys.path.insert(0, str(Path("../..").resolve()))
2632
sys.path.insert(0, str(Path("../../src").resolve()))
@@ -43,6 +49,7 @@
4349
"sphinx.ext.viewcode",
4450
"sphinx.ext.intersphinx",
4551
"sphinx_rtd_theme",
52+
"sphinx_copybutton",
4653
"m2r",
4754
]
4855

@@ -68,7 +75,6 @@
6875
# |version| and |release|, also used in various other places throughout the
6976
# built documents.
7077

71-
fullversion = version(project)
7278
# The short X.Y version.
7379
version = "".join(fullversion.split(".post")[:1])
7480
# The full version, including alpha/beta/rc tags.
@@ -88,6 +94,11 @@
8894
# substitute YEAR in the copyright string
8995
copyright = copyright.replace("%Y", year)
9096

97+
# For sphinx_copybutton extension.
98+
# Do not copy "$" for shell commands in code-blocks.
99+
copybutton_prompt_text = r"^\$ "
100+
copybutton_prompt_is_regexp = True
101+
91102
# List of patterns, relative to source directory, that match files and
92103
# directories to ignore when looking for source files.
93104
exclude_patterns = ["build"]
@@ -123,6 +134,14 @@
123134
#
124135
html_theme = "sphinx_rtd_theme"
125136

137+
html_context = {
138+
"display_github": True,
139+
"github_user": "diffpy",
140+
"github_repo": "diffpy.snmf",
141+
"github_version": "main",
142+
"conf_py_path": "/doc/source/",
143+
}
144+
126145
# Theme options are theme-specific and customize the look and feel of a theme
127146
# further. For a list of options available for each theme, see the
128147
# documentation.
@@ -221,7 +240,13 @@
221240
# (source start file, target name, title,
222241
# author, documentclass [howto, manual, or own class]).
223242
latex_documents = [
224-
("index", "diffpy.snmf.tex", "diffpy.snmf Documentation", ab_authors, "manual"),
243+
(
244+
"index",
245+
"diffpy.snmf.tex",
246+
"diffpy.snmf Documentation",
247+
ab_authors,
248+
"manual",
249+
),
225250
]
226251

227252
# The name of an image file (relative to this directory) to place at the top of
@@ -249,7 +274,15 @@
249274

250275
# One entry per manual page. List of tuples
251276
# (source start file, name, description, authors, manual section).
252-
man_pages = [("index", "diffpy.snmf", "diffpy.snmf Documentation", ab_authors, 1)]
277+
man_pages = [
278+
(
279+
"index",
280+
"diffpy.snmf",
281+
"diffpy.snmf Documentation",
282+
ab_authors,
283+
1,
284+
)
285+
]
253286

254287
# If true, show URL addresses after external links.
255288
# man_show_urls = False

doc/source/index.rst

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,11 @@
11
Welcome to SNMF's Documentation!
22
====================================
33

4+
``diffpy.snmf`` - Python package implementing the stretched NMF algorithm.
5+
6+
| Software version |release|
7+
| Last updated |today|.
8+
49
``SNMF``: This library implements the stretched non negative matrix factorization (sNMF) and sparse stretched NMF
510
(ssNMF) algorithms described in the paper "Stretched Non-negative Matrix Factorization" by Ran Gu et al. (2023),
611
which is referenced under the Citation section below.
@@ -52,8 +57,9 @@ by citing the following paper in your publication:
5257
*npj Comput Mater* **10**, 193 (2024).
5358

5459

60+
=======
5561
Authors
56-
-------
62+
=======
5763

5864
``snmf`` implements the algorithms described in ...., developed by members of the Billinge Group at
5965
Columbia University, Brookhaven National Laboratory, Stony Brook University, Nankai University, and Colorado State
@@ -68,6 +74,19 @@ For a detailed list of contributors, check `here
6874

6975
To get started, please go to :ref:`quick_start`
7076

77+
============
78+
Installation
79+
============
80+
81+
See the `README <https://github.com/diffpy/diffpy.snmf#installation>`_
82+
file included with the distribution.
83+
84+
================
85+
Acknowledgements
86+
================
87+
88+
``diffpy.snmf`` is built and maintained with `scikit-package <https://scikit-package.github.io/scikit-package/>`_.
89+
7190
.. toctree::
7291
:maxdepth: 3
7392
:hidden:
@@ -84,8 +103,9 @@ To get started, please go to :ref:`quick_start`
84103

85104
.. include:: ../../CHANGELOG.rst
86105

106+
=======
87107
Indices
88-
-------
108+
=======
89109

90110
* :ref:`genindex`
91111
* :ref:`search`

doc/source/license.rst

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ OPEN SOURCE LICENSE AGREEMENT
99
=============================
1010
BSD 3-Clause License
1111

12-
Copyright (c) 2023-2024, The Trustees of Columbia University in
13-
the City of New York.
12+
Copyright (c) 2023-2025, The Trustees of Columbia University in the City of New York.
1413
All Rights Reserved.
1514

1615
Redistribution and use in source and binary forms, with or without

news/doc.rst

Lines changed: 23 additions & 0 deletions
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+
* Support ``scikit-package`` Level 5 standard (https://scikit-package.github.io/scikit-package/).
20+
21+
**Security:**
22+
23+
* <news item>

requirements/docs.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
sphinx
22
sphinx_rtd_theme
3+
sphinx-copybutton
34
doctr
45
m2r

0 commit comments

Comments
 (0)