pylunar 0.7.0__tar.gz → 0.7.2__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (50) hide show
  1. pylunar-0.7.2/.pre-commit-config.yaml +32 -0
  2. {pylunar-0.7.0 → pylunar-0.7.2}/CONTRIBUTING.rst +22 -19
  3. {pylunar-0.7.0 → pylunar-0.7.2}/HISTORY.rst +18 -0
  4. {pylunar-0.7.0 → pylunar-0.7.2}/LICENSE +1 -1
  5. pylunar-0.7.2/MANIFEST.in +8 -0
  6. pylunar-0.7.2/Makefile +62 -0
  7. pylunar-0.7.2/PKG-INFO +78 -0
  8. {pylunar-0.7.0 → pylunar-0.7.2}/README.rst +8 -3
  9. pylunar-0.7.2/docs/conf.py +102 -0
  10. {pylunar-0.7.0 → pylunar-0.7.2}/docs/index.rst +1 -0
  11. pylunar-0.7.2/pyproject.toml +122 -0
  12. pylunar-0.7.0/pylunar/__init__.py → pylunar-0.7.2/scripts/startup.py +5 -8
  13. pylunar-0.7.2/setup.cfg +4 -0
  14. pylunar-0.7.2/src/pylunar/__init__.py +42 -0
  15. {pylunar-0.7.0 → pylunar-0.7.2/src}/pylunar/helpers.py +12 -8
  16. pylunar-0.7.2/src/pylunar/lunar_feature.py +179 -0
  17. pylunar-0.7.2/src/pylunar/lunar_feature_container.py +97 -0
  18. {pylunar-0.7.0 → pylunar-0.7.2/src}/pylunar/moon_info.py +167 -130
  19. pylunar-0.7.2/src/pylunar/pkg_types.py +31 -0
  20. pylunar-0.7.2/src/pylunar.egg-info/PKG-INFO +78 -0
  21. pylunar-0.7.2/src/pylunar.egg-info/SOURCES.txt +37 -0
  22. pylunar-0.7.2/src/pylunar.egg-info/requires.txt +25 -0
  23. {pylunar-0.7.0 → pylunar-0.7.2}/tests/test_helpers.py +5 -4
  24. {pylunar-0.7.0 → pylunar-0.7.2}/tests/test_lunar_feature.py +34 -11
  25. {pylunar-0.7.0 → pylunar-0.7.2}/tests/test_lunar_feature_container.py +8 -7
  26. {pylunar-0.7.0 → pylunar-0.7.2}/tests/test_moon_info.py +44 -37
  27. pylunar-0.7.2/tox.ini +52 -0
  28. pylunar-0.7.0/MANIFEST.in +0 -12
  29. pylunar-0.7.0/PKG-INFO +0 -175
  30. pylunar-0.7.0/docs/conf.py +0 -254
  31. pylunar-0.7.0/pylunar/lunar_feature.py +0 -149
  32. pylunar-0.7.0/pylunar/lunar_feature_container.py +0 -91
  33. pylunar-0.7.0/pylunar.egg-info/PKG-INFO +0 -175
  34. pylunar-0.7.0/pylunar.egg-info/SOURCES.txt +0 -34
  35. pylunar-0.7.0/pylunar.egg-info/not-zip-safe +0 -1
  36. pylunar-0.7.0/pylunar.egg-info/requires.txt +0 -2
  37. pylunar-0.7.0/setup.cfg +0 -28
  38. pylunar-0.7.0/setup.py +0 -73
  39. {pylunar-0.7.0 → pylunar-0.7.2}/AUTHORS.rst +0 -0
  40. {pylunar-0.7.0 → pylunar-0.7.2}/docs/Makefile +0 -0
  41. {pylunar-0.7.0 → pylunar-0.7.2}/docs/authors.rst +0 -0
  42. {pylunar-0.7.0 → pylunar-0.7.2}/docs/contributing.rst +0 -0
  43. {pylunar-0.7.0 → pylunar-0.7.2}/docs/history.rst +0 -0
  44. {pylunar-0.7.0 → pylunar-0.7.2}/docs/installation.rst +0 -0
  45. {pylunar-0.7.0 → pylunar-0.7.2}/docs/make.bat +0 -0
  46. {pylunar-0.7.0 → pylunar-0.7.2}/docs/usage.rst +0 -0
  47. {pylunar-0.7.0/pylunar/db → pylunar-0.7.2/src/pylunar/data}/lunar.db +0 -0
  48. {pylunar-0.7.0 → pylunar-0.7.2/src}/pylunar.egg-info/dependency_links.txt +0 -0
  49. {pylunar-0.7.0 → pylunar-0.7.2/src}/pylunar.egg-info/top_level.txt +0 -0
  50. {pylunar-0.7.0 → pylunar-0.7.2}/tests/__init__.py +0 -0
