diff --git a/conch/utils.py b/conch/utils.py index fa0fb01..be5852a 100644 --- a/conch/utils.py +++ b/conch/utils.py @@ -40,3 +40,19 @@ def concatenate_files(files): # raise(AcousticSimError('Files for concatenation must have the same sampling rates.')) out = np.append(out, proc) return out + + +def get_conch_version() -> str: + """ + Get the current conch version + + Returns + ------- + str + Conch version + """ + try: + from ._version import version as __version__ # noqa + except ImportError: + __version__ = "1.0.0" + return __version__ diff --git a/docs/source/conf.py b/docs/source/conf.py index 3813088..1f88107 100644 --- a/docs/source/conf.py +++ b/docs/source/conf.py @@ -24,6 +24,9 @@ import sys import os +from datetime import date +sys.path.insert(0, os.path.abspath("../../")) +from conch.utils import get_conch_version # noqa import mock @@ -60,8 +63,8 @@ master_doc = 'index' # General information about the project. -project = 'Conch' -copyright = '2017, Michael McAuliffe' +project = 'Conch-sounds' +copyright = f'2017-{date.today().year}, Michael McAuliffe' author = 'Michael McAuliffe' # The version info for the project you're documenting, acts as replacement for @@ -69,9 +72,9 @@ # built documents. # # The short X.Y version. -version = '0.2.0' +version = ".".join(get_conch_version().split(".", maxsplit=2)[:2]) # The full version, including alpha/beta/rc tags. -release = '0.2.0' +release = get_conch_version() # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. @@ -97,7 +100,7 @@ # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. # -html_theme = 'pydata-sphinx-theme' +html_theme = 'pydata_sphinx_theme' # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the @@ -114,16 +117,7 @@ # to template names. # # This is required for the alabaster theme -# refs: http://alabaster.readthedocs.io/en/latest/installation.html#sidebars -html_sidebars = { - '**': [ - 'about.html', - 'navigation.html', - 'relations.html', # needs 'show_related': True theme option to display - 'searchbox.html', - 'donate.html', - ] -} +html_sidebars = {"**": ["search-field.html", "sidebar-nav-bs.html", "sidebar-ethical-ads.html"]} # -- Options for HTMLHelp output ------------------------------------------ diff --git a/docs/source/index.rst b/docs/source/index.rst index 7d8ba22..461f55b 100644 --- a/docs/source/index.rst +++ b/docs/source/index.rst @@ -10,6 +10,8 @@ Welcome to Conch's documentation! :maxdepth: 2 :caption: Contents: + analysis + similarity Indices and tables diff --git a/rtd_environment.yml b/rtd_environment.yml index 1cb1e2f..aaa2e71 100644 --- a/rtd_environment.yml +++ b/rtd_environment.yml @@ -10,7 +10,6 @@ dependencies: - sphinx - numpydoc - sphinx-design - - sphinx-click - sphinx-intl - pydata-sphinx-theme - myst-parser