Skip to content

Commit 60afaa6

Browse files
committed
renaming and new egs
1 parent db88f0a commit 60afaa6

File tree

13 files changed

+748
-37
lines changed

13 files changed

+748
-37
lines changed

docs/Makefile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line, and also
5+
# from the environment for the first two.
6+
SPHINXOPTS ?=
7+
SPHINXBUILD ?= sphinx-build
8+
SOURCEDIR = source
9+
BUILDDIR = build
10+
11+
# Put it first so that "make" without argument is like "make help".
12+
help:
13+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14+
15+
.PHONY: help Makefile
16+
17+
# Catch-all target: route all unknown targets to Sphinx using the new
18+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19+
%: Makefile
20+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

docs/make.bat

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
@ECHO OFF
2+
3+
pushd %~dp0
4+
5+
REM Command file for Sphinx documentation
6+
7+
if "%SPHINXBUILD%" == "" (
8+
set SPHINXBUILD=sphinx-build
9+
)
10+
set SOURCEDIR=source
11+
set BUILDDIR=build
12+
13+
%SPHINXBUILD% >NUL 2>NUL
14+
if errorlevel 9009 (
15+
echo.
16+
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx
17+
echo.installed, then set the SPHINXBUILD environment variable to point
18+
echo.to the full path of the 'sphinx-build' executable. Alternatively you
19+
echo.may add the Sphinx directory to PATH.
20+
echo.
21+
echo.If you don't have Sphinx installed, grab it from
22+
echo.https://www.sphinx-doc.org/
23+
exit /b 1
24+
)
25+
26+
if "%1" == "" goto help
27+
28+
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
29+
goto end
30+
31+
:help
32+
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O%
33+
34+
:end
35+
popd

docs/source/conf.py

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Configuration file for the Sphinx documentation builder.
2+
#
3+
# For the full list of built-in configuration values, see the documentation:
4+
# https://www.sphinx-doc.org/en/master/usage/configuration.html
5+
6+
# -- Project information -----------------------------------------------------
7+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#project-information
8+
9+
import os
10+
import sys
11+
12+
# add path to source code
13+
sys.path.insert(0, os.path.abspath("../src/"))
14+
15+
project = "mphot"
16+
copyright = "2024, Peter Pihlmann Pedersen"
17+
author = "Peter Pihlmann Pedersen"
18+
release = "0.0.1"
19+
20+
# -- General configuration ---------------------------------------------------
21+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#general-configuration
22+
23+
extensions = [
24+
"sphinx.ext.autodoc",
25+
"sphinx.ext.viewcode",
26+
"sphinx.ext.napoleon",
27+
"sphinx_copybutton",
28+
"myst_parser",
29+
]
30+
31+
templates_path = ["_templates"]
32+
exclude_patterns = ["_build", "Thumbs.db", ".DS_Store"]
33+
34+
35+
# -- Options for HTML output -------------------------------------------------
36+
# https://www.sphinx-doc.org/en/master/usage/configuration.html#options-for-html-output
37+
38+
html_theme = "sphinx_book_theme"
39+
html_title = "mphot"
40+
html_static_path = ["_static"]
41+
html_context = {
42+
# ...
43+
"default_mode": "light"
44+
}

docs/source/index.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
.. mphot documentation master file, created by
2+
sphinx-quickstart on Sat Oct 5 09:42:26 2024.
3+
You can adapt this file completely to your liking, but it should at least
4+
contain the root `toctree` directive.
5+
6+
mphot documentation
7+
===================
8+
9+
Add your content using ``reStructuredText`` syntax. See the
10+
`reStructuredText <https://www.sphinx-doc.org/en/master/usage/restructuredtext/index.html>`_
11+
documentation for details.
12+
13+
14+
.. toctree::
15+
:maxdepth: 1
16+
:caption: Contents:
17+
18+
mphot

docs/source/modules.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
mphot
2+
=====
3+
4+
.. toctree::
5+
:maxdepth: 4
6+
7+
mphot

docs/source/mphot.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
mphot package
2+
=============
3+
4+
mphot.core module
5+
-----------------
6+
7+
.. automodule:: mphot.core
8+
:members:
9+
:undoc-members:
10+
:show-inheritance:

