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
2 changes: 1 addition & 1 deletion .github/workflows/ci_cron_weekly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:
- name: Set up Python to build docs with sphinx
uses: actions/setup-python@v4
with:
python-version: '3.11'
python-version: '3.13'
- name: Install base dependencies
run: |
python -m pip install --upgrade pip
Expand Down
14 changes: 10 additions & 4 deletions .github/workflows/ci_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,19 @@ jobs:
include:
- name: Code style checks
os: ubuntu-latest
python: '3.11'
python: '3.13'
toxenv: codestyle

- name: Python 3.11 with all optional dependencies and coverage checking
- name: Python 3.13 with required dependencies and coverage checking
os: ubuntu-latest
python: '3.11'
toxenv: py311-test-alldeps-cov
python: '3.13'
toxenv: py313-test-cov

- name: Python 3.13 with nightly wheels for key dependencies
continue-on-error: true
os: ubuntu-latest
python: '3.13'
toxenv: py313-test-devdeps

steps:
- name: Checkout code
Expand Down
4 changes: 2 additions & 2 deletions .readthedocs.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
version: 2

build:
os: ubuntu-20.04
os: ubuntu-22.04
tools:
python: "3.10"
python: "3.13"

sphinx:
builder: html
Expand Down
103 changes: 49 additions & 54 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,65 +25,73 @@
# Thus, any C-extensions that are needed to build the documentation will *not*
# be accessible, and the documentation will not build correctly.

import os
import sys
import datetime
from importlib import import_module
from importlib import metadata
import pathlib
import tomllib
from packaging.version import parse


try:
from sphinx_astropy.conf.v1 import * # noqa
except ImportError:
print('ERROR: the documentation requires the sphinx-astropy package to be installed')
print(
"ERROR: the documentation requires the sphinx-astropy package to be installed"
)
sys.exit(1)

# Get configuration information from setup.cfg
from configparser import ConfigParser
conf = ConfigParser()

conf.read([os.path.join(os.path.dirname(__file__), '..', 'setup.cfg')])
setup_cfg = dict(conf.items('metadata'))
project_file = pathlib.Path(__file__).resolve().parents[1] / "pyproject.toml"
if not project_file.is_file():
raise FileNotFoundError(f"{project_file} does not exist!")
with open(project_file, "rb") as f:
project_metadata = tomllib.load(f)

project_version = parse(metadata.version(project_metadata["project"]["name"]))

# -- General configuration ----------------------------------------------------

# By default, highlight as Python 3.
highlight_language = 'python3'
highlight_language = "python3"

# If your documentation needs a minimal Sphinx version, state it here.
#needs_sphinx = '1.2'
# needs_sphinx = '1.2'

# To perform a Sphinx version check that needs to be more specific than
# major.minor, call `check_sphinx_version("X.Y.Z")` here.
# check_sphinx_version("1.2.1")

# List of patterns, relative to source directory, that match files and
# directories to ignore when looking for source files.
exclude_patterns.append('_templates')
exclude_patterns = [
"_build",
"_templates",
"include/*.rst",
"help/*.rst",
"scripts/*.rst",
]

# This is added to the end of RST files - a good place to put substitutions to
# be used globally.
rst_epilog += """
"""
# rst_epilog += """
# """

# -- Project information ------------------------------------------------------

# This does not *have* to match the package name, but typically does
project = setup_cfg['name']
author = setup_cfg['author']
copyright = '{0}, {1}'.format(
datetime.datetime.now().year, setup_cfg['author'])
project = project_metadata["project"]["name"]
author = project_metadata["project"]["authors"][0]["name"]
copyright = "{0}, {1}".format(datetime.datetime.now().year, author)

# The version info for the project you're documenting, acts as replacement for
# |version| and |release|, also used in various other places throughout the
# built documents.

import_module(setup_cfg['name'])
package = sys.modules[setup_cfg['name']]

# The short X.Y version.
version = package.__version__.split('-', 1)[0]
version = project_version.public
# The full version, including alpha/beta/rc tags.
release = package.__version__

release = str(project_version.local)

# -- Options for HTML output --------------------------------------------------

Expand All @@ -97,43 +105,43 @@

# Add any paths that contain custom themes here, relative to this directory.
# To use a different custom theme, add the directory containing the theme.
#html_theme_path = []
# html_theme_path = []

# The theme to use for HTML and HTML Help pages. See the documentation for
# a list of builtin themes. To override the custom theme, set this to the
# name of a builtin theme or the name of a custom theme in html_theme_path.
#html_theme = None
# html_theme = None


html_theme_options = {
'logotext1': 'pytelpoint', # white, semi-bold
'logotext2': '', # orange, light
'logotext3': ':docs' # white, light
}
"logotext1": "pytelpoint", # white, semi-bold
"logotext2": "", # orange, light
"logotext3": ":docs", # white, light
}


# Custom sidebar templates, maps document names to template names.
#html_sidebars = {}
# html_sidebars = {}

# The name of an image file (relative to this directory) to place at the top
# of the sidebar.
#html_logo = 'static/Logo.png'
# html_logo = 'static/Logo.png'

# The name of an image file (within the static path) to use as favicon of the
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
# pixels large.
html_favicon = 'static/mmt.ico'
html_favicon = "static/mmt.ico"

# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
# using the given strftime format.
#html_last_updated_fmt = ''
# html_last_updated_fmt = ''

# The name for this set of Sphinx documents. If None, it defaults to
# "<project> v<release> documentation".
html_title = '{0} v{1}'.format(project, release)
html_title = "{0} v{1}".format(project, release)

