Skip to content

Commit 9c14f74

Browse files
authored
Merge branch 'splash-ngff_spec' into fix-version-parsing
2 parents 5ba1a7f + da4606b commit 9c14f74

9 files changed

Lines changed: 267 additions & 40 deletions

File tree

.gitignore

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,6 @@ var/
3838
*.egg-info/
3939
.installed.cfg
4040
*.egg
41-
*_version.py
4241

4342
# PyInstaller
4443
# Usually these files are written by a python script from a template
@@ -91,9 +90,6 @@ target/
9190
# OS
9291
.DS_Store
9392

94-
# written by setuptools_scm
95-
*/_version.py
96-
9793
# PyBuilder
9894
.idea
9995
venv/

ngff_spec/CITATION.cff

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
cff-version: 1.2.0
2+
message: Please cite the following works when using this project.
3+
abstract: >-
4+
A growing community is constructing a next-generation file format (NGFF) for
5+
bioimaging to overcome problems of scalability and heterogeneity. Organized by
6+
the Open Microscopy Environment (OME), individuals and institutes across
7+
diverse modalities facing these problems have designed a format specification
8+
process (OME-NGFF) to address these needs. Those community members have built
9+
the format itself – OME-Zarr – along with tools and data resources available
10+
today to increase FAIR access and remove barriers in the scientific process.
11+
The current momentum offers an opportunity to unify a key component of the
12+
bioimaging domain — the file format that underlies so many personal,
13+
institutional, and global data management and analysis tasks.
14+
title: Next-generation file format specification
15+
authors:
16+
- family-names: NGFF-community
17+
given-names: ''
18+
identifiers:
19+
- type: doi
20+
value: 10.1038/s41592-021-01326-w
21+
description: Original Nature Methods article (2021)
22+
- type: doi
23+
value: 10.1101/2023.02.17.528834v2
24+
description: OME-Zarr preprint (2023)
25+
keywords:
26+
- FAIR
27+
- community
28+
- bioimaging
29+
- data
30+
- cloud
31+
- format
32+
license: CC-BY-4.0
33+
url: https://ngff.openmicroscopy.org
34+
repository: https://github.com/ome/ngff-spec
35+
preferred-citation:
36+
type: article
37+
doi: 10.1038/s41592-021-01326-w
38+
journal: Nature Methods
39+
month: 11
40+
start: 1496
41+
end: 1498
42+
title: >-
43+
OME-NGFF: a next-generation file format for expanding bioimaging data-access
44+
strategies
45+
issue: 12
46+
volume: 18
47+
year: 2021
48+
authors:
49+
- given-names: Josh
50+
family-names: Moore
51+
orcid: https://orcid.org/0000-0003-4028-811X
52+
- given-names: Chris
53+
family-names: Allan
54+
- given-names: Sébastien
55+
family-names: Besson
56+
orcid: https://orcid.org/0000-0001-8783-1429
57+
- given-names: Jean-Marie
58+
family-names: Burel
59+
orcid: https://orcid.org/0000-0002-1789-1861
60+
- given-names: Erin
61+
family-names: Diel
62+
orcid: https://orcid.org/0000-0003-2526-3512
63+
- given-names: David
64+
family-names: Gault
65+
- given-names: Kevin
66+
family-names: Kozlowski
67+
- given-names: Dominik
68+
family-names: Lindner
69+
orcid: https://orcid.org/0000-0001-8038-1250
70+
- given-names: Melissa
71+
family-names: Linkert
72+
- given-names: Trevor
73+
family-names: Manz
74+
orcid: https://orcid.org/0000-0001-7694-5164
75+
- given-names: Will
76+
family-names: Moore
77+
orcid: https://orcid.org/0000-0002-7264-8338
78+
- given-names: Constantin
79+
family-names: Pape
80+
orcid: https://orcid.org/0000-0001-6562-7187
81+
- given-names: Christian
82+
family-names: Tischer
83+
orcid: https://orcid.org/0000-0003-4105-1990
84+
- given-names: Jason R.
85+
family-names: Swedlow
86+
orcid: https://orcid.org/0000-0002-2198-1958
87+
type: software
88+
repository-code: https://github.com/ome/ngff