@@ -0,0 +1,32 @@
1
+ repos:
2
+ - repo: https://github.com/pre-commit/pre-commit-hooks
3
+ rev: v4.5.0
4
+ hooks:
5
+ - id: check-merge-conflict
6
+ - id: check-toml
7
+ - id: check-yaml
8
+ - id: trailing-whitespace
9
+
10
+ - repo: https://github.com/astral-sh/ruff-pre-commit
11
+ rev: v0.1.11
12
+ hooks:
13
+ - id: ruff
14
+ args: [--fix, --exit-non-zero-on-fix]
15
+ - id: ruff-format
16
+
17
+ - repo: https://github.com/pre-commit/mirrors-mypy
18
+ rev: v1.8.0
19
+ hooks:
20
+ - id: mypy
21
+ args: [--strict]
22
+ additional_dependencies: [types-pytz==2024.1.0.20240203]
23
+
24
+ - repo: https://github.com/numpy/numpydoc
25
+ rev: v1.6.0
26
+ hooks:
27
+ - id: numpydoc-validation
28
+
29
+ - repo: https://github.com/tox-dev/tox-ini-fmt
30
+ rev: "1.3.1"
31
+ hooks:
32
+ - id: tox-ini-fmt
@@ -3,7 +3,7 @@ Contributing
3
3
  ============
4
4
 
5
5
  Contributions are welcome, and they are greatly appreciated! Every
6
- little bit helps, and credit will always be given.
6
+ little bit helps, and credit will always be given.
7
7
 
8
8
  You can contribute in many ways:
9
9
 
@@ -36,7 +36,7 @@ is open to whoever wants to implement it.
36
36
  Write Documentation
37
37
  ~~~~~~~~~~~~~~~~~~~
38
38
 
39
- Python Lunar could always use more documentation, whether as part of the
39
+ Python Lunar could always use more documentation, whether as part of the
40
40
  official Python Lunar docs, in docstrings, or even on the web in blog posts,
41
41
  articles, and such.
42
42
 
@@ -58,45 +58,48 @@ Get Started!
58
58
  Ready to contribute? Here's how to set up `pylunar` for
59
59
  local development.
60
60
 
61
- 1. Fork the `pylunar` repo on GitHub.
62
- 2. Clone your fork locally::
61
+ #. Fork the `pylunar` repo on GitHub.
62
+ #. Create a vitrual environment for dependency installation.
63
+ #. Clone your fork locally::
63
64
 
64
65
  $ git clone git@github.com:your_name_here/pylunar.git
65
66
 
66
- 3. Create a branch for local development::
67
+ #. Install the dependencies for development and pre-commit hook::
68
+
69
+ $ make init
70
+
71
+ #. Create a branch for local development::
67
72
 
68
73
  $ git checkout -b name-of-your-bugfix-or-feature
69
74
 
70
75
  Now you can make your changes locally.
71
76
 
72
- 4. When you're done making changes, check that your changes pass style and unit
73
- tests, including testing other Python versions with tox::
77
+ #. When you're done making changes, check that your changes pass style and unit
78
+ tests::
74
79
 