# Output file base name for HTML help builder.
htmlhelp_basename = project + 'doc'
htmlhelp_basename = project + "doc"

# Prefixes that are ignored for sorting the Python module index
modindex_common_prefix = ["pytelpoint."]
Expand All @@ -143,38 +151,25 @@

# Grouping the document tree into LaTeX files. List of tuples
# (source start file, target name, title, author, documentclass [howto/manual]).
latex_documents = [('index', project + '.tex', project + u' Documentation',
author, 'manual')]
latex_documents = [
("index", project + ".tex", project + " Documentation", author, "manual")
]


# -- Options for manual page output -------------------------------------------

# One entry per manual page. List of tuples
# (source start file, name, description, authors, manual section).
man_pages = [('index', project.lower(), project + u' Documentation',
[author], 1)]


# -- Options for the edit_on_github extension ---------------------------------

if setup_cfg.get('edit_on_github').lower() == 'true':

extensions += ['sphinx_astropy.ext.edit_on_github']

edit_on_github_project = setup_cfg['github_project']
edit_on_github_branch = "main"

edit_on_github_source_root = ""
edit_on_github_doc_root = "docs"
man_pages = [("index", project.lower(), project + " Documentation", [author], 1)]

# -- Resolving issue number to links in changelog -----------------------------
github_issues_url = 'https://github.com/{0}/issues/'.format(setup_cfg['github_project'])
github_issues_url = "https://github.com/mmtobservatory/{0}/issues/".format(project)


# -- Options for linkcheck output -------------------------------------------
linkcheck_retry = 5
linkcheck_ignore = [
r'https://github\.com/mmtobservatory/pytelpoint/(?:issues|pull)/\d+',
r"https://github\.com/mmtobservatory/pytelpoint/(?:issues|pull)/\d+",
]
linkcheck_timeout = 180
linkcheck_anchors = False
Expand Down
119 changes: 115 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,118 @@
[build-system]
[project]
name = "pytelpoint"
dynamic = ["version"]
authors = [
{ name = "T. E. Pickering", email = "te.pickering@gmail.com"}
]
license = {file = "licenses/LICENSE.rst"}
readme = "README.rst"
description = "Python utilities for analyzing telescope pointing and tracking via probabilistic methods."
requires-python = ">=3.13"
dependencies = [
"astropy",
"scipy",
"matplotlib",
"arviz",
"corner",
"pymc",
"pandas",
]

[project.optional-dependencies]
test = [
"tox",
"coverage",
"pytest-astropy",
"black",
"flake8",
"coverage",
"pytest-benchmark",
]
docs = [
"sphinx-astropy",
]
extra = [
"ipympl",
"ipykernel",
]

[project.scripts]
fix_mmtwfs_csvs = "pytelpoint.scripts.fix_csvs:main"
fix_mmirs_exposure_time = "pytelpoint.scripts.fix_mmirs_exposure_time:main"
rename_mmirs_files = "pytelpoint.scripts.rename_mmirs_files:main"
reanalyze = "pytelpoint.scripts.reanalyze:main"

[project.urls]
Repository = "https://github.com/mmtobservatory/pytelpoint.git"
Documentation = "https://pytelpoint.readthedocs.io/"

[tool.setuptools]
include-package-data = true

[tool.setuptools.package-data]
"pytelpoint.test_data" = ["**"]

[tool.setuptools.packages]
find = {}

requires = ["setuptools",
"setuptools_scm",
"wheel"]
[tool.setuptools_scm]
version_file = "pytelpoint/version.py"

[build-system]
requires = [
"setuptools",
"setuptools_scm",
]

build-backend = 'setuptools.build_meta'

[tool.pytest.ini_options]
minversion = "7.0"
testpaths = [
"pytelpoint/tests",
"docs",
]
astropy_header = false
doctest_plus = "enabled"
text_file_format = "rst"
addopts = [
"--color=yes",
"--doctest-rst",
]
xfail_strict = false
filterwarnings = [
"error",
"ignore:numpy\\.ufunc size changed:RuntimeWarning",
"ignore:numpy\\.ndarray size changed:RuntimeWarning",
# numpy 2 deprecation warnings from astropy.units
"ignore:.*__array__ implementation doesn't accept a copy keyword:DeprecationWarning",
]

[tool.coverage]

[tool.coverage.run]
omit = [
"pytelpoint/conftest.py",
"pytelpoint/tests/*",
"pytelpoint/version*",
"*/pytelpoint/conftest.py",
"*/pytelpoint/tests/*",
"*/pytelpoint/version*",
]

[tool.coverage.report]
exclude_lines = [
# Have to re-enable the standard pragma
"pragma: no cover",
# Don't complain about packages we have installed
"except ImportError",
# Don't complain if tests don't hit defensive assertion code:
"raise AssertionError",
"raise NotImplementedError",
# Don't complain about script hooks
"'def main(.*):'",
# Ignore branches that don't pertain to this version of Python
"pragma: py{ignore_python_version}",
# Don't complain about IPython completion helper
"def _ipython_key_completions_",
]
6 changes: 0 additions & 6 deletions pytelpoint/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,3 @@
# Licensed under a 3-clause BSD style license - see LICENSE.rst

# Packages may add whatever they like to this file, but
# should keep this content at the top.
# ----------------------------------------------------------------------------
from ._astropy_init import * # noqa
# ----------------------------------------------------------------------------

__all__ = []
13 changes: 0 additions & 13 deletions pytelpoint/_astropy_init.py

This file was deleted.

Loading
Loading