ngff_spec/_version.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
__version__ = '0.6.dev1'

ngff_spec/citing.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
Citing
2-
======
1+
---
2+
title: Citing
3+
author: ""
4+
---
35
(citing)=
46

57
[Next-generation file format (NGFF) specifications for storing bioimaging data in the cloud.](https://ngff.openmicroscopy.org/0.4)

ngff_spec/contribute.md

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
---
2+
author: ""
3+
---
14
# Contribution guide
25

36
Contributions to the spec text, examples and schemas are highly welcome
@@ -28,6 +31,39 @@ jupyter book build ngff_spec
2831

2932
You'll find the built webpages under `_build/html`.
3033

34+
## First contribution
35+
36+
If you haven't contributed to the spec before,
37+
please add yourself as an author in the `ngff_spec/myst.yml` metadata file.
38+
This should look like this, for example:
39+
40+
```yaml
41+
- name: John A. Doe
42+
id: jdoe
43+
orcid: xxxx-xxxx-xxxx-xxxx
44+
github: jdoe
45+
affiliations:
46+
- id: key
47+
institution: ICSLDJ University
48+
city: Doeburg
49+
ror: https://ror.org/....
50+
- name: Jane Doe
51+
affiliations: key
52+
```
53+
54+
For more information see [myst documentation on author formatting](https://mystmd.org/guide/frontmatter#frontmatter-authors).
55+
56+
When you submit your first PR,
57+
make sure to rebuild the `CITATION.cff` file in the root of this repository.
58+
To do so, run the following command:
59+
60+
```bash
61+
cd ngff_spec/ && jupyter book build --cff
62+
```
63+
64+
Copy the generated `CITATION.cff` file from `ngff_spec/CITATION.cff` to the root of this repository
65+
and submit it along with your PR.
66+
3167
### Text format
3268

3369
Contributions should conform to [Semantic Line Breaks (SemBr)](https://sembr.org/),

ngff_spec/myst.yml

Lines changed: 86 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,96 @@ project:
1010
- format: pdf
1111
template: plain_latex_book
1212
output: exports/book.pdf
13+
- format: cff
14+
type: software
15+
identifiers:
16+
- type: doi
17+
value: 10.1038/s41592-021-01326-w
18+
description: Original Nature Methods article (2021)
19+
- type: doi
20+
value: 10.1101/2023.02.17.528834v2
21+
description: OME-Zarr preprint (2023)
22+
repository-code: 'https://github.com/ome/ngff'
23+
url: 'https://ngff.openmicroscopy.org'
24+
abstract: >-
25+
A growing community is constructing a next-generation file
26+
format (NGFF) for bioimaging to overcome problems of
27+
scalability and heterogeneity. Organized by the Open
28+
Microscopy Environment (OME), individuals and institutes
29+
across diverse modalities facing these problems have
30+
designed a format specification process (OME-NGFF) to
31+
address these needs. Those community members have built
32+
the format itself – OME-Zarr – along with tools and data
33+
resources available today to increase FAIR access and
34+
remove barriers in the scientific process. The current
35+
momentum offers an opportunity to unify a key component of
36+
the bioimaging domain — the file format that underlies so
37+
many personal, institutional, and global data management
38+
and analysis tasks.
39+
keywords:
40+
- FAIR
41+
- community
42+
- bioimaging
43+
- data
44+
- cloud
45+
- format
46+
license: CC-BY-4.0
47+
preferred-citation:
48+
type: article
49+
doi: "10.1038/s41592-021-01326-w"
50+
journal: "Nature Methods"
51+
month: 11
52+
start: 1496
53+
end: 1498
54+
title: "OME-NGFF: a next-generation file format for expanding bioimaging data-access strategies"
55+
issue: 12
56+
volume: 18
57+
year: 2021
58+
authors:
59+
- given-names: "Josh"
60+
family-names: "Moore"
61+
orcid: "https://orcid.org/0000-0003-4028-811X"
62+
- given-names: "Chris"
63+
family-names: "Allan"
64+
- given-names: "Sébastien"
65+
family-names: "Besson"
66+
orcid: "https://orcid.org/0000-0001-8783-1429"
67+
- given-names: "Jean-Marie"
68+
family-names: "Burel"
69+
orcid: "https://orcid.org/0000-0002-1789-1861"
70+
- given-names: "Erin"
71+
family-names: "Diel"
72+
orcid: "https://orcid.org/0000-0003-2526-3512"
73+
- given-names: "David"
74+
family-names: "Gault"
75+
- given-names: "Kevin"
76+
family-names: "Kozlowski"
77+
- given-names: "Dominik"
78+
family-names: "Lindner"
79+
orcid: "https://orcid.org/0000-0001-8038-1250"
80+
- given-names: "Melissa"
81+
family-names: "Linkert"
82+
- given-names: "Trevor"
83+
family-names: "Manz"
84+
orcid: "https://orcid.org/0000-0001-7694-5164"
85+
- given-names: "Will"
86+
family-names: "Moore"
87+
orcid: "https://orcid.org/0000-0002-7264-8338"
88+
- given-names: "Constantin"
89+
family-names: "Pape"
90+
orcid: "https://orcid.org/0000-0001-6562-7187"
91+
- given-names: "Christian"
92+
family-names: "Tischer"
93+
orcid: "https://orcid.org/0000-0003-4105-1990"
94+
- given-names: "Jason R."
95+
family-names: "Swedlow"
96+
orcid: "https://orcid.org/0000-0002-2198-1958"
1397
toc:
1498
- file: specification.md
15-
- file: examples.md
99+
- file: _generated/examples.md
16100
children:
17101
- pattern: _generated/examples/*
18-
- file: schemas.md
102+
- file: _generated/schemas.md
19103
children:
20104
- pattern: _generated/schemas/markdown/*
21105
- file: contribute.md

ngff_spec/pre_build.py

Lines changed: 30 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -23,19 +23,22 @@ def build_json_examples():
2323
index_md = """---
2424
title: NGFF metadata JSON Examples
2525
short_title: JSON Examples
26+
author: ""
2627
---
2728
2829
This section contains JSON examples for various metadata layouts.
2930
"""
3031

3132
for example in example_types:
3233
json_files = glob.glob(os.path.join(input_directory, example, '*.json'), recursive=True)
33-
markdown_file_name = os.path.join(output_directory, f'{example}.md')
3434

3535
index_md += f"\n## {example}\n"
3636

3737
# add header
38-
markdown_content = f"""# {example}\n\n
38+
markdown_content = f"""---
39+
title: {example} Examples
40+
author: ""
41+
---
3942
4043
This document contains JSON examples for {example} metadata layouts.
4144
@@ -62,10 +65,10 @@ def build_json_examples():
6265
```
6366
"""
6467
# create
65-
with open(markdown_file_name, 'w') as md_file:
68+
with open(os.path.join(output_directory, f'{example}.md'), 'w') as md_file:
6669
md_file.write(markdown_content)
6770

68-
with open(os.path.join("examples.md"), 'w') as index_file:
71+
with open(os.path.join("_generated/examples.md"), 'w') as index_file:
6972
index_file.write(index_md)
7073

7174
def build_json_schemas():
@@ -78,15 +81,12 @@ def build_json_schemas():
7881
os.makedirs(output_directory, exist_ok=True)
7982
schema_files = glob.glob(os.path.join(schema_source_dir, '*.schema'), recursive=True)
8083

81-
# Create a resolver mapping for local schemas
82-
schema_mapping = {}
83-
for schema_file in schema_files:
84-
with open(schema_file, 'r') as f:
85-
schema_content = json.load(f)
86-
if '$id' in schema_content:
87-
schema_mapping[schema_content['$id']] = os.path.abspath(schema_file)
8884

89-
index_markdown = """# JSON Schemas
85+
index_markdown = """---
86+
title: NGFF metadata JSON Schemas
87+
short_title: JSON Schemas
88+
author: ""
89+
---
9090
9191
This section contains JSON schemas for various metadata layouts.
9292
Find below links to auto-generated markdown pages or interactive HTML pages for each schema.
@@ -110,34 +110,39 @@ def build_json_schemas():
110110
config_md = GenerationConfiguration(
111111
template_name='md',
112112
with_footer=True,
113-
show_toc=False,
114-
link_to_reused_ref=False,
115-
custom_template_global_vars={'schema_mapping': schema_mapping})
113+
show_toc=True,
114+
link_to_reused_ref=True,
115+
)
116116
generate_from_filename(
117117
os.path.abspath(schema_file),
118118
result_file_name=os.path.abspath(output_path_md),
119119
config=config_md
120120
)
121121

122122
# insert mySt cross-reference at top of markdown files
123-
with open(output_path_md, 'r') as md_file:
123+
with open(output_path_md, 'r', encoding='utf-8') as md_file:
124124
md_content = md_file.read()
125125
crossref = f"schemas:{Path(schema_file).stem}"
126-
md_content = f"({crossref})=\n\n{md_content}"
127-
with open(output_path_md, 'w') as md_file:
126+
md_content = f"""---
127+
author: ""
128+
---
129+
({crossref})=\n\n{md_content}
130+
"""
131+
with open(output_path_md, 'w', encoding='utf-8') as md_file:
128132
md_file.write(md_content)
129133

130134
link_markdown = f"[{Path(schema_file).stem}](#{crossref})"
131-
except Exception:
135+
except Exception as e:
136+
print(f"Error generating markdown for {schema_file}: {e}")
132137
link_markdown = ""
133138

134139
try:
135140
config_html = GenerationConfiguration(
136141
template_name='js',
137142
with_footer=True,
138143
show_toc=False,
139-
link_to_reused_ref=False,
140-
custom_template_global_vars={'schema_mapping': schema_mapping})
144+
link_to_reused_ref=True,
145+
)
141146

142147
generate_from_filename(
143148
os.path.abspath(schema_file),
@@ -146,12 +151,13 @@ def build_json_schemas():
146151
)
147152
link_html = f"[{Path(schema_file).stem}]({output_path_html})"
148153

149-
except Exception:
154+
except Exception as e:
155+
print(f"Error generating HTML for {schema_file}: {e}")
150156
link_html = ""
151157

152158
index_markdown += f"| {Path(schema_file).stem} | {link_markdown} | {link_html} |\n"
153159

154-
with open(os.path.join("schemas.md"), 'w') as index_file:
160+
with open(os.path.join("_generated/schemas.md"), 'w') as index_file:
155161
index_file.write(index_markdown)
156162

157163
def build_footer():
@@ -161,8 +167,7 @@ def build_footer():
161167
footer_content = f"""
162168
<div>
163169
Copyright © 2020-{year}
164-
<a href="https://www.openmicroscopy.org/"><abbr title="Open Microscopy Environment">OME</abbr></a><sup>®</sup>
165-
(<a href="https://dundee.ac.uk/"><abbr title="University of Dundee">U. Dundee</abbr></a>).
170+
<a href="https://www.openmicroscopy.org/"><abbr title="Open Microscopy Environment">OME</abbr></a><sup>®</sup>.
166171
OME trademark rules apply.
167172
</div>
168173
"""

0 commit comments

Comments
 (0)