75
80
  $ tox
76
81
 
77
- To get tox, just pip install it.
78
-
79
- 5. Commit your changes and push your branch to GitHub::
82
+ #. Commit your changes (this will cause the pre-commit hook to run) and push your branch to GitHub::
80
83
 
81
84
  $ git add .
82
85
  $ git commit -m "Your detailed description of your changes."
83
86
  $ git push origin name-of-your-bugfix-or-feature
84
87
 
85
- 6. Submit a pull request through the GitHub website.
88
+ #. Submit a pull request through the GitHub website.
86
89
 
87
90
  Pull Request Guidelines
88
91
  -----------------------
89
92
 
90
93
  Before you submit a pull request, check that it meets these guidelines:
91
94
 
92
- 1. The pull request should include tests.
93
- 2. If the pull request adds functionality, the docs should be updated. Put
95
+ #. The pull request should include tests.
96
+ #. If the pull request adds functionality, the docs should be updated. Put
94
97
  your new functionality into a function with a docstring, and add the
95
- feature to the list in README.rst.
96
- 3. The pull request should work for Python 2.7, and 3.5, and for PyPy.
97
- Check https://travis-ci.org/mareuter/pylunar
98
- under pull requests for active pull requests or run the ``tox`` command and
99
- make sure that the tests pass for all supported Python versions.
98
+ feature to the list in HISTORY.rst.
99
+ #. The pull request should work for the supported range of Python versions.
100
+ The pull request will run GitHub actions to perform those checks.
101
+ Check https://github.com/mareuter/pylunar/pulls
102
+ for active pull requests and make sure that the checks all passed.
100
103
 
101
104
 
102
105
  Tips
@@ -104,4 +107,4 @@ Tips
104
107
 
105
108
  To run a subset of tests::
106
109
 
107
- $ py.test test/test_pylunar.py
110
+ $ pytest test/test_pylunar.py
@@ -3,6 +3,24 @@
3
3
  History
4
4
  -------
5
5
 
6
+ 0.7.2 (2024-02-26)
7
+ ++++++++++++++++++
8
+
9
+ * Change types module to pkg_types to avoid shadowing builtin
10
+
11
+ 0.7.1 (2024-02-11)
12
+ ++++++++++++++++++
13
+
14
+ * Drop support for Python 3.6 and 3.7
15
+ * Add Python 3.9, 3.10, 3.11 and 3.12 support
16
+ * Switch to pyproject.toml
17
+ * Internal package updates
18
+ * Update docs infrastructure
19
+ * Switch back to tox
20
+ * Add linting and formatting
21
+ * Add mypy and typing
22
+ * Add numpydoc and tox.ini checking
23
+
6
24
  0.7.0 (2023-12-31)
7
25
  ++++++++++++++++++
8
26
 
@@ -1,4 +1,4 @@
1
- Copyright 2016-2020 Michael Reuter
1
+ Copyright 2016-2024 Michael Reuter
2
2
 
3
3
  Redistribution and use in source and binary forms, with or without
4
4
  modification, are permitted provided that the following conditions are met:
