Skip to content

Commit

Permalink
Modernise documentation (#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
sjperkins authored Apr 15, 2024
1 parent ca06461 commit 47a0142
Show file tree
Hide file tree
Showing 27 changed files with 304 additions and 419 deletions.
5 changes: 5 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,8 @@ repos:
hooks:
- id: ruff-format
name: ruff format
- repo: https://github.com/pre-commit/mirrors-mypy
rev: v1.9.0
hooks:
- id: mypy
name: mypy
15 changes: 15 additions & 0 deletions .readthedocs.yaml
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
1 change: 1 addition & 0 deletions HISTORY.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ History

X.Y.Z (YYYY-MM-DD)
------------------
* Modernise documentation (:pr:`38`)
* Add basic Affine Grid coordinates to xarray datasets (:pr:`35`)
* Constrain dask versions (:pr:`34`)
* Specify dtype during chunk normalisation (:pr:`33`)
Expand Down
51 changes: 1 addition & 50 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2,53 +2,4 @@
xarray-fits
===========

Given some FITS files with matching HDUs:

.. code-block:: bash
$ tree data
/home/user/data
├── data-0.fits
├── data-1.fits
└── data-2.fits
0 directories, 3 files
.. code-block:: python
>>> from xarrayfits import xds_from_fits
>>> datasets = xds_from_fits("/home/user/data*", prefix="data")
The above returns a list of three xarray Datasets

.. code-block:: python
>>> datasets
[<xarray.Dataset> Size: 800B
Dimensions: (data0-0: 10, data0-1: 10)
Dimensions without coordinates: data0-0, data0-1
Data variables:
data0 (data0-0, data0-1) float64 800B dask.array<chunksize=(10, 10), meta=np.ndarray>,
<xarray.Dataset> Size: 800B
Dimensions: (data0-0: 10, data0-1: 10)
Dimensions without coordinates: data0-0, data0-1
Data variables:
data0 (data0-0, data0-1) float64 800B dask.array<chunksize=(10, 10), meta=np.ndarray>,
<xarray.Dataset> Size: 800B
Dimensions: (data0-0: 10, data0-1: 10)
Dimensions without coordinates: data0-0, data0-1
Data variables:
data0 (data0-0, data0-1) float64 800B dask.array<chunksize=(10, 10), meta=np.ndarray>]
Using xarray these can be concatenated along a dimension:

.. code-block:: python
>>> import xarray
>>> ds = xarray.concat(datasets, dim="data0-0")
>>> ds
<xarray.Dataset> Size: 2kB
Dimensions: (data0-0: 30, data0-1: 10)
Dimensions without coordinates: data0-0, data0-1
Data variables:
data0 (data0-0, data0-1) float64 2kB dask.array<chunksize=(10, 10), meta=np.ndarray>
Documentation: https://xarray-fits.readthedocs.io
3 changes: 0 additions & 3 deletions docs/.gitignore

This file was deleted.

12 changes: 6 additions & 6 deletions docs/Makefile
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Minimal makefile for Sphinx documentation
#

# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = python -msphinx
SPHINXPROJ = xarrayfits
SOURCEDIR = .
BUILDDIR = _build
# 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:
Expand Down
6 changes: 0 additions & 6 deletions docs/api.rst

This file was deleted.

1 change: 0 additions & 1 deletion docs/authors.rst

This file was deleted.

169 changes: 0 additions & 169 deletions docs/conf.py

This file was deleted.

1 change: 0 additions & 1 deletion docs/contributing.rst

This file was deleted.

1 change: 0 additions & 1 deletion docs/history.rst

This file was deleted.

21 changes: 0 additions & 21 deletions docs/index.rst

This file was deleted.

51 changes: 0 additions & 51 deletions docs/installation.rst

This file was deleted.

Loading

0 comments on commit 47a0142

Please sign in to comment.