From 275a00234a8f5e2b61f8faaf257ef020d324f770 Mon Sep 17 00:00:00 2001 From: Sangjoon Bob Lee Date: Fri, 25 Oct 2024 17:32:21 -0400 Subject: [PATCH 1/4] Restrict python version --- pyproject.toml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index 260613e5..8bd07d07 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -14,7 +14,7 @@ maintainers = [ description = "A python package implementing the stretched NMF algorithm." keywords = ['diffpy', 'PDF'] readme = "README.rst" -requires-python = ">=3.10" +requires-python = ">=3.10, <3.13" classifiers = [ 'Development Status :: 4 - Beta', 'Environment :: Console', @@ -42,6 +42,9 @@ template = "{tag}" dev_template = "{tag}" dirty_template = "{tag}" +[project.scripts] +snmf = "diffpy.snmf.stretchednmfapp:main" + [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) From da87accca0b4e331b90cc518031df45b22f0b71f Mon Sep 17 00:00:00 2001 From: Sangjoon Bob Lee Date: Fri, 25 Oct 2024 17:32:33 -0400 Subject: [PATCH 2/4] Add entry point and fix typo in command-line --- .github/workflows/publish-docs-on-release.yml | 14 -------------- src/diffpy/snmf/stretchednmfapp.py | 5 ++++- 2 files changed, 4 insertions(+), 15 deletions(-) delete mode 100644 .github/workflows/publish-docs-on-release.yml diff --git a/.github/workflows/publish-docs-on-release.yml b/.github/workflows/publish-docs-on-release.yml deleted file mode 100644 index 3a4e7dbf..00000000 --- a/.github/workflows/publish-docs-on-release.yml +++ /dev/null @@ -1,14 +0,0 @@ -name: Build and Deploy Docs - -on: - release: - types: - - published - workflow_dispatch: - -jobs: - docs: - uses: Billingegroup/release-scripts/.github/workflows/_publish-docs-on-release.yml@v0 - with: - project: diffpy.snmf - c_extension: false diff --git a/src/diffpy/snmf/stretchednmfapp.py b/src/diffpy/snmf/stretchednmfapp.py index 7080e0c4..4eca44cf 100644 --- a/src/diffpy/snmf/stretchednmfapp.py +++ b/src/diffpy/snmf/stretchednmfapp.py @@ -25,7 +25,7 @@ def create_parser(): help="The directory where the results will be written. Defaults to '/snmf_results'.", ) parser.add_argument( - "t", + "-t", "--data-type", type=str, default=None, @@ -58,3 +58,6 @@ def main(): variables = initialize_variables(lifted_input_data, args.number_of_components, args.data_type) components = initialize_components(variables["number_of_components"], variables["number_of_signals"], grid) return components + +if __name__ == "__main__": + main() From 6d4842bd8677217e282f24915c0a2a7c5b84e566 Mon Sep 17 00:00:00 2001 From: Sangjoon Bob Lee Date: Fri, 25 Oct 2024 17:33:34 -0400 Subject: [PATCH 3/4] Add news --- news/fix-cli.rst | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 news/fix-cli.rst diff --git a/news/fix-cli.rst b/news/fix-cli.rst new file mode 100644 index 00000000..3910faab --- /dev/null +++ b/news/fix-cli.rst @@ -0,0 +1,24 @@ +**Added:** + +* + +**Changed:** + +* + +**Deprecated:** + +* + +**Removed:** + +* + +**Fixed:** + +* Add entry point to the application +* Fix CLI bug due to typo + +**Security:** + +* From 85b305e3a4c123275d50619768abc1c42d5c356c Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Fri, 25 Oct 2024 21:42:29 +0000 Subject: [PATCH 4/4] [pre-commit.ci] auto fixes from pre-commit hooks --- src/diffpy/snmf/stretchednmfapp.py | 1 + 1 file changed, 1 insertion(+) diff --git a/src/diffpy/snmf/stretchednmfapp.py b/src/diffpy/snmf/stretchednmfapp.py index 4eca44cf..f577b887 100644 --- a/src/diffpy/snmf/stretchednmfapp.py +++ b/src/diffpy/snmf/stretchednmfapp.py @@ -59,5 +59,6 @@ def main(): components = initialize_components(variables["number_of_components"], variables["number_of_signals"], grid) return components + if __name__ == "__main__": main()