Skip to content

Commit 8c1ae43

Browse files
authored
Merge pull request #16 from bioio-devs/feature/upgrade-docs
Upgrade docs
2 parents 0bb4107 + ad6ae37 commit 8c1ae43

15 files changed

+1138
-45
lines changed

.gitchangelog.rc

+293
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,293 @@
1+
# -*- coding: utf-8; mode: python -*-
2+
##
3+
## Format
4+
##
5+
## ACTION: COMMIT_MSG [!TAG ...]
6+
##
7+
## Description
8+
##
9+
## ACTION is one of 'feature', 'bugfix', 'other'
10+
##
11+
## COMMIT_MSG is ... well ... the commit message itself.
12+
##
13+
## TAGs are additionnal adjective as 'refactor' 'minor' 'cosmetic'
14+
##
15+
## They are preceded with a '!' or a '@' (prefer the former, as the
16+
## latter is wrongly interpreted in github.) Commonly used tags are:
17+
##
18+
## 'refactor' is obviously for refactoring code only
19+
## 'minor' is for a very meaningless change (a typo, adding a comment)
20+
## 'cosmetic' is for cosmetic driven change (re-indentation, 80-col...)
21+
## 'wip' is for partial functionality but complete subfunctionality.
22+
##
23+
## Example:
24+
##
25+
## feature/use-dask
26+
##
27+
## Please note that multi-line commit message are supported, and only the
28+
## first line will be considered as the "summary" of the commit message. So
29+
## tags, and other rules only applies to the summary. The body of the commit
30+
## message will be displayed in the changelog without reformatting.
31+
32+
33+
##
34+
## ``ignore_regexps`` is a line of regexps
35+
##
36+
## Any commit having its full commit message matching any regexp listed here
37+
## will be ignored and won't be reported in the changelog.
38+
##
39+
ignore_regexps = [
40+
r'^(.{3,3}\s*:)?\s*[fF]irst commit.?\s*$',
41+
r'^[iI]ntial commit.?\s*$',
42+
r'^$', ## ignore commits with empty messages
43+
r'^Bump version: .*',
44+
]
45+
46+
47+
## ``section_regexps`` is a list of 2-tuples associating a string label and a
48+
## list of regexp
49+
##
50+
## Commit messages will be classified in sections thanks to this. Section
51+
## titles are the label, and a commit is classified under this section if any
52+
## of the regexps associated is matching.
53+
##
54+
## Please note that ``section_regexps`` will only classify commits and won't
55+
## make any changes to the contents. So you'll probably want to go check
56+
## ``subject_process`` (or ``body_process``) to do some changes to the subject,
57+
## whenever you are tweaking this variable.
58+
##
59+
section_regexps = [
60+
('New', [
61+
r'^[fF]eature.*$'
62+
]),
63+
('Fix', [
64+
r'^[bB]ugfix.*$',
65+
r'^[fF]ix.*$',
66+
r'^[hH]otfix.*$',
67+
]),
68+
('Other', None), ## Match all lines
69+
]
70+
71+
72+
## ``body_process`` is a callable
73+
##
74+
## This callable will be given the original body and result will
75+
## be used in the changelog.
76+
##
77+
## Available constructs are:
78+
##
79+
## - any python callable that take one txt argument and return txt argument.
80+
##
81+
## - ReSub(pattern, replacement): will apply regexp substitution.
82+
##
83+
## - Indent(chars=" "): will indent the text with the prefix
84+
## Please remember that template engines gets also to modify the text and
85+
## will usually indent themselves the text if needed.
86+
##
87+
## - Wrap(regexp=r"\n\n"): re-wrap text in separate paragraph to fill 80-Columns
88+
##
89+
## - noop: do nothing
90+
##
91+
## - ucfirst: ensure the first letter is uppercase.
92+
## (usually used in the ``subject_process`` pipeline)
93+
##
94+
## - final_dot: ensure text finishes with a dot
95+
## (usually used in the ``subject_process`` pipeline)
96+
##
97+
## - strip: remove any spaces before or after the content of the string
98+
##
99+
## - SetIfEmpty(msg="No commit message."): will set the text to
100+
## whatever given ``msg`` if the current text is empty.
101+
##
102+
## Additionally, you can `pipe` the provided filters, for instance:
103+
#body_process = Wrap(regexp=r'\n(?=\w+\s*:)') | Indent(chars=" ")
104+
#body_process = Wrap(regexp=r'\n(?=\w+\s*:)')
105+
#body_process = noop
106+
#body_process = ReSub(r'((^|\n)[A-Z]\w+(-\w+)*: .*(\n\s+.*)*)+$', r'') | strip
107+
body_process = ReSub(r'.*', '') | strip
108+
109+
110+
## ``subject_process`` is a callable
111+
##
112+
## This callable will be given the original subject and result will
113+
## be used in the changelog.
114+
##
115+
## Available constructs are those listed in ``body_process`` doc.
116+
#subject_process = (strip |
117+
# ReSub(r'^([cC]hg|[fF]ix|[nN]ew)\s*:\s*((dev|use?r|pkg|test|doc)\s*:\s*)?([^\n@]*)(@[a-z]+\s+)*$', r'\4') |
118+
# SetIfEmpty("No commit message.") | ucfirst | final_dot)
119+
subject_process = ReSub(
120+
r'^(.*)(\ ?\(\#([0-9]+)\))$',
121+
r'\1 (`#\3 <https://github.com/bioio-devs/bioio/pull/\3>`_)'
122+
)
123+
#subject_process = ReSub(r'.*', '')
124+
125+
126+
## ``tag_filter_regexp`` is a regexp
127+
##
128+
## Tags that will be used for the changelog must match this regexp.
129+
##
130+
tag_filter_regexp = r'^v[0-9]+\.[0-9]+(\.[0-9]+)?$'
131+
132+
133+
## ``unreleased_version_label`` is a string or a callable that outputs a string
134+
##
135+
## This label will be used as the changelog Title of the last set of changes
136+
## between last valid tag and HEAD if any.
137+
unreleased_version_label = "(unreleased)"
138+
139+
140+
## ``output_engine`` is a callable
141+
##
142+
## This will change the output format of the generated changelog file
143+
##
144+
## Available choices are:
145+
##
146+
## - rest_py
147+
##
148+
## Legacy pure python engine, outputs ReSTructured text.
149+
## This is the default.
150+
##
151+
## - mustache(<template_name>)
152+
##
153+
## Template name could be any of the available templates in
154+
## ``templates/mustache/*.tpl``.
155+
## Requires python package ``pystache``.
156+
## Examples:
157+
## - mustache("markdown")
158+
## - mustache("restructuredtext")
159+
##
160+
## - makotemplate(<template_name>)
161+
##
162+
## Template name could be any of the available templates in
163+
## ``templates/mako/*.tpl``.
164+
## Requires python package ``mako``.
165+
## Examples:
166+
## - makotemplate("restructuredtext")
167+
##
168+
output_engine = rest_py
169+
#output_engine = mustache("restructuredtext")
170+
#output_engine = mustache("markdown")
171+
#output_engine = makotemplate("restructuredtext")
172+
173+
174+
## ``include_merge`` is a boolean
175+
##
176+
## This option tells git-log whether to include merge commits in the log.
177+
## The default is to include them.
178+
include_merge = False
179+
180+
181+
## ``log_encoding`` is a string identifier
182+
##
183+
## This option tells gitchangelog what encoding is outputed by ``git log``.
184+
## The default is to be clever about it: it checks ``git config`` for
185+
## ``i18n.logOutputEncoding``, and if not found will default to git's own
186+
## default: ``utf-8``.
187+
#log_encoding = 'utf-8'
188+
189+
190+
## ``publish`` is a callable
191+
##
192+
## Sets what ``gitchangelog`` should do with the output generated by
193+
## the output engine. ``publish`` is a callable taking one argument
194+
## that is an interator on lines from the output engine.
195+
##
196+
## Some helper callable are provided:
197+
##
198+
## Available choices are:
199+
##
200+
## - stdout
201+
##
202+
## Outputs directly to standard output
203+
## (This is the default)
204+
##
205+
## - FileInsertAtFirstRegexMatch(file, pattern, idx=lamda m: m.start())
206+
##
207+
## Creates a callable that will parse given file for the given
208+
## regex pattern and will insert the output in the file.
209+
## ``idx`` is a callable that receive the matching object and
210+
## must return a integer index point where to insert the
211+
## the output in the file. Default is to return the position of
212+
## the start of the matched string.
213+
##
214+
## - FileRegexSubst(file, pattern, replace, flags)
215+
##
216+
## Apply a replace inplace in the given file. Your regex pattern must
217+
## take care of everything and might be more complex. Check the README
218+
## for a complete copy-pastable example.
219+
##
220+
#publish = stdout
221+
OUTPUT_FILE = "docs/CHANGELOG.rst"
222+
INSERT_POINT_REGEX = r'''(?isxu)
223+
^
224+
(
225+
\s*Changelog\s*(\n|\r\n|\r) ## ``Changelog`` line
226+
==+\s*(\n|\r\n|\r){2} ## ``=========`` rest underline
227+
)
228+
229+
( ## Match all between changelog and release rev
230+
(
231+
(?!
232+
(?<=(\n|\r)) ## look back for newline
233+
%(rev)s ## revision
234+
\s+
235+
\([0-9]+-[0-9]{2}-[0-9]{2}\)(\n|\r\n|\r) ## date
236+
--+(\n|\r\n|\r) ## ``---`` underline
237+
)
238+
.
239+
)*
240+
)
241+
242+
(?P<rev>%(rev)s)
243+
''' % {'rev': r"v[0-9]+\.[0-9]+(\.[0-9]+)?"}
244+
245+
revs = [
246+
Caret(FileFirstRegexMatch(OUTPUT_FILE, INSERT_POINT_REGEX)),
247+
"HEAD"
248+
]
249+
250+
publish = FileRegexSubst(OUTPUT_FILE, INSERT_POINT_REGEX, r"\1\o\g<rev>")
251+
252+
253+
## ``revs`` is a list of callable or a list of string
254+
##
255+
## callable will be called to resolve as strings and allow dynamical
256+
## computation of these. The result will be used as revisions for
257+
## gitchangelog (as if directly stated on the command line). This allows
258+
## to filter exaclty which commits will be read by gitchangelog.
259+
##
260+
## To get a full documentation on the format of these strings, please
261+
## refer to the ``git rev-list`` arguments. There are many examples.
262+
##
263+
## Using callables is especially useful, for instance, if you
264+
## are using gitchangelog to generate incrementally your changelog.
265+
##
266+
## Some helpers are provided, you can use them::
267+
##
268+
## - FileFirstRegexMatch(file, pattern): will return a callable that will
269+
## return the first string match for the given pattern in the given file.
270+
## If you use named sub-patterns in your regex pattern, it'll output only
271+
## the string matching the regex pattern named "rev".
272+
##
273+
## - Caret(rev): will return the rev prefixed by a "^", which is a
274+
## way to remove the given revision and all its ancestor.
275+
##
276+
## Please note that if you provide a rev-list on the command line, it'll
277+
## replace this value (which will then be ignored).
278+
##
279+
## If empty, then ``gitchangelog`` will act as it had to generate a full
280+
## changelog.
281+
##
282+
## The default is to use all commits to make the changelog.
283+
#revs = ["^1.0.3", ]
284+
285+
# revs = [
286+
# Caret(
287+
# FileFirstRegexMatch(
288+
# "docs/CHANGELOG.rst",
289+
# r"(?P<rev>v[0-9]+\.[0-9]+(\.[0-9]+)?)\s+\([0-9]+-[0-9]{2}-[0-9]{2}\)\n--+\n")),
290+
# "HEAD"
291+
# ]
292+
293+
revs = []

