From d181d2aeda19347d4e75b14ba3361773b22d3cdd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5kon=20Wiik=20=C3=85nes?= Date: Fri, 8 Oct 2021 13:50:05 +0200 Subject: [PATCH 1/2] Regenerate README.rst MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Håkon Wiik Ånes --- CHANGELOG.rst | 19 +++++++++++++++++++ README.rst | 29 ++++++++++++++++++++--------- README_for_docs.rst | 35 +++++++++++++++++++---------------- docs/Makefile | 3 +-- docs/source/changelog.rst | 2 ++ docs/source/conf.py | 12 ++++++++---- docs/source/index.rst | 5 +++++ morphops/io.py | 6 +++--- setup.py | 8 +++++++- 9 files changed, 84 insertions(+), 35 deletions(-) create mode 100644 CHANGELOG.rst create mode 100644 docs/source/changelog.rst diff --git a/CHANGELOG.rst b/CHANGELOG.rst new file mode 100644 index 0000000..c8ed983 --- /dev/null +++ b/CHANGELOG.rst @@ -0,0 +1,19 @@ +========= +Changelog +========= + +Morphops implements common operations and algorithms for Geometric +Morphometrics, in Python 3. + +All notable changes to this project will be documented in this file. The format is based +on `Keep a Changelog `_. + +Contributors to each release are listed in alphabetical order by first name. List +entries are sorted in descending chronological order. + +Unreleased +========== + +Added +----- +- This project now keeps a changelog. \ No newline at end of file diff --git a/README.rst b/README.rst index 1cb66a7..e55e905 100644 --- a/README.rst +++ b/README.rst @@ -1,21 +1,33 @@ -.. image:: https://travis-ci.com/vaipatel/morphops.svg?branch=master - :target: https://travis-ci.com/vaipatel/morphops - Welcome to Morphops! ==================== Morphops implements common operations and algorithms for Geometric Morphometrics, in Python 3. +.. GitHub Actions +.. image:: https://github.com/vaipatel/morphops/actions/workflows/build.yml/badge.svg + :target: https://github.com/vaipatel/morphops/actions/workflows/build.yml + :alt: Build status + +.. Read the Docs +.. image:: https://readthedocs.org/projects/morphops/badge/?version=latest + :target: https://morphops.readthedocs.io/en/latest/?badge=latest + :alt: Documentation Status + +.. PyPI version +.. image:: https://img.shields.io/pypi/v/morphops + :target: https://pypi.org/project/morphops + :alt: PyPI version + Features ======== Some high-level operations in the current version are -* Centering, rescaling data: \ -* Rigid Rotation, Ordinary and Generalized Procrustes alignment: \ -* Thin-plate spline warping: \ -* Reading from and writing to \*.dta files: \ +* Centering, rescaling data: +* Rigid Rotation, Ordinary and Generalized Procrustes alignment: +* Thin-plate spline warping: +* Reading from and writing to \*.dta files: Dependencies ------------ @@ -106,5 +118,4 @@ they can now be submitted to various commonly used statistical procedures like Principal Components Analysis and various kinds of regression for further analysis. - -**(This file was autogenerated from README_for_docs.rst by running `make README_for_gh html` in the docs directory)** +**(This file was autogenerated from README_for_docs.rst by running `make README_for_gh` in the docs directory)** diff --git a/README_for_docs.rst b/README_for_docs.rst index 4ca6312..15ee52d 100644 --- a/README_for_docs.rst +++ b/README_for_docs.rst @@ -1,36 +1,39 @@ -.. GitHub Actions -.. image:: https://github.com/hakonanes/morphops/workflows/build/badge.svg - :target: https://github.com/hakonanes/morphops/actions - :alt: Build status - -| - -.. contents:: - :local: - -| - Welcome to Morphops! ==================== Morphops implements common operations and algorithms for Geometric Morphometrics, in Python 3. +.. GitHub Actions +.. image:: https://github.com/vaipatel/morphops/actions/workflows/build.yml/badge.svg + :target: https://github.com/vaipatel/morphops/actions/workflows/build.yml + :alt: Build status + +.. Read the Docs +.. image:: https://readthedocs.org/projects/morphops/badge/?version=latest + :target: https://morphops.readthedocs.io/en/latest/?badge=latest + :alt: Documentation Status + +.. PyPI version +.. image:: https://img.shields.io/pypi/v/morphops + :target: https://pypi.org/project/morphops + :alt: PyPI version + Features ======== Some high-level operations in the current version are -* Centering, rescaling data: \ +* Centering, rescaling data: :meth:`remove_position(lmk_sets) `, :meth:`remove_scale(lmk_sets) ` -* Rigid Rotation, Ordinary and Generalized Procrustes alignment: \ +* Rigid Rotation, Ordinary and Generalized Procrustes alignment: :meth:`rotate(src_sets,tar_sets) `, :meth:`opa(src_set,tar_set) `, :meth:`gpa(all_sets) ` -* Thin-plate spline warping: \ +* Thin-plate spline warping: :meth:`tps_warp(X, Y, pts) ` -* Reading from and writing to \*.dta files: \ +* Reading from and writing to \*.dta files: :meth:`read_dta(fn) `, :meth:`write_dta(fn,lmk_sets,names) ` diff --git a/docs/Makefile b/docs/Makefile index c17aa4c..5c465ea 100644 --- a/docs/Makefile +++ b/docs/Makefile @@ -17,9 +17,8 @@ help: README_for_gh: @echo "Building docs for GitHub" @cp ../README_for_docs.rst ../$(README_FOR_GH) - sed -i '' -e '4,10d' ../$(README_FOR_GH) + echo "\n**(This file was autogenerated from README_for_docs.rst by running \`make README_for_gh\` in the docs directory)**" >> ../$(README_FOR_GH) sed -i '' -e '/^ :meth:/ d' ../$(README_FOR_GH) - echo "\n\n**(This file was autogenerated from README_for_docs.rst by running \`make README_for_gh html\` in the docs directory)**" >> ../$(README_FOR_GH) # Catch-all target: route all unknown targets to Sphinx using the new # "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). diff --git a/docs/source/changelog.rst b/docs/source/changelog.rst new file mode 100644 index 0000000..492810d --- /dev/null +++ b/docs/source/changelog.rst @@ -0,0 +1,2 @@ +.. This is a stub, see the top level CHANGELOG.rst file for the changelog. +.. include:: ../../CHANGELOG.rst \ No newline at end of file diff --git a/docs/source/conf.py b/docs/source/conf.py index 339bb13..b03d512 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -12,9 +12,13 @@ # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. # +from datetime import datetime import os import sys +from morphops._version import __version__ as full_version + + sys.path.insert(0, os.path.abspath('../..')) sys.path.insert(0, os.path.abspath('../../morphops')) sys.setrecursionlimit(1500) @@ -22,13 +26,13 @@ # -- Project information ----------------------------------------------------- project = 'Morphops' -copyright = '2018-2020, Vaibhav Patel' +copyright = f"2018-{datetime.now().year}, Vaibhav Patel" author = 'Vaibhav Patel' # The short X.Y version version = '0.1' # The full version, including alpha/beta/rc tags -release = '0.1.11' +release = full_version # -- General configuration --------------------------------------------------- @@ -105,7 +109,7 @@ # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". -html_static_path = ['_static'] +#html_static_path = ['_static'] # Custom sidebar templates, must be a dictionary that maps document names # to template names. @@ -207,4 +211,4 @@ intersphinx_mapping = { 'python': ('https://docs.python.org/3', None), 'numpy': ('https://docs.scipy.org/doc/numpy/', None) -} \ No newline at end of file +} diff --git a/docs/source/index.rst b/docs/source/index.rst index 124a6e3..41caab6 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -13,6 +13,11 @@ morphops module .. Members .. ======= +.. toctree:: + :hidden: + + changelog.rst + Indices and tables ================== diff --git a/morphops/io.py b/morphops/io.py index fad233e..e6808e6 100644 --- a/morphops/io.py +++ b/morphops/io.py @@ -15,7 +15,7 @@ class MopsFileWriteError(Exception): def read_dta(filename): - r"""Reads *.dta files, as written by the IDAV Landmark Editor. + r"""Reads \*.dta files, as written by the IDAV Landmark Editor. dta files typically have the following structure. @@ -92,11 +92,11 @@ def read_dta(filename): def write_dta(filename, lmk_sets, names=[]): - r"""Writes *.dta files, as written by the IDAV Landmark Editor. + r"""Writes \*.dta files, as written by the IDAV Landmark Editor. See also -------- - read_dta: For an explanation of the *.dta format. + read_dta: For an explanation of the \*.dta format. Todo ---- diff --git a/setup.py b/setup.py index 776a6fd..d832c32 100644 --- a/setup.py +++ b/setup.py @@ -1,5 +1,7 @@ +from itertools import chain from setuptools import setup, find_packages + with open('README.rst') as readme_file: readme = readme_file.read() @@ -8,8 +10,12 @@ exec(version_file.read(), version) extra_feature_requirements = { - "tests": ["coverage >= 5.0", "pytest >= 5.4", "pytest-cov >= 2.8.1"], + "tests": ["coverage >= 5.0", "pytest >= 5.4", "pytest-cov >= 2.8.1", "tox"], + "docs": ["sphinx < 2", "sphinx-rtd-theme"], } +extra_feature_requirements["dev"] = list( + chain(*list(extra_feature_requirements.values())) +) setup( name='morphops', From 7ab0c21bbdf0e4d36f2b2f861263d6da60e010c3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A5kon=20Wiik=20=C3=85nes?= Date: Fri, 8 Oct 2021 13:57:29 +0200 Subject: [PATCH 2/2] Add PR template with reminder to update changelog in PRs MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Håkon Wiik Ånes --- .github/pull_request_template.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .github/pull_request_template.md diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md new file mode 100644 index 0000000..7e46b4b --- /dev/null +++ b/.github/pull_request_template.md @@ -0,0 +1,6 @@ + + +#### For reviewers + +- [ ] New features, API changes, and deprecations are mentioned in the unreleased + section in `CHANGELOG.rst`.