Skip to content

Commit

Permalink
Merge branch 'dev' into enh/tutorial_order
Browse files Browse the repository at this point in the history
  • Loading branch information
rly authored Aug 25, 2021
2 parents aa776b0 + 9f58cb4 commit 1849790
Show file tree
Hide file tree
Showing 6 changed files with 57 additions and 11 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@

### Tutorial enhancements:
- Enhanced ordering of sphinx gallery tutorials to use alphabetic ordering based on tutorial headings. @oruebel (#1399)
- Updated the general tutorial to add documentation about the ``Images`` type. @bendichter (#1353)

## PyNWB 2.0.0 (August 13, 2021)

Expand Down
8 changes: 4 additions & 4 deletions docs/gallery/domain/plot_icephys.py
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
- :py:class:`~pynwb.icephys.RepetitionsTable` groups sequential recordings from
the :py:class:`~pynwb.icephys.SequentialRecordingsTable`. In practice a
repetition is often also referred to a run. A typical use of the
py:class:`~pynwb.icephys.RepetitionsTable` is to group sets of different stimuli
:py:class:`~pynwb.icephys.RepetitionsTable` is to group sets of different stimuli
that are applied in sequence that may be repeated.
- :py:class:`~pynwb.icephys.ExperimentalConditionsTable` groups repetitions of
intracellular recording from the :py:class:`~pynwb.icephys.RepetitionsTable`
Expand Down Expand Up @@ -387,13 +387,13 @@

#####################################################################
# The :py:class:`~pynwb.icephys.IntracellularRecordingsTable` table is not just a ``DynamicTable``
# but an ``AlignedDynamicTable`. The ``AlignedDynamicTable` type is itself a ``DynamicTable``
# but an ``AlignedDynamicTable``. The ``AlignedDynamicTable`` type is itself a ``DynamicTable``
# that may contain an arbitrary number of additional ``DynamicTable``, each of which defines
# a "category". This is similar to a table with "sub-headings". In the case of the
# :py:class:`~pynwb.icephys.IntracellularRecordingsTable`, we have three predefined categories,
# i.e., electrodes, stimuli, and responses. We can also dynamically add new categories to
# the table. As each category corresponds to a DynamicTable, this means we have to create a
# new DynamicTable and add it to our table.
# the table. As each category corresponds to a ``DynamicTable``, this means we have to create a
# new ``DynamicTable`` and add it to our table.

# Create a new DynamicTable for our category that contains a location column of type VectorData
location_column = VectorData(
Expand Down
54 changes: 48 additions & 6 deletions docs/gallery/general/file.py
Original file line number Diff line number Diff line change
Expand Up @@ -411,19 +411,61 @@
nwbfile.add_unit(id=3, spike_times=[1.2, 2.3, 3.3, 4.5],
obs_intervals=[[1, 10], [20, 30]], location='CA1', quality=0.90)

####################
# Now we overwrite the file with all of the data

with NWBHDF5IO('example_file_path.nwb', 'w') as io:
io.write(nwbfile)

####################
# .. _units_fields_ref:
#
# .. note::
# The Units table has some predefined optional columns. Please review the documentation for
# :py:meth:`~pynwb.file.NWBFile.add_unit` before adding custom columns.

####################
# Images
# ------
#
# You can store static images within the NWB file as well. These can be images of the subject, the environment, stimuli,
# or really anything.
#
# .. note::
# All basic image types :py:class:`~pynwb.image.RGBAImage`, py:class:`~pynwb.image.RGBImage`, and
# py:class:`~pynwb.image.GrayscaleImage` provide the optional: 1) ``description`` parameter to include a
# text description about the image and 2) ``resolution`` parameter to specify the *pixels / cm* resolution
# of the image.

from PIL import Image
import numpy as np

from pynwb.image import RGBAImage, RGBImage, GrayscaleImage
from pynwb.base import Images

img = Image.open('docs/source/logo.png') # an example image

# you can store an RGBA image
rgba_logo = RGBAImage(name='RGBA_logo', data=np.array(img))

# or RGB
rgb_logo = RGBImage(name='RGB_logo', data=np.array(img.convert('RGB')))

# or Grayscale. Here with the optional description and resolution specified.
gs_logo = GrayscaleImage(name='Grayscale_logo',
data=np.array(img.convert('L')),
description='Grayscale version of the NWB logo',
resolution=35.433071)

# Images is a container that accepts any of these image types
images = Images(
name='logo_images',
images=[rgb_logo, rgba_logo, gs_logo]
)

# Finally, do not forget to add the images object to the nwb file.
nwbfile.processing['behavior'].add(images)

####################
# Now we overwrite the file with all of the data

with NWBHDF5IO('example_file_path.nwb', 'w') as io:
io.write(nwbfile)

####################
# .. _basic_appending:
#
Expand Down
4 changes: 3 additions & 1 deletion docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,9 @@
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
# documentation.
# html_theme_options = {}
html_theme_options = {
"style_nav_header_background": "#AFD2E8"
}

# Add any paths that contain custom themes here, relative to this directory.
# html_theme_path = []
Expand Down
Binary file modified docs/source/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions requirements-doc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,4 @@ matplotlib
sphinx_rtd_theme
sphinx-gallery
allensdk>=2.11.0 # python 3.8 is not supported in allensdk<2.11
Pillow

0 comments on commit 1849790

Please sign in to comment.