examples/Basic use.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,7 @@
555555
],
556556
"metadata": {
557557
"kernelspec": {
558-
"display_name": "Python 3 (ipykernel)",
558+
"display_name": "mphot",
559559
"language": "python",
560560
"name": "python3"
561561
},

examples/Comparison use.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -540,7 +540,7 @@
540540
],
541541
"metadata": {
542542
"kernelspec": {
543-
"display_name": "Python 3 (ipykernel)",
543+
"display_name": "mphot",
544544
"language": "python",
545545
"name": "python3"
546546
},

examples/Exoplanet transit.ipynb

Lines changed: 575 additions & 0 deletions
Large diffs are not rendered by default.

examples/Precision plot.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -484,7 +484,7 @@
484484
],
485485
"metadata": {
486486
"kernelspec": {
487-
"display_name": "Python 3 (ipykernel)",
487+
"display_name": "mphot",
488488
"language": "python",
489489
"name": "python3"
490490
},

examples/Sensitivity plot.ipynb

Lines changed: 17 additions & 15 deletions
Large diffs are not rendered by default.

src/mphot/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from mphot.mphot import (
1+
from mphot.core import (
22
display_results,
33
generate_system_response,
44
get_precision,

src/mphot/mphot.py renamed to src/mphot/core.py

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def interpolate_dfs(index: list, *data: pd.DataFrame) -> pd.DataFrame:
2626
2727
Args:
2828
index (list): A list of index values to interpolate over.
29-
*data (pd.DataFrame): Variable number of pandas DataFrames to be interpolated.
29+
data (pd.DataFrame): Variable number of pandas DataFrames to be interpolated.
3030
3131
Returns:
3232
pd.DataFrame: A single DataFrame with interpolated values for the given index.
@@ -105,7 +105,7 @@ def generate_flux_grid(
105105
106106
Args:
107107
sResponse (str): Path to the CSV file containing the spectral response function.
108-
extended (bool, optional): If True, use 0.3 to 3.0 micron instead of 0.5 to 2 micron. Default is False.
108+
extended (bool, optional): If True, use 0.3 to 3.0 micron grid instead of 0.5 to 2.0 micron grid. Default is False.
109109
110110
Returns:
111111
tuple: A tuple containing:
@@ -315,7 +315,7 @@ def generate_radiance_grid(
315315
316316
Args:
317317
sResponse (str): Path to the spectral response CSV file.
318-
extended (bool, optional): If True, use 0.3 to 3.0 micron instead of 0.5 to 2 micron. Default is False.
318+
extended (bool, optional): If True, use 0.3 to 3.0 micron grid instead of 0.5 to 2.0 micron grid. Default is False.
319319
320320
Returns:
321321
tuple: A tuple containing:
@@ -715,7 +715,7 @@ def get_precision(
715715
Exposure time in seconds, calculated if None. Default is None.
716716
717717
extended (bool, optional):
718-
If True, use 0.3 to 3.0 micron instead of 0.5 to 2 micron. Default is False.
718+
If True, use 0.3 to 3.0 micron grid instead of 0.5 to 2.0 micron grid. Default is False.
719719
720720
Returns:
721721
tuple: A tuple containing:
@@ -985,7 +985,7 @@ def vega_mag(
985985
A (float):
986986
Aperture area in square meters.
987987
extended (bool, optional):
988-
If True, use 0.3 to 3.0 micron instead of 0.5 to 2 micron. Default is False.
988+
If True, use 0.3 to 3.0 micron grid instead of 0.5 to 2.0 micron grid. Default is False.
989989
990990
Returns:
991991
dict:
@@ -1189,25 +1189,25 @@ def display_results(r1: tuple, r2: tuple = None) -> None:
11891189
"""
11901190
Display the results of the photometric analysis.
11911191
1192-
Parameters:
1192+
Args:
11931193
props_sky (dict):
11941194
Dictionary containing properties of the sky.
11951195
r1 (tuple):
11961196
A tuple containing image precision, binned precision, and components for the first set of results.
1197-
- image_precision1 : dict
1198-
Dictionary containing image precision metrics for the first set.
1199-
- binned_precision1 : dict
1200-
Dictionary containing binned precision metrics for the first set.
1201-
- components1 : dict
1202-
Dictionary containing components for the first set.
1197+
- image_precision1 (dict):
1198+
Dictionary containing image precision metrics for the first set.
1199+
- binned_precision1 (dict):
1200+
Dictionary containing binned precision metrics for the first set.
1201+
- components1 (dict):
1202+
Dictionary containing components for the first set.
12031203
r2 (tuple, optional):
12041204
A tuple containing image precision, binned precision, and components for the second set of results.
1205-
- image_precision2 : dict
1206-
Dictionary containing image precision metrics for the second set.
1207-
- binned_precision2 : dict
1208-
Dictionary containing binned precision metrics for the second set.
1209-
- components2 : dict
1210-
Dictionary containing components for the second set.
1205+
- image_precision2 (dict):
1206+
Dictionary containing image precision metrics for the second set.
1207+
- binned_precision2 (dict):
1208+
Dictionary containing binned precision metrics for the second set.
1209+
- components2 (dict):
1210+
Dictionary containing components for the second set.
12111211
12121212
Returns:
12131213
None

0 commit comments

Comments
 (0)