Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,9 @@ ncempy/venv

# Rope project settings
.ropeproject
sphinx-apidoc

# Auto-generated by sphinxcontrib.apidoc on each docs build (see docs/conf.py)
docs/ncempy*.rst

# Vim
tags
Expand Down
18 changes: 18 additions & 0 deletions .readthedocs.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
version: 2

build:
os: ubuntu-24.04
tools:
python: "3.12"

sphinx:
configuration: docs/conf.py
fail_on_warning: false

python:
install:
- method: pip
path: .
extra_requirements:
- jupyter
- requirements: docs/requirements.txt
3 changes: 3 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ The openNCEM collection comes with different components, described below.
**tools**
The tools build leveraging the algorithms and routines provided in the libraries/packages. They are subordered by the different problems they address.

**python_titan**
A set of open source automation packages for Thermo Fisher transmission electron microscopes.

Commands
========

Expand Down
31 changes: 31 additions & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,41 @@
'sphinx.ext.todo',
'sphinx.ext.viewcode',
'sphinx.ext.napoleon',
'sphinx.ext.intersphinx',
'sphinxcontrib.apidoc',
]

napoleon_include_init_with_doc = False

# Document docstring "Attributes" sections as :ivar: fields instead of as
# separate autodoc attribute entries. Several classes (e.g. ncempy.io.dm.fileDM)
# declare their attributes via __slots__, which autodoc also picks up directly;
# without this, each one is documented twice and Sphinx raises "duplicate
# object description" warnings.
napoleon_use_ivar = True

# -- sphinxcontrib.apidoc ---------------------------------------------------
# Regenerates the ncempy.*.rst stub files from the package source on every
# build, instead of hand-maintaining them. This keeps the module list from
# drifting out of sync with the actual submodules.
apidoc_module_dir = '../ncempy'
apidoc_output_dir = '.'
apidoc_excluded_paths = ['test']
apidoc_separate_modules = True
apidoc_module_first = True
apidoc_toc_file = False

# -- sphinx.ext.intersphinx --------------------------------------------------
# Lets type references in docstrings (e.g. `numpy.ndarray`) link out to the
# referenced project's own docs.
intersphinx_mapping = {
'python': ('https://docs.python.org/3', None),
'numpy': ('https://numpy.org/doc/stable/', None),
'scipy': ('https://docs.scipy.org/doc/scipy/', None),
'h5py': ('https://docs.h5py.org/en/stable/', None),
'matplotlib': ('https://matplotlib.org/stable/', None),
}

# Add any paths that contain templates here, relative to this directory.
templates_path = ['_templates']

Expand Down
17 changes: 17 additions & 0 deletions docs/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ The openNCEM collection comes with different components. The general functionali
ncempy - openNCEM's python package<ncempy>
tools - wrapping the provided functionality into useful tools<tools>

**python_titan**
A set of open source automation packages for Thermo Fisher transmission electron microscopes.

Examples
--------
Simple file reading
Expand Down Expand Up @@ -61,6 +64,20 @@ Here is how to open a DM file and have access to the internal file parameters
>>> print(dm0.metaData) # all of the interesting metadata for this data set (pixel size, accelerating voltage, etc.)
>>> print(dm0.allTags) # all of the tags in the file including tags specific to the Digital Micrpograph software program

Reading Dectris Arina 4D-STEM data
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
The Dectris Arina detector writes its 4D-STEM data set across an HDF5 master
file and one or more linked data files. Use `ncempy.io.dectris` to load the
full 4D data set from the master file.

.. code-block:: python

>>> import ncempy.io as nio
>>> with nio.dectris.fileDECTRIS('/path/to/file/master.h5') as f0:
>>> data = f0.getDataset() # the full 4D data set, shape [scanY, scanX, frameY, frameX]
>>> print(data['data'].shape)
>>> print(f0.getMetadata()) # scan metadata (e.g. pixel size), if available

License
-------

Expand Down
93 changes: 0 additions & 93 deletions docs/ncempy.algo.rst

This file was deleted.

22 changes: 0 additions & 22 deletions docs/ncempy.command_line.rst

This file was deleted.

54 changes: 0 additions & 54 deletions docs/ncempy.edstomo.rst

This file was deleted.

29 changes: 0 additions & 29 deletions docs/ncempy.eval.rst

This file was deleted.

53 changes: 0 additions & 53 deletions docs/ncempy.io.rst

This file was deleted.

15 changes: 0 additions & 15 deletions docs/ncempy.rst

This file was deleted.

7 changes: 0 additions & 7 deletions docs/ncempy.viz.rst

This file was deleted.

3 changes: 3 additions & 0 deletions docs/requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
sphinx
sphinx-rtd-theme
sphinxcontrib-apidoc
Loading