.github/workflows/docs.yml

+1
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ jobs:
2424
pip install .[docs]
2525
- name: Generate Docs
2626
run: |
27+
gitchangelog
2728
just generate-docs
2829
touch docs/_build/.nojekyll
2930
- name: Publish Docs

README.md

+38-19
Original file line numberDiff line numberDiff line change
@@ -1,33 +1,52 @@
1-
# bioio
1+
# BioIO
22

33
[![Build Status](https://github.com/bioio-devs/bioio/actions/workflows/ci.yml/badge.svg)](https://github.com/bioio-devs/bioio/actions)
44
[![Documentation](https://github.com/bioio-devs/bioio/actions/workflows/docs.yml/badge.svg)](https://bioio-devs.github.io/bioio)
55
[![PyPI version](https://badge.fury.io/py/bioio.svg)](https://badge.fury.io/py/bioio)
6+
[![License](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause)
7+
[![Python 3.9+](https://img.shields.io/badge/python-3.9,3.10,3.11-blue.svg)](https://www.python.org/downloads/release/python-390/)
68

7-
8-
Image reading, metadata management, and image writing for Microscopy images in Python
9+
Image Reading, Metadata Conversion, and Image Writing for Microscopy Images in Pure Python
910

1011
---
1112

12-
## Installation
13-
14-
**Stable Release:** `pip install bioio`<br>
15-
**Development Head:** `pip install git+https://github.com/bioio-devs/bioio.git`
16-
17-
## Quickstart
18-
19-
```python
20-
from bioio import example
13+
## Documentation
2114

22-
print(example.str_len("hello")) # prints 5
23-
```
15+
[See the full documentation on our GitHub pages site](https://bioio-devs.github.io/bioio/OVERVIEW.html)
2416

25-
## Documentation
17+
## Example Usage (see full documentation for more examples)
2618

27-
For full package documentation please visit [bioio-devs.github.io/bioio](https://bioio-devs.github.io/bioio).
19+
Install bioio alongside OME TIFF and OME ZARR plug-ins with pip (this example won't use the OME ZARR plug-in):
2820

29-
## Development
21+
`pip install bioio bioio-ome-tiff bioio-ome-zarr`
3022

31-
See [CONTRIBUTING.md](CONTRIBUTING.md) for information related to developing the code.
23+
```python
24+
from bioio import BioImage
25+
26+
# Get a BioImage object
27+
img = BioImage("my_file.tiff") # selects the first scene found
28+
img.data # returns 5D TCZYX numpy array
29+
img.xarray_data # returns 5D TCZYX xarray data array backed by numpy
30+
img.dims # returns a Dimensions object
31+
img.dims.order # returns string "TCZYX"
32+
img.dims.X # returns size of X dimension
33+
img.shape # returns tuple of dimension sizes in TCZYX order
34+
img.get_image_data("CZYX", T=0) # returns 4D CZYX numpy array
35+
36+
# Get the id of the current operating scene
37+
img.current_scene
38+
39+
# Get a list valid scene ids
40+
img.scenes
41+
42+
# Change scene using name
43+
img.set_scene("Image:1")
44+
# Or by scene index
45+
img.set_scene(1)
46+
47+
# Use the same operations on a different scene
48+
# ...
49+
```
3250

33-
**BSD License**
51+
## Issues
52+
[_Click here to view all open issues in bioio-devs organization at once_](https://github.com/search?q=user%3Abioio-devs+is%3Aissue+is%3Aopen&type=issues&ref=advsearch)

bioio/writers/timeseries_writer.py

+1-5
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,6 @@ class TimeseriesWriter(Writer):
1919
"""
2020
A writer for timeseries Greyscale, RGB, or RGBA image data.
2121
Primarily directed at formats: "gif", "mp4", "mkv", etc.
22-
23-
Notes
24-
-----
25-
To use this writer, install with: `pip install aicsimageio[base-imageio]`.
2622
"""
2723

2824
_TIMEPOINT_DIMENSIONS = [
@@ -124,7 +120,7 @@ def save(
124120
a non-time dimension. For example, creating a timeseries image where each frame
125121
is a Z-plane from a source volumetric image as seen below.
126122
127-
>>> image = AICSImageIO("some_z_stack.ome.tiff")
123+
>>> image = BioImage("some_z_stack.ome.tiff")
128124
... TimeseriesWriter.save(
129125
... data=image.get_image_data("ZYX", T=0, C=0),
130126
... uri="some_z_stack.mp4",

0 commit comments

Comments
 (0)