@@ -0,0 +1,8 @@
1
+ graft docs
2
+ graft scripts
3
+ graft src
4
+ graft tests
5
+
6
+ global-exclude *~ *.py[cod]
7
+ exclude .readthedocs.yaml .gitignore
8
+ recursive-exclude .github *.yaml
pylunar-0.7.2/Makefile ADDED
@@ -0,0 +1,62 @@
1
+ .PHONY: help init clean-pyc clean-build clean-docs clean lint test coverage docs docs-local release check-build
2
+
3
+ help:
4
+ @echo "init - initialize a clean clone"
5
+ @echo "clean-build - remove build artifacts"
6
+ @echo "clean-pyc - remove Python file artifacts"
7
+ @echo "clean-docs - remove doc build artifacts"
8
+ @echo "clean - remove all artifacts"
9
+ @echo "lint - check style with ruff"
10
+ @echo "test - run tests quickly with the default Python"
11
+ @echo "coverage - check code coverage quickly with the default Python"
12
+ @echo "docs - generate Sphinx HTML documentation, including API docs"
13
+ @echo "docs-local - generate docs and open locally"
14
+ @echo "release - package and upload a release"
15
+ @echo "check-build - check distribution packaging"
16
+
17
+ init:
18
+ pip install --editable .[dev]
19
+ pre-commit install
20
+
21
+ clean: clean-build clean-docs clean-pyc
22
+
23
+ clean-build:
24
+ rm -fr build/
25
+ rm -fr dist/
26
+ rm -fr src/*.egg-info
27
+
28
+ clean-pyc:
29
+ find . -name '*.pyc' -exec rm -f {} +
30
+ find . -name '*.pyo' -exec rm -f {} +
31
+ find . -name '*~' -exec rm -f {} +
32
+
33
+ clean-docs:
34
+ rm -fr docs/api
35
+ $(MAKE) -C docs clean
36
+
37
+ lint:
38
+ tox -e lint
39
+
40
+ test:
41
+ pytest -v --doctest-glob=docs/usage.rst
42
+
43
+ coverage:
44
+ coverage run -m pytest
45
+ coverage report -m
46
+ coverage html
47
+ open htmlcov/index.html
48
+
49
+ docs: clean-docs
50
+ sphinx-apidoc -fMeT -o docs/api src/pylunar
51
+ $(MAKE) -C docs html
52
+
53
+ docs-local: docs
54
+ open docs/_build/html/index.html
55
+
56
+ release: clean
57
+ python -m build
58
+ twine upload dist/*
59
+
60
+ check-build: clean
61
+ python -m build
62
+ twine check dist/*
pylunar-0.7.2/PKG-INFO ADDED
@@ -0,0 +1,78 @@
1
+ Metadata-Version: 2.1
2
+ Name: pylunar
3
+ Version: 0.7.2
4
+ Summary: Information for completing the Astronomical League's Lunar and Lunar II observing programs.
5
+ Author-email: Michael Reuter <mareuternh@gmail.com>
6
+ Project-URL: Documentation, http://pylunar.readthedocs.io
7
+ Project-URL: Repository, https://github.com/mareuter/pylunar
8
+ Classifier: Development Status :: 4 - Beta
9
+ Classifier: Intended Audience :: Developers
10
+ Classifier: License :: OSI Approved :: BSD License
11
+ Classifier: Natural Language :: English
12
+ Classifier: Programming Language :: Python :: 3
13
+ Classifier: Programming Language :: Python :: 3.8
14
+ Classifier: Programming Language :: Python :: 3.9
15
+ Classifier: Programming Language :: Python :: 3.10
16
+ Classifier: Programming Language :: Python :: 3.11
17
+ Classifier: Programming Language :: Python :: 3.12
18
+ Description-Content-Type: text/x-rst
19
+ License-File: LICENSE
20
+ License-File: AUTHORS.rst
21
+ Requires-Dist: ephem==4.1.5
22
+ Requires-Dist: importlib-resources==6.1.1; python_version < "3.10"
23
+ Requires-Dist: typing-extensions==4.9.0; python_version < "3.10"
24
+ Requires-Dist: pytz==2024.1
25
+ Provides-Extra: dev
26
+ Requires-Dist: pylunar[build,docs,lint,test]; extra == "dev"
27
+ Requires-Dist: tox==4.11.4; extra == "dev"
28
+ Provides-Extra: test
29
+ Requires-Dist: coverage[toml]==7.4.0; extra == "test"
30
+ Requires-Dist: pytest==7.4.4; extra == "test"
31
+ Provides-Extra: lint
32
+ Requires-Dist: pre-commit~=3.5.0; extra == "lint"
33
+ Provides-Extra: build
34
+ Requires-Dist: build==1.0.3; extra == "build"
35
+ Requires-Dist: twine==4.0.2; extra == "build"
36
+ Provides-Extra: docs
37
+ Requires-Dist: sphinx~=7.1; extra == "docs"
38
+ Requires-Dist: sphinx_rtd_theme==2.0.0; extra == "docs"
39
+
40
+ =============================
41
+ Python Lunar
42
+ =============================
43
+
44
+ .. |license| image:: https://img.shields.io/pypi/l/pylunar.svg
45
+ :target: http://opensource.org/licenses/BSD
46
+ :alt: BSD License
47
+
48
+ .. |version| image:: http://img.shields.io/pypi/v/pylunar.svg
49
+ :target: https://pypi.python.org/pypi/pylunar
50
+ :alt: Software Version
51
+
52
+ .. |github| image:: https://github.com/mareuter/pylunar/actions/workflows/ci.yaml/badge.svg
53
+ :target: https://github.com/mareuter/pylunar
54
+ :alt: Github build status
55
+
56
+ .. |python| image:: https://img.shields.io/pypi/pyversions/pylunar.svg
57
+ :target: https://pypi.python.org/pypi/pylunar
58
+ :alt: Supported Python
59
+
60
+ .. |docs| image:: https://readthedocs.org/projects/pylunar/badge/?version=latest
61
+ :target: https://pylunar.readthedocs.io
62
+ :alt: Readthedocs status
63
+
64
+ .. |pre-commit| image:: https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit
65
+ :target: https://github.com/pre-commit/pre-commit
66
+ :alt: Uses pre-commit
67
+
68
+ |license| |python| |version| |github| |docs| |pre-commit|
69
+
70
+ Information for completing the Astronomical League's Lunar and Lunar II observing programs. Uses the `pyephem <https://rhodesmill.org/pyephem>`_ package to calculate lunar information.
71
+
72
+
73
+ Features
74
+ --------
75
+
76
+ * Offer moon information based on location and date/time.
77
+ * Offer lunar targets for AL observing clubs based on terminator location.
78
+
@@ -10,7 +10,7 @@ Python Lunar
10
10
  :target: https://pypi.python.org/pypi/pylunar
11
11
  :alt: Software Version
12
12
 
13
- .. |github| image:: https://github.com/mareuter/pylunar/actions/workflows/pythonpackage.yml/badge.svg
13
+ .. |github| image:: https://github.com/mareuter/pylunar/actions/workflows/ci.yaml/badge.svg
14
14
  :target: https://github.com/mareuter/pylunar
15
15
  :alt: Github build status
16
16
 
@@ -22,13 +22,18 @@ Python Lunar
22
22
  :target: https://pylunar.readthedocs.io
23
23
  :alt: Readthedocs status
24
24
 
25
- |license| |python| |version| |github| |docs|
25
+ .. |pre-commit| image:: https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit
26
+ :target: https://github.com/pre-commit/pre-commit
27
+ :alt: Uses pre-commit
26
28
 
27
- Information for completing the Astronomical League's Lunar and Lunar II observing programs.
29
+ |license| |python| |version| |github| |docs| |pre-commit|
30
+
31
+ Information for completing the Astronomical League's Lunar and Lunar II observing programs. Uses the `pyephem <https://rhodesmill.org/pyephem>`_ package to calculate lunar information.
28
32
 
29
33
 
30
34
  Features
31
35
  --------
32
36
 
33
37
  * Offer moon information based on location and date/time.
38
+ * Offer lunar targets for AL observing clubs based on terminator location.
34
39
 
@@ -0,0 +1,102 @@
1
+ # -*- coding: utf-8 -*-
2
+ #
3
+ # complexity documentation build configuration file, created by
4
+ # sphinx-quickstart on Tue Jul 9 22:26:36 2013.
5
+ #
6
+ # This file is execfile()d with the current directory set to its containing dir.
7
+ #
8
+ # Note that not all possible configuration values are present in this
9
+ # autogenerated file.
10
+ #
11
+ # All configuration values have a default; values that are commented out
12
+ # serve to show the default.
13
+
14
+ from __future__ import annotations
15
+
16
+ import sys, os
17
+
18
+ # If extensions (or modules to document with autodoc) are in another directory,
19
+ # add these directories to sys.path here. If the directory is relative to the
20
+ # documentation root, use os.path.abspath to make it absolute, like shown here.
21
+ #sys.path.insert(0, os.path.abspath('.'))
22
+
23
+ cwd = os.getcwd()
24
+ parent = os.path.dirname(cwd)
25
+ sys.path.insert(0, parent)
26
+
27
+ import pylunar
28
+
29
+ # -- General configuration -----------------------------------------------------
30
+
31
+ # Add any Sphinx extension module names here, as strings. They can be extensions
32
+ # coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
33
+ extensions = ['sphinx.ext.autodoc', 'sphinx.ext.autosummary',
34
+ 'sphinx.ext.napoleon', 'sphinx.ext.viewcode']
35
+
36
+ # Add any paths that contain templates here, relative to this directory.
37
+ templates_path = ['_templates']
38
+
39
+ # The suffix of source filenames.
40
+ source_suffix = '.rst'
41
+
42
+ # The master toctree document.
43
+ master_doc = 'index'
44
+
45
+ # General information about the project.
46
+ project = u'Python Lunar'
47
+ copyright = u'2016-2024, Michael Reuter'
48
+
49
+ # The version info for the project you're documenting, acts as replacement for
50
+ # |version| and |release|, also used in various other places throughout the
51
+ # built documents.
52
+ #
53
+ # The short X.Y version.
54
+ version = pylunar.__version__
55
+ # The full version, including alpha/beta/rc tags.
56
+ release = pylunar.__version__
57
+
58
+ # List of patterns, relative to source directory, that match files and
59
+ # directories to ignore when looking for source files.
60
+ exclude_patterns = ['_build']
61
+
62
+ # The name of the Pygments (syntax highlighting) style to use.
63
+ pygments_style = 'sphinx'
64
+
65
+ # -- Options for HTML output ---------------------------------------------------
66
+
67
+ # The theme to use for HTML and HTML Help pages. See the documentation for
68
+ # a list of builtin themes.
69
+ html_theme = 'sphinx_rtd_theme'
70
+
71
+ # Output file base name for HTML help builder.
72
+ htmlhelp_basename = 'pylunardoc'
73
+
74
+ # -- Options for LaTeX output --------------------------------------------------
75
+
76
+ # Grouping the document tree into LaTeX files. List of tuples
77
+ # (source start file, target name, title, author, documentclass [howto/manual]).
78
+ latex_documents = [
79
+ ('index', 'pylunar.tex', u'Python Lunar Documentation',
80
+ u'Michael Reuter', 'manual'),
81
+ ]
82
+
83
+ # -- Options for manual page output --------------------------------------------
84
+
85
+ # One entry per manual page. List of tuples
86
+ # (source start file, name, description, authors, manual section).
87
+ man_pages = [
88
+ ('index', 'pylunar', u'Python Lunar Documentation',
89
+ [u'Michael Reuter'], 1)
90
+ ]
91
+
92
+ # -- Options for Texinfo output ------------------------------------------------
93
+
94
+ # Grouping the document tree into Texinfo files. List of tuples
95
+ # (source start file, target name, title, author,
96
+ # dir menu entry, description, category)
97
+ texinfo_documents = [
98
+ ('index', 'pylunar', u'Python Lunar Documentation',
99
+ u'Michael Reuter', 'pylunar',
100
+ 'Information for completing the Astronomical League\'s Lunar and Lunar II observing programs..',
101
+ 'Miscellaneous'),
102
+ ]
@@ -16,6 +16,7 @@ Contents:
16
16
  contributing
17
17
  authors
18
18
  history
19
+ api/pylunar
19
20
 
20
21
  Feedback
21
22
  ========
@@ -0,0 +1,122 @@
1
+ [build-system]
2
+ requires = [
3
+ "setuptools>=64",
4
+ "setuptools_scm>=8",
5
+ "wheel"
6
+ ]
7
+ build-backend = "setuptools.build_meta"
8
+
9
+ [project]
10
+ dynamic = ["version"]
11
+ name = "pylunar"
12
+ authors = [
13
+ {name = "Michael Reuter", email = "mareuternh@gmail.com"}
14
+ ]
15
+ description = "Information for completing the Astronomical League's Lunar and Lunar II observing programs."
16
+ readme = "README.rst"
17
+ classifiers = [
18
+ "Development Status :: 4 - Beta",
19
+ "Intended Audience :: Developers",
20
+ "License :: OSI Approved :: BSD License",
21
+ "Natural Language :: English",
22
+ "Programming Language :: Python :: 3",
23
+ "Programming Language :: Python :: 3.8",
24
+ "Programming Language :: Python :: 3.9",
25
+ "Programming Language :: Python :: 3.10",
26
+ "Programming Language :: Python :: 3.11",
27
+ "Programming Language :: Python :: 3.12",
28
+ ]
29
+ dependencies = [
30
+ "ephem==4.1.5",
31
+ "importlib-resources==6.1.1;python_version<'3.10'",
32
+ "typing-extensions==4.9.0;python_version<'3.10'",
33
+ "pytz==2024.1"
34
+ ]
35
+
36
+ [project.urls]
37
+ Documentation = "http://pylunar.readthedocs.io"
38
+ Repository = "https://github.com/mareuter/pylunar"
39
+
40
+ [project.optional-dependencies]
41
+ dev = [
42
+ "pylunar[build,docs,lint,test]",
43
+ "tox==4.11.4"
44
+ ]
45
+ test = [
46
+ "coverage[toml]==7.4.0",
47
+ "pytest==7.4.4",
48
+ ]
49
+ lint = [
50
+ "pre-commit~=3.5.0"
51
+ ]
52
+ build = [
53
+ "build==1.0.3",
54
+ "twine==4.0.2"
55
+ ]
56
+ docs = [
57
+ "sphinx~=7.1",
58
+ "sphinx_rtd_theme==2.0.0"
59
+ ]
60
+
61
+ [tool.setuptools_scm]
62
+
63
+ [tool.ruff]
64
+ exclude = [
65
+ "docs/**",
66
+ "scripts/startup.py"
67
+
68
+ ]
69
+ ignore = [
70
+ "D104"
71
+ ]
72
+ line-length = 110
73
+ select = [
74
+ "B",
75
+ "D",
76
+ "E",
77
+ "F",
78
+ "I",
79
+ "SIM",
80
+ "UP",
81
+ "W"
82
+ ]
83
+
84
+ [tool.ruff.per-file-ignores]
85
+ "src/pylunar/__init__.py" = [
86
+ "E402",
87
+ "F401",
88
+ "F403"
89
+ ]
90
+ "tests/**" = [
91
+ "D101",
92
+ "D102",
93
+ "D103",
94
+ ]
95
+
96
+ [tool.ruff.isort]
97
+ force-sort-within-sections = true
98
+
99
+ [tool.ruff.lint.pydocstyle]
100
+ convention = "numpy"
101
+
102
+ [tool.ruff.lint.pycodestyle]
103
+ max-doc-length = 79
104
+
105
+ [tool.mypy]
106
+ ignore_missing_imports = true
107
+
108
+ [tool.numpydoc_validation]
109
+ checks = [
110
+ "all", # report on all checks, except the below
111
+ "EX01",
112
+ "SA01",
113
+ "ES01",
114
+ "GL01",
115
+ "SS05"
116
+ ]
117
+ exclude = [
118
+ "test_*",
119
+ "__init__",
120
+ "conf",
121
+ "startup"
122
+ ]
@@ -8,11 +8,8 @@
8
8
  # Use of this source code is governed by a 3-clause BSD-style
9
9
  # license that can be found in the LICENSE file.
10
10
 
11
- __author__ = 'Michael Reuter'
12
- __email__ = 'mareuternh@gmail.com'
13
- __version__ = '0.7.0'
14
-
15
- from .helpers import *
16
- from .lunar_feature import LunarFeature
17
- from .lunar_feature_container import LunarFeatureContainer
18
- from .moon_info import MoonInfo
11
+ from pylunar import MoonInfo
12
+ location = ((35, 58, 10), (-84, 19, 0))
13
+ obs_datetime = (2013, 10, 18, 22, 0, 0)
14
+ mi = MoonInfo(location[0], location[1])
15
+ mi.update(obs_datetime)
@@ -0,0 +1,4 @@
1
+ [egg_info]
2
+ tag_build =
3
+ tag_date = 0
4
+
@@ -0,0 +1,42 @@
1
+ # This file is part of pylunar.
2
+ #
3
+ # Developed by Michael Reuter.
4
+ #
5
+ # See the LICENSE file at the top-level directory of this distribution
6
+ # for details of code ownership.
7
+ #
8
+ # Use of this source code is governed by a 3-clause BSD-style
9
+ # license that can be found in the LICENSE file.
10
+
11
+ __all__ = [
12
+ "__author__",
13
+ "__email__",
14
+ "__version__",
15
+ "LunarFeature",
16
+ "LunarFeatureContainer",
17
+ "mjd_to_date_tuple",
18
+ "MoonInfo",
19
+ "tuple_to_string",
20
+ "version_info",
21
+ ]
22
+
23
+ from importlib.metadata import PackageNotFoundError, version
24
+
25
+ __author__ = "Michael Reuter"
26
+ __email__ = "mareuternh@gmail.com"
27
+ try:
28
+ __version__ = version("pylunar")
29
+ except PackageNotFoundError:
30
+ # package is not installed
31
+ __version__ = "0.0.0"
32
+
33
+ version_info = __version__.split(".")
34
+ """The decomposed version, split across "``.``."
35
+
36
+ Use this for version comparison.
37
+ """
38
+
39
+ from .helpers import mjd_to_date_tuple, tuple_to_string
40
+ from .lunar_feature import LunarFeature
41
+ from .lunar_feature_container import LunarFeatureContainer
42
+ from .moon_info import MoonInfo
@@ -8,13 +8,18 @@
8
8
  # Use of this source code is governed by a 3-clause BSD-style
9
9
  # license that can be found in the LICENSE file.
10
10
 
11
- """Module for helper functions.
12
- """
11
+ """Module for helper functions."""
12
+
13
+ from __future__ import annotations
14
+
15
+ __all__ = ["mjd_to_date_tuple", "tuple_to_string"]
13
16
 
14
17
  import ephem
15
18
 
19
+ from .pkg_types import DateTimeTuple, DmsCoordinate
20
+
16
21
 
17
- def mjd_to_date_tuple(mjd, round_off=False):
22
+ def mjd_to_date_tuple(mjd: float, round_off: bool = False) -> DateTimeTuple:
18
23
  """Convert a Modified Julian date to a UTC time tuple.
19
24
 
20
25
  Parameters
@@ -29,13 +34,12 @@ def mjd_to_date_tuple(mjd, round_off=False):
29
34
  tuple
30
35
  The UTC time for the MJD.
31
36
  """
32
- if round_off:
33
- return tuple(int(x) for x in ephem.Date(mjd).tuple())
34
- else:
35
- return ephem.Date(mjd).tuple()
37
+ date_tuple: DateTimeTuple
38
+ date_tuple = tuple(int(x) for x in ephem.Date(mjd).tuple()) if round_off else ephem.Date(mjd).tuple()
39
+ return date_tuple
36
40
 
37
41
 
38
- def tuple_to_string(coord):
42
+ def tuple_to_string(coord: DmsCoordinate) -> str:
39
43
  """Return a colon-delimited string.
40
44
 
41
45
  Parameters