Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,9 @@

# General information about the project.
project = "diffpy.snmf"
copyright = "2023-%Y, The Trustees of Columbia University in the City of New York"
copyright = (
"2023-%Y, The Trustees of Columbia University in the City of New York"
)

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
Expand Down Expand Up @@ -221,7 +223,13 @@
# (source start file, target name, title,
# author, documentclass [howto, manual, or own class]).
latex_documents = [
("index", "diffpy.snmf.tex", "diffpy.snmf Documentation", ab_authors, "manual"),
(
"index",
"diffpy.snmf.tex",
"diffpy.snmf Documentation",
ab_authors,
"manual",
),
]

# The name of an image file (relative to this directory) to place at the top of
Expand Down Expand Up @@ -249,7 +257,9 @@

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [("index", "diffpy.snmf", "diffpy.snmf Documentation", ab_authors, 1)]
man_pages = [
("index", "diffpy.snmf", "diffpy.snmf Documentation", ab_authors, 1)
]

# If true, show URL addresses after external links.
# man_show_urls = False
Expand Down
28 changes: 13 additions & 15 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -60,25 +60,23 @@ ignore-words = ".codespell/ignore_words.txt"
skip = "*.cif,*.dat"

[tool.black]
line-length = 115
line-length = 79
include = '\.pyi?$'
exclude = '''
/(
\.git
| \.hg
| \.mypy_cache
| \.tox
| \.venv
| \.rst
| \.txt
| _build
| buck-out
| build
| dist

# The following are specific to Black, you probably don't want those.
| blib2to3
| tests/data
| \.hg
| \.mypy_cache
| \.tox
| \.venv
| \.rst
| \.txt
| _build
| buck-out
| build
| dist
| blib2to3
| tests/data
)/
'''

Expand Down
1 change: 0 additions & 1 deletion src/diffpy/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@

"""Blank namespace package for module diffpy."""


from pkgutil import extend_path

__path__ = extend_path(__path__, __name__)
Expand Down
4 changes: 3 additions & 1 deletion src/diffpy/snmf/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@
my_model.fit(rho=1e12, eta=610)

print("Done")
np.savetxt("my_norm_components.txt", my_model.components_, fmt="%.6g", delimiter=" ")
np.savetxt(
"my_norm_components.txt", my_model.components_, fmt="%.6g", delimiter=" "
)
np.savetxt("my_norm_weights.txt", my_model.weights_, fmt="%.6g", delimiter=" ")
np.savetxt("my_norm_stretch.txt", my_model.stretch_, fmt="%.6g", delimiter=" ")
6 changes: 5 additions & 1 deletion src/diffpy/snmf/plotter.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ class SNMFPlotter:
def __init__(self, figsize=(12, 4)):
plt.ion()
self.fig, self.axes = plt.subplots(1, 3, figsize=figsize)
titles = ["Components", "Weights (rows as series)", "Stretch (rows as series)"]
titles = [
"Components",
"Weights (rows as series)",
"Stretch (rows as series)",
]
for ax, t in zip(self.axes, titles):
ax.set_title(t)
self.lines = {"components": [], "weights": [], "stretch": []}
Expand Down
Loading
Loading