Skip to content

Commit

Permalink
removing backslash sequences that raise SyntaxWarning in python 3.12+…
Browse files Browse the repository at this point in the history
… when using sphinx-gallery to convert reST to markdown
  • Loading branch information
shachafl committed Nov 8, 2024
1 parent 3f897fb commit 97fe993
Show file tree
Hide file tree
Showing 8 changed files with 16 additions and 16 deletions.
6 changes: 3 additions & 3 deletions examples/data_formatting/plot_format_tilefetcher.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
# ---------------------------
# The :py:class:`.FetchedTile` subclass defines the function you need for reading your images and
# the other properties required by :py:func:`.write_experiment_json` to construct
# :class:`slicedimage.Tile`\s.
# :class:`slicedimage.Tile`.
#
# You can use any function to read images that returns a numpy array. We recommend using
# :py:class:`imageio.volread` for 3D images and :py:class:`skimage.io.imread` for 2D images. For
Expand Down Expand Up @@ -153,7 +153,7 @@ def tile_data(self) -> np.ndarray:
# Define TileFetcher subclass
# ---------------------------
# The :py:class:`.TileFetcher` subclass acts as the interface for :py:func:`.write_experiment_json`
# to know where to get files to construct :class:`slicedimage.Tile`\s.
# to know where to get files to construct :class:`slicedimage.Tile`.
#
# If you are not using structured data, you will need to extend :py:class:`TileFetcher` to reflect
# your own file naming and organization schema.
Expand Down Expand Up @@ -252,4 +252,4 @@ def get_tile(
from starfish import Experiment

exp = Experiment.from_json(os.path.join(outputdir.name, "experiment.json"))
print(exp.fovs())
print(exp.fovs())
2 changes: 1 addition & 1 deletion examples/data_loading/plot_tilefetcher_loader.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
Loading Data through TileFetchers
=================================
:py:class:`.TileFetcher`\s provide a way for starfish's data
:py:class:`.TileFetcher` provide a way for starfish's data
formatting tooling to obtain image data and metadata for each tile that make up an image. It is
possible to use this interface to directly load data into starfish. This could have performance
implications as the TileFetcher's performance could potentially be highly sensitive to the order
Expand Down
4 changes: 2 additions & 2 deletions examples/how_to/clip.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
:py:class:`~starfish.image.Filter.Clip` is useful for normalizing images, removing background,
and removing high-intensity outliers. If you want the values to start from zero after clipping see
:py:class:`~starfish.image.Filter.ClipPercentileToZero`. Both :py:class:`FilterAlgorithm`\s use
:py:class:`~starfish.image.Filter.ClipPercentileToZero`. Both :py:class:`FilterAlgorithm` use
percentiles to set the ``p_min`` and ``p_max`` values to clip by.
"""

Expand Down Expand Up @@ -44,4 +44,4 @@ def plot_intensity_histograms(stack: starfish.ImageStack, r: int):
clipper.run(stack, in_place=True)

# View distribution of intensities after clipping
plot_intensity_histograms(stack, r=0)
plot_intensity_histograms(stack, r=0)
2 changes: 1 addition & 1 deletion examples/how_to/plot_display.py
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@
# tweak your layer properties (see `napari`_).
#
# However, napari doesn't natively support starfish data structures, so to use napari methods
# follow the example below. Adding :py:class:`.IntensityTable`\s is pretty complex,
# follow the example below. Adding :py:class:`.IntensityTable` is pretty complex,
# so we recommend sticking with :py:func:`.display` for that or using the method in the next
# section.
#
Expand Down
6 changes: 3 additions & 3 deletions examples/how_to/tracebuildingstrategies.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
:align: center
The chosen ``TraceBuilder`` must also be compatible with how the :py:class:`.SpotFindingResults`
was generated. :py:class:`.FindSpotsAlgorithm`\s can be run with or without a ``reference_image``.
was generated. :py:class:`.FindSpotsAlgorithm` can be run with or without a ``reference_image``.
If run with a ``reference_image`` then every :py:class:`.PerImageSliceSpotResults` in
:py:class:`.SpotFindingResults` will have the same spots for every (round, channel) image volume.
This is necessary for :py:func:`.build_spot_traces_exact_match` but not recommended for
Expand Down Expand Up @@ -88,7 +88,7 @@
####################################################################################################
# Typical pipelines will set the ``trace_building_strategy`` as an argument in the
# :py:class:`.DecodeSpotsAlgorithm` but here the underlying code is exposed to reveal what the
# different :py:class:`.IntensityTable`\s look like depending on which ``TraceBuilder`` is used.
# different :py:class:`.IntensityTable` look like depending on which ``TraceBuilder`` is used.

from starfish.core.spots.DecodeSpots.trace_builders import build_spot_traces_exact_match, \
build_traces_sequential, build_traces_nearest_neighbors
Expand Down Expand Up @@ -122,4 +122,4 @@
####################################################################################################
# The same :py:func:`.build_traces_nearest_neighbors` applied to spots found in
# :py:class:`.ImageStack` *with* a ``reference image`` guarantees a spot to be found in every
# round of :py:class:`.SpotFindingResults`.
# round of :py:class:`.SpotFindingResults`.
4 changes: 2 additions & 2 deletions examples/tutorials/normalize_intensity_distributions.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
:ref:`section_normalizing_intensities`.
Normalizing the distributions is done in starfish by matching the histograms of
:py:class:`.ImageStack`\s to a reference histogram. The reference histogram is created by
:py:class:`.ImageStack` to a reference histogram. The reference histogram is created by
averaging the histograms from each group defined by the ``group_by`` parameter. These groups also
determine along which :py:class:`.Axes` the intensities will be normalized.
Expand Down Expand Up @@ -128,4 +128,4 @@ def plot_intensity_histograms(
# * normalizing with ``group_by={Axes.CH}`` has the effect of significantly rescaling histograms of channel 0 to match histograms of the other channels
# * normalizing with ``group_by={Axes.R}`` does not scale histograms of channel 0 to match histograms of other channels
# * normalizing with ``group_by={Axes.CH, Axes.ROUND}`` scales histograms from every round and channel to match each other
plot_intensity_histograms(ref=stack, scaled_cr=scaled_cr, scaled_c=scaled_c, scaled_r=scaled_r, r=0)
plot_intensity_histograms(ref=stack, scaled_cr=scaled_cr, scaled_c=scaled_c, scaled_r=scaled_r, r=0)
6 changes: 3 additions & 3 deletions examples/tutorials/spotbased_decoding.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,10 @@
"""

####################################################################################################
# Comparison of :py:class:`.FindSpotsAlgorithm`\s
# Comparison of :py:class:`.FindSpotsAlgorithm`
# -----------------------------------------------
# This tutorial demonstrates usage and characteristics of the three available
# :py:class:`.FindSpotsAlgorithm`\s on 3-Dimensional STARmap images. Parameters were roughly
# :py:class:`.FindSpotsAlgorithm` on 3-Dimensional STARmap images. Parameters were roughly
# tuned, but these results are not reflective of the best possible performance of each
# :py:class:`.FindSpotsAlgorithm`.

Expand Down Expand Up @@ -277,4 +277,4 @@ def get_cropped_coords(table, x_min, x_max, y_min, y_max):
# display(stack=cropped_dots, spots=lmp_table)

# TrackpyLocalMaxPeakFinder
# display(stack=cropped_dots, spots=tlmpf_table)
# display(stack=cropped_dots, spots=tlmpf_table)
2 changes: 1 addition & 1 deletion examples/tutorials/watershed_segmentation.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
classes and methods provided in :py:mod:`.morphology`. Then this tutorial will cover how to run
the predefined segmentation pipeline.
Inputs for this tutorial are :py:class:`.ImageStack`\s:
Inputs for this tutorial are :py:class:`.ImageStack`:
* registered primary images to mimic a cell stain
* registered nuclei images to seed the water segmentation of cells
Expand Down

0 comments on commit 97fe993

Please sign in to comment.