Skip to content

Commit

Permalink
fix header and page title formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
alphasentaurii committed Jan 28, 2025
1 parent d453fea commit e6f9816
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 18 deletions.
3 changes: 3 additions & 0 deletions docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -132,3 +132,6 @@ doctest:
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
@echo "Testing of doctests in the sources finished, look at the " \
"results in $(BUILDDIR)/doctest/output.txt."

livehtml:
sphinx-autobuild "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
20 changes: 13 additions & 7 deletions docs/asdf/arrays.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
.. currentmodule:: asdf

**********
Array Data
**********


Saving arrays
-------------
=============

Beyond the basic data types of dictionaries, lists, strings and numbers, the
most important thing ASDF can save is arrays. It's as simple as putting a
Expand Down Expand Up @@ -29,8 +34,9 @@ the array, but the actual array content is in a binary block.

.. asdf:: test.asdf


Sharing of data
---------------
===============

Arrays that are views on the same data automatically share the same
data in the file. In this example an array and a subview on that same
Expand Down Expand Up @@ -60,7 +66,7 @@ a specific array.
.. asdf:: test.asdf

Saving inline arrays
--------------------
====================

For small arrays, you may not care about the efficiency of a binary
representation and just want to save the array contents directly in the YAML
Expand Down Expand Up @@ -104,7 +110,7 @@ see :ref:`config_options_array_inline_threshold`.
.. _exploded:

Saving external arrays
----------------------
======================

ASDF files may also be saved in "exploded form", which creates multiple files
corresponding to the following data items:
Expand Down Expand Up @@ -152,7 +158,7 @@ To save a block in an external file, set its block type to
.. asdf:: test0000.asdf

Streaming array data
--------------------
====================

In certain scenarios, you may want to stream data to disk, rather than
writing an entire array of data at once. For example, it may not be
Expand Down Expand Up @@ -224,7 +230,7 @@ to numpy arrays stored in ASDF:
fd.write(array.tobytes())

Compression
-----------
===========

Individual blocks in an ASDF file may be compressed.

Expand Down Expand Up @@ -271,7 +277,7 @@ different compression algorithm when writing the file out again.
af.write_to('different.asdf', all_array_compression='lz4')
Memory mapping
--------------
==============

By default, all internal array data is memory mapped using `numpy.memmap`. This
allows for the efficient use of memory even when reading files with very large
Expand Down
1 change: 1 addition & 0 deletions docs/asdf/features.rst
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
Core Features
*************


This section discusses the core features of the ASDF data format, and provides
examples and use cases that are specific to the Python implementation.

Expand Down
27 changes: 16 additions & 11 deletions docs/asdf/using_extensions.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,12 @@
.. currentmodule:: asdf

****************
Using Extensions
****************


The built-in extension
----------------------
======================

The ability to serialize the following types is provided by `asdf`'s built-in
extension:
Expand All @@ -21,7 +26,7 @@ its implementation. However, it is useful to be aware that the built-in
extension is always in effect when reading and writing ASDF files.

Custom types
------------
============

For the purposes of this documentation, a "custom type" is any data type that
can not be serialized by the built-in extension.
Expand All @@ -43,7 +48,7 @@ The version number will increase whenever a schema (and therefore the converter
implementation) changes.

Extensions
----------
==========

In order for the converters and schemas to be used by `asdf`, they must be
packaged into an **extension** class. In general, the details of extensions are
Expand All @@ -58,7 +63,7 @@ always used). There are two ways to use custom extensions, which are detailed
below in :ref:`other_packages` and :ref:`explicit_extensions`.

Writing custom types to files
*****************************
-----------------------------

`asdf` is not capable of serializing any custom type unless an extension is
provided that defines how to serialize that type. Attempting to do so will
Expand All @@ -68,7 +73,7 @@ for custom types and extensions, see :ref:`extending_extensions`.
.. _reading_custom_types:

Reading files with custom types
*******************************
-------------------------------

The `asdf` software is capable of reading files that contain custom data types
even if the extension that was used to create the file is not present. However,
Expand All @@ -93,7 +98,7 @@ that are required for instantiating custom types when reading ASDF files.
.. _custom_type_versions:

Custom types, extensions, and versioning
----------------------------------------
========================================

Tags and schemas that follow best practices are versioned. This allows changes
to tags and schemas to be recorded, and it allows `asdf` to define behavior with
Expand All @@ -108,7 +113,7 @@ Since ASDF is designed to be an archival file format, extension authors are
encouraged to maintain backwards compatibility with all older tag versions.

Reading files
*************
-------------

When `asdf` encounters a tagged object in a file, it will compare the URI of
the tag in the file with the list of tags handled by available converters.
Expand All @@ -121,7 +126,7 @@ found by the library will be used. Users may disable a converter by removing
its extension with the `~asdf.config.AsdfConfig.remove_extension` method.

Writing files
*************
-------------

When writing a object to a file, `asdf` compares the object's type to the list
of types handled by available converters. The first matching converter will
Expand All @@ -135,7 +140,7 @@ its extension with the `~asdf.config.AsdfConfig.remove_extension` method.
.. _other_packages:

Extensions from other packages
------------------------------
==============================

Some external packages may define extensions that allow `asdf` to recognize some
or all of the types that are defined by that package. Such packages may install
Expand Down Expand Up @@ -163,7 +168,7 @@ other extensions from other packages, depending on what is installed.
.. _explicit_extensions:

Explicit use of extensions
--------------------------
==========================

Sometimes no packaged extensions are provided for the types you wish to
serialize. In this case, it is necessary to explicitly install any necessary
Expand Down Expand Up @@ -207,7 +212,7 @@ To read the file (in a new session) we again need to install the extension first
.. _extension_checking:

Extension checking
------------------
==================

When writing ASDF files using this software, metadata about the extensions that
were used to create the file will be added to the file itself. This includes
Expand Down

0 comments on commit e6f9816

Please sign in to comment.