-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
176 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
version: 2 | ||
|
||
build: | ||
os: "ubuntu-22.04" | ||
tools: | ||
python: "3.11" | ||
|
||
python: | ||
install: | ||
- requirements: docs/requirements.txt | ||
- method: pip | ||
path: . | ||
|
||
sphinx: | ||
configuration: docs/source/conf.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# Minimal makefile for Sphinx documentation | ||
# | ||
|
||
# You can set these variables from the command line, and also | ||
# from the environment for the first two. | ||
SPHINXOPTS ?= | ||
SPHINXBUILD ?= sphinx-build | ||
SOURCEDIR = source | ||
BUILDDIR = build | ||
|
||
# Put it first so that "make" without argument is like "make help". | ||
help: | ||
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) | ||
|
||
.PHONY: help Makefile | ||
|
||
# Catch-all target: route all unknown targets to Sphinx using the new | ||
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). | ||
%: Makefile | ||
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
@ECHO OFF | ||
|
||
pushd %~dp0 | ||
|
||
REM Command file for Sphinx documentation | ||
|
||
if "%SPHINXBUILD%" == "" ( | ||
set SPHINXBUILD=sphinx-build | ||
) | ||
set SOURCEDIR=source | ||
set BUILDDIR=build | ||
|
||
if "%1" == "" goto help | ||
|
||
%SPHINXBUILD% >NUL 2>NUL | ||
if errorlevel 9009 ( | ||
echo. | ||
echo.The 'sphinx-build' command was not found. Make sure you have Sphinx | ||
echo.installed, then set the SPHINXBUILD environment variable to point | ||
echo.to the full path of the 'sphinx-build' executable. Alternatively you | ||
echo.may add the Sphinx directory to PATH. | ||
echo. | ||
echo.If you don't have Sphinx installed, grab it from | ||
echo.http://sphinx-doc.org/ | ||
exit /b 1 | ||
) | ||
|
||
%SPHINXBUILD% -M %1 %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% | ||
goto end | ||
|
||
:help | ||
%SPHINXBUILD% -M help %SOURCEDIR% %BUILDDIR% %SPHINXOPTS% %O% | ||
|
||
:end | ||
popd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
furo==2024.1.29 | ||
numpydoc==1.7.0 | ||
sphinx==7.1.2 | ||
tomli==2.0.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
API | ||
=== | ||
|
||
.. autosummary:: | ||
:toctree: generated | ||
|
||
Reading from FITS files | ||
----------------------- | ||
|
||
.. autofunction:: xarrayfits.xds_from_fits |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
# Configuration file for the Sphinx documentation builder. | ||
|
||
# -- Project information | ||
|
||
from datetime import datetime | ||
import tomli | ||
|
||
with open("../../pyproject.toml", "rb") as f: | ||
toml = tomli.load(f) | ||
pyproject = toml["tool"]["poetry"] | ||
|
||
project = pyproject["name"] | ||
copyright = f"{datetime.now().year}, South African Radio Astronomy Observatory (SARAO)" | ||
author = "South African Radio Astronomy Observatory (SARAO)" | ||
|
||
release = pyproject["version"] | ||
version = pyproject["version"] | ||
|
||
# -- General configuration | ||
|
||
extensions = [ | ||
"sphinx.ext.duration", | ||
"sphinx.ext.doctest", | ||
"sphinx.ext.autodoc", | ||
"sphinx.ext.autosummary", | ||
"sphinx.ext.intersphinx", | ||
] | ||
|
||
intersphinx_mapping = { | ||
"python": ("https://docs.python.org/3/", None), | ||
"sphinx": ("https://www.sphinx-doc.org/en/master/", None), | ||
"xarray": ("https://docs.xarray.dev/en/stable/", None), | ||
} | ||
intersphinx_disabled_domains = ["std"] | ||
|
||
templates_path = ["_templates"] | ||
|
||
# -- Options for HTML output | ||
|
||
html_theme = "furo" | ||
|
||
# -- Options for EPUB output | ||
epub_show_urls = "footnote" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
Welcome to xarray-fits's documentation! | ||
======================================= | ||
|
||
**xarray-fits** is a Python library for | ||
expressing fits files as xarray datasets. | ||
|
||
Check out the :doc:`usage` section for further information, including | ||
how to :ref:`installation` the project. | ||
|
||
.. note:: | ||
|
||
This project is under active development. | ||
|
||
Contents | ||
-------- | ||
|
||
.. toctree:: | ||
:maxdepth: 3 | ||
|
||
usage | ||
api |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
Usage | ||
===== | ||
|
||
.. _installation: | ||
|
||
Installation | ||
------------ | ||
|
||
To use xarray-fits, first install it using pip: | ||
|
||
.. code-block:: console | ||
(.venv) $ pip install xarray-fits | ||
Creating xarray datasets from FITS files | ||
---------------------------------------- | ||
|
||
To retrieve a list of xarray datasets with | ||
FITS file contents, you can use the | ||
``xarrayfits.xds_from_fits()`` function: | ||
|
||
.. autofunction:: xarrayfits.xds_from_fits | ||
:noindex: | ||
|
||
For example: | ||
|
||
>>> from xarrayfits import xds_from_fits | ||
>>> xds_from_fits("3C147.fits") |