Skip to content

Commit

Permalink
Updated documentation for version 0.0.2 (#9)
Browse files Browse the repository at this point in the history
* Integration of CI/CD practices (#2)

* Integration CI/CD pipeline to this project

* Corrected github actions test workflow

* Install the package before test it

* Created empty __init__.py inside tests to record coverage

* Changed name of sample_images_generator.py to utils.py for clarity

* Updated test workflow to use a non-supported workaround for the multiple OpenMP runtime library issue

* Updated test workflow to report coverage

* Moved non-pytorch compatibility test to last position

* Added test for datasets with zero expected samples

* Changed PatchSampler to take as base the patche size instead of the input image's chunk sizes

* Reverted change in the computation when masks elements are relative smaller than patch sizes

* Fixed spatial chunk size computation when patch sizes are grater than the chunk size

* Fixed missing patches from chunks smaller than the input image chunk size

* Padding and stride added to PatchSampler and ImageBase classes to allow overlapping patches extraction

* Added tests for stride and pad parameters of PatchSampler class

* Fixed patch slices generation in PatchSampler to always retrieve patches of the defined shape

* Standardized patch sampling method to handle smaller and bigger mask scales than image scale

* Added example notebook to documentation

* Fix offset (#8)

* Changed PatchSampler to take as base the patche size instead of the input image's chunk sizes

* Reverted change in the computation when masks elements are relative smaller than patch sizes

* Fixed spatial chunk size computation when patch sizes are grater than the chunk size

* Fixed missing patches from chunks smaller than the input image chunk size

* Padding and stride added to PatchSampler and ImageBase classes to allow overlapping patches extraction

* Added tests for stride and pad parameters of PatchSampler class

* Fixed patch slices generation in PatchSampler to always retrieve patches of the defined shape

* Standardized patch sampling method to handle smaller and bigger mask scales than image scale

* Added example notebook to documentation

* Fixed incorrect sampling of patches on masked regions

* Updated documentation for version 0.0.2

* Updated tests/utils.py to use an example image from a public S3 bucket
  • Loading branch information
fercer authored Aug 29, 2024
1 parent 03df904 commit fe19cf4
Show file tree
Hide file tree
Showing 144 changed files with 2,189 additions and 5,792 deletions.
29 changes: 29 additions & 0 deletions .github/workflows/putblish_to_test_pypi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
name: Release to Test PyPI

on:
release:
types: [ released, prereleased ]

jobs:
release:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v2
- name: Set up Python 3.9
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Install Tools
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine
- name: Package and Upload
env:
VERSION: ${{ github.event.release.tag_name }}
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.TEST_PYPI_API_TOKEN }}
run: |
python setup.py sdist bdist_wheel
twine upload --repository-url https://test.pypi.org/legacy/ dist/* --verbose
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -137,3 +137,6 @@ tests/test_zarrs/*
tests/test_tiffs/*
tests/*.png
.vscode/settings.json

/docs_build/
/jupyter_execute/
2 changes: 1 addition & 1 deletion docs/.buildinfo
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# Sphinx build info version 1
# This file hashes the configuration used when building these files. When it is not found, a full rebuild will be done.
config: 5704830082c07750dd4f65112d73bff2
config: ca6db5e3c63f8be4f91f3b82db3b81cf
tags: 645f666f9bcd5a90fca523b33c5a78b7
Binary file modified docs/.doctrees/autoapi/index.doctree
Binary file not shown.
Binary file modified docs/.doctrees/autoapi/zarrdataset/_augs/index.doctree
Binary file not shown.
Binary file not shown.
Binary file modified docs/.doctrees/autoapi/zarrdataset/_maskfuncs/index.doctree
Binary file not shown.
Binary file modified docs/.doctrees/autoapi/zarrdataset/_samplers/index.doctree
Binary file not shown.
Binary file modified docs/.doctrees/autoapi/zarrdataset/_utils/index.doctree
Binary file not shown.
Binary file modified docs/.doctrees/autoapi/zarrdataset/_zarrdataset/index.doctree
Binary file not shown.
Binary file modified docs/.doctrees/autoapi/zarrdataset/index.doctree
Binary file not shown.
Binary file modified docs/.doctrees/environment.pickle
Binary file not shown.
Binary file modified docs/.doctrees/examples/advanced_example_pytorch.doctree
Binary file not shown.
Binary file modified docs/.doctrees/examples/advanced_example_pytorch_inference.doctree
Binary file not shown.
Binary file modified docs/.doctrees/examples/advanced_masked_datasets_example.doctree
Binary file not shown.
Binary file modified docs/.doctrees/examples/basic_example.doctree
Binary file not shown.
Binary file modified docs/.doctrees/examples/basic_example_pytorch.doctree
Binary file not shown.
Binary file modified docs/.doctrees/examples/basic_example_tensorflow.doctree
Binary file not shown.
Binary file modified docs/.doctrees/examples/basic_labeled_datasets_example.doctree
Binary file not shown.
Binary file modified docs/.doctrees/examples/basic_masked_datasets_example.doctree
Binary file not shown.
Binary file modified docs/.doctrees/index.doctree
Binary file not shown.
Binary file modified docs/.doctrees/license_link.doctree
Binary file not shown.
Binary file modified docs/.doctrees/readme_link.doctree
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/_modules/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
<title>Overview: module code &mdash; ZarrDataset documentation</title>
<link rel="stylesheet" type="text/css" href="../_static/pygments.css?v=80d5e7a1" />
<link rel="stylesheet" type="text/css" href="../_static/css/theme.css?v=19f00094" />
<link rel="stylesheet" type="text/css" href="../_static/mystnb.4510f1fc1dee50b3e5859aac5469c37c29e427902b24a333a5f9fcb2f0b3ac41.css" />
<link rel="stylesheet" type="text/css" href="../_static/mystnb.4510f1fc1dee50b3e5859aac5469c37c29e427902b24a333a5f9fcb2f0b3ac41.css?v=be8a1c11" />
<link rel="stylesheet" type="text/css" href="../_static/graphviz.css?v=fd3f3429" />


Expand Down
60 changes: 39 additions & 21 deletions docs/_modules/zarrdataset/_samplers.html

Large diffs are not rendered by default.

19 changes: 11 additions & 8 deletions docs/_sources/autoapi/zarrdataset/_augs/index.rst.txt
Original file line number Diff line number Diff line change
@@ -1,32 +1,34 @@
:py:mod:`zarrdataset._augs`
===========================
zarrdataset._augs
=================

.. py:module:: zarrdataset._augs
Module Contents
---------------

Classes
~~~~~~~
-------

.. autoapisummary::

zarrdataset._augs.ToDtype



Module Contents
---------------

.. py:class:: ToDtype(dtype: numpy.dtype)
Bases: :py:obj:`object`


Converted a numpy NDArray to the specified data type.

:param dtype: The data type to cast the input array.
:type dtype: numpy.dtype


.. py:attribute:: _dtype
.. py:method:: __call__(image: numpy.ndarray) -> numpy.ndarray
Casts the type of `image` to the data type specified with `dtype`.
Expand All @@ -38,6 +40,7 @@ Classes
:rtype: numpy.ndarray



.. py:method:: __repr__() -> str
Return repr(self).
Expand Down
142 changes: 94 additions & 48 deletions docs/_sources/autoapi/zarrdataset/_imageloaders/index.rst.txt
Original file line number Diff line number Diff line change
@@ -1,14 +1,19 @@
:py:mod:`zarrdataset._imageloaders`
===================================
zarrdataset._imageloaders
=========================

.. py:module:: zarrdataset._imageloaders
Module Contents
---------------
Attributes
----------

.. autoapisummary::

zarrdataset._imageloaders.TIFFFILE_SUPPORT


Classes
~~~~~~~
-------

.. autoapisummary::

Expand All @@ -17,28 +22,20 @@ Classes
zarrdataset._imageloaders.ImageCollection



Functions
~~~~~~~~~
---------

.. autoapisummary::

zarrdataset._imageloaders.image2array



Attributes
~~~~~~~~~~

.. autoapisummary::

zarrdataset._imageloaders.TIFFFILE_SUPPORT

Module Contents
---------------

.. py:data:: TIFFFILE_SUPPORT
:value: True



.. py:function:: image2array(arr_src: Union[str, zarr.Group, zarr.Array, numpy.ndarray], data_group: Union[str, int, None] = None, zarr_store: Union[zarr.storage.Store, None] = None)
Expand All @@ -62,88 +59,91 @@ Attributes

.. py:class:: ImageBase(shape: Iterable[int], chunk_size: Union[Iterable[int], None] = None, source_axes: str = '', mode: str = '')
Bases: :py:obj:`object`

.. py:property:: shape
:type: Iterable[int]


.. py:property:: chunk_size
:type: Iterable[int]


.. py:property:: scale
:type: dict


.. py:attribute:: arr
:value: None



.. py:attribute:: spatial_axes
:value: 'ZYX'



.. py:attribute:: source_axes
:value: None



.. py:attribute:: axes
:value: None



.. py:attribute:: mode
:value: ''



.. py:attribute:: permute_order
:value: None



.. py:attribute:: _store
:value: None



.. py:attribute:: _new_axes
:value: ''



.. py:attribute:: _drop_axes
:value: ''



.. py:attribute:: _scale
:value: None



.. py:attribute:: _shape
:value: None



.. py:attribute:: _spatial_reference_shape
:value: None



.. py:attribute:: _spatial_reference_axes
:value: None



.. py:attribute:: _chunk_size
:value: None



.. py:attribute:: _cached_coords
:value: None



.. py:attribute:: _image_func
:value: None



.. py:attribute:: roi
.. py:method:: _iscached(coords)
Expand All @@ -169,11 +169,26 @@ Attributes



.. py:class:: ImageLoader(filename: str, source_axes: str, data_group: Union[str, None] = None, axes: Union[str, None] = None, roi: Union[str, slice, Iterable[slice], None] = None, image_func: Union[Callable, None] = None, zarr_store: Union[zarr.storage.Store, None] = None, spatial_axes: str = 'ZYX', mode: str = '')
.. py:property:: shape
:type: Iterable[int]



.. py:property:: chunk_size
:type: Iterable[int]



.. py:property:: scale
:type: dict



.. py:class:: ImageLoader(filename: str, source_axes: str, data_group: Union[str, None] = None, axes: Union[str, None] = None, roi: Union[str, slice, Iterable[slice], None] = None, image_func: Union[Callable, None] = None, zarr_store: Union[zarr.storage.Store, None] = None, spatial_axes: str = 'ZYX', mode: str = '')
Bases: :py:obj:`ImageBase`


Image lazy loader class.

Opens the zarr file, or any image that can be open by TiffFile or PIL, as a
Expand All @@ -198,15 +213,36 @@ Attributes
:param mode:
:type mode: str

.. py:method:: __del__()

.. py:attribute:: mode
.. py:class:: ImageCollection(collection_args: dict, spatial_axes: str = 'ZYX')
.. py:attribute:: spatial_axes
.. py:attribute:: roi_slices
.. py:attribute:: roi
.. py:attribute:: source_axes
.. py:attribute:: axes
.. py:attribute:: _image_func
.. py:method:: __del__()
.. py:class:: ImageCollection(collection_args: dict, spatial_axes: str = 'ZYX')
Bases: :py:obj:`object`


A class to contain a collection of inputs from different modalities.

This is used to match images with their respective labels and masks.
Expand All @@ -218,6 +254,16 @@ Attributes
modalities using as reference these axes from the `images` collection.
:type spatial_axes: str


.. py:attribute:: reference_mode
.. py:attribute:: spatial_axes
.. py:attribute:: collection
.. py:method:: _generate_mask()
Expand All @@ -227,7 +273,7 @@ Attributes
collection shape on the `spatial_axes` only.


.. py:method:: __getitem__(index)

.. py:method:: __getitem__(index)
Loading

0 comments on commit fe19cf4

Please sign in to comment.