Skip to content

Commit a61222a

Browse files
authored
Merge pull request #7 from hpc4cmb/doc_fixes
Documentation Fixes
2 parents 85d8c67 + c0d0c70 commit a61222a

File tree

4 files changed

+114
-97
lines changed

4 files changed

+114
-97
lines changed

.github/workflows/docs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ jobs:
6969
mkdocs-material-extensions \
7070
mkdocs-jupyter \
7171
"mistune<3.1" \
72+
&& pip install mkdocs-print-site-plugin \
7273
&& git config user.name 'github-actions[bot]' \
7374
&& git config user.email 'github-actions[bot]@users.noreply.github.com'
7475

docs/docs/install.md

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ create an environment called "flacarray". First create the env with all
4141
dependencies and activate it (FIXME, add a requirements file for dev):
4242

4343
conda create -n flacarray \
44-
c_compiler numpy libflac cython meson-python
44+
c_compiler numpy libflac cython meson-python pkgconfig
4545

4646
conda activate flacarray
4747

@@ -51,6 +51,11 @@ Now you can go into your local git checkout of the flacarray source and do:
5151

5252
To build and install the package.
5353

54+
To also work on docs, install additional packages:
55+
56+
conda install mkdocs mkdocstrings mkdocs-jupyter
57+
pip install mkdocs-print-site-plugin
58+
5459
### Other Ways of Building
5560

5661
!!! note "To-Do"

docs/mkdocs.yml

Lines changed: 25 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,31 @@ theme:
77
- navigation.path
88

99
plugins:
10-
- search
11-
- mkdocstrings:
12-
handlers:
13-
python:
14-
options:
15-
docstring_style: google
16-
show_root_heading: true
17-
heading_level: 3
18-
parameter_headings: false
19-
show_object_full_path: false
20-
show_symbol_type_heading: true
21-
show_symbol_type_toc: true
22-
- mkdocs-jupyter:
23-
execute: false
10+
- search
11+
- mkdocstrings:
12+
handlers:
13+
python:
14+
options:
15+
docstring_style: google
16+
show_root_heading: true
17+
heading_level: 3
18+
parameter_headings: false
19+
show_object_full_path: false
20+
show_symbol_type_heading: true
21+
show_symbol_type_toc: true
22+
- mkdocs-jupyter:
23+
execute: false
24+
- print-site:
25+
add_to_navigation: true
26+
add_print_site_banner: false
27+
print_page_title: 'View as Single Page'
28+
add_full_urls: false
29+
add_table_of_contents: true
30+
toc_title: "Table of Contents"
31+
toc_depth: 2
32+
enumerate_headings: false
33+
enumerate_figures: true
34+
add_cover_page: false
2435

2536
nav:
2637
- Introduction: index.md

src/flacarray/tests/zarr.py

Lines changed: 82 additions & 82 deletions
Original file line numberDiff line numberDiff line change
@@ -224,85 +224,85 @@ def test_array_write_read(self):
224224
flcarr_f64 = FlacArray.from_array(inputf64, mpi_comm=self.comm, use_threads=True)
225225
check_f64 = None
226226

227-
# tmpdir = None
228-
# tmppath = None
229-
# if rank == 0:
230-
# tmpdir = tempfile.TemporaryDirectory()
231-
# tmppath = tmpdir.name
232-
# if self.comm is not None:
233-
# tmppath = self.comm.bcast(tmppath, root=0)
234-
235-
# i32_file = os.path.join(tmppath, "data_i32.zarr")
236-
# with ZarrGroup(i32_file, mode="w", comm=self.comm) as zf:
237-
# flcarr_i32.write_zarr(zf)
238-
# if self.comm is not None:
239-
# self.comm.barrier()
240-
# with ZarrGroup(i32_file, mode="r", comm=self.comm) as zf:
241-
# check_i32 = FlacArray.read_zarr(zf, mpi_comm=self.comm)
242-
243-
# i64_file = os.path.join(tmppath, "data_i64.zarr")
244-
# with ZarrGroup(i64_file, mode="w", comm=self.comm) as zf:
245-
# flcarr_i64.write_zarr(zf)
246-
# if self.comm is not None:
247-
# self.comm.barrier()
248-
# with ZarrGroup(i64_file, mode="r", comm=self.comm) as zf:
249-
# check_i64 = FlacArray.read_zarr(zf, mpi_comm=self.comm)
250-
251-
# f32_file = os.path.join(tmppath, "data_f32.zarr")
252-
# with ZarrGroup(f32_file, mode="w", comm=self.comm) as zf:
253-
# flcarr_f32.write_zarr(zf)
254-
# if self.comm is not None:
255-
# self.comm.barrier()
256-
# with ZarrGroup(f32_file, mode="r", comm=self.comm) as zf:
257-
# check_f32 = FlacArray.read_zarr(zf, mpi_comm=self.comm)
258-
259-
# f64_file = os.path.join(tmppath, "data_f64.zarr")
260-
# with ZarrGroup(f64_file, mode="w", comm=self.comm) as zf:
261-
# flcarr_f64.write_zarr(zf)
262-
# if self.comm is not None:
263-
# self.comm.barrier()
264-
# with ZarrGroup(f64_file, mode="r", comm=self.comm) as zf:
265-
# check_f64 = FlacArray.read_zarr(zf, mpi_comm=self.comm)
266-
267-
# if self.comm is not None:
268-
# self.comm.barrier()
269-
# del tmppath
270-
# del tmpdir
271-
272-
# if check_i32 != flcarr_i32:
273-
# print(f"check_i32 = {check_i32}", flush=True)
274-
# print(f"flcarr_i32 = {flcarr_i32}", flush=True)
275-
# print("FAIL on i32 roundtrip to zarr", flush=True)
276-
# self.assertTrue(False)
277-
# else:
278-
# output_i32 = check_i32.to_array()
279-
# if not np.array_equal(output_i32, input32):
280-
# print("FAIL on i32 zarr decompressed array check", flush=True)
281-
# self.assertTrue(False)
282-
283-
# if check_i64 != flcarr_i64:
284-
# print("FAIL on i64 roundtrip to zarr", flush=True)
285-
# self.assertTrue(False)
286-
# else:
287-
# output_i64 = check_i64.to_array()
288-
# if not np.array_equal(output_i64, input64):
289-
# print("FAIL on i64 zarr decompressed array check", flush=True)
290-
# self.assertTrue(False)
291-
292-
# if check_f32 != flcarr_f32:
293-
# print("FAIL on f32 roundtrip to zarr", flush=True)
294-
# self.assertTrue(False)
295-
# else:
296-
# output_f32 = check_f32.to_array()
297-
# if not np.allclose(output_f32, inputf32, rtol=1.0e-5, atol=1.0e-5):
298-
# print("FAIL on f32 zarr decompressed array check", flush=True)
299-
# self.assertTrue(False)
300-
301-
# if check_f64 != flcarr_f64:
302-
# print("FAIL on f64 roundtrip to zarr", flush=True)
303-
# self.assertTrue(False)
304-
# else:
305-
# output_f64 = check_f64.to_array()
306-
# if not np.allclose(output_f64, inputf64, rtol=1.0e-5, atol=1.0e-5):
307-
# print("FAIL on f64 zarr decompressed array check", flush=True)
308-
# self.assertTrue(False)
227+
tmpdir = None
228+
tmppath = None
229+
if rank == 0:
230+
tmpdir = tempfile.TemporaryDirectory()
231+
tmppath = tmpdir.name
232+
if self.comm is not None:
233+
tmppath = self.comm.bcast(tmppath, root=0)
234+
235+
i32_file = os.path.join(tmppath, "data_i32.zarr")
236+
with ZarrGroup(i32_file, mode="w", comm=self.comm) as zf:
237+
flcarr_i32.write_zarr(zf)
238+
if self.comm is not None:
239+
self.comm.barrier()
240+
with ZarrGroup(i32_file, mode="r", comm=self.comm) as zf:
241+
check_i32 = FlacArray.read_zarr(zf, mpi_comm=self.comm)
242+
243+
i64_file = os.path.join(tmppath, "data_i64.zarr")
244+
with ZarrGroup(i64_file, mode="w", comm=self.comm) as zf:
245+
flcarr_i64.write_zarr(zf)
246+
if self.comm is not None:
247+
self.comm.barrier()
248+
with ZarrGroup(i64_file, mode="r", comm=self.comm) as zf:
249+
check_i64 = FlacArray.read_zarr(zf, mpi_comm=self.comm)
250+
251+
f32_file = os.path.join(tmppath, "data_f32.zarr")
252+
with ZarrGroup(f32_file, mode="w", comm=self.comm) as zf:
253+
flcarr_f32.write_zarr(zf)
254+
if self.comm is not None:
255+
self.comm.barrier()
256+
with ZarrGroup(f32_file, mode="r", comm=self.comm) as zf:
257+
check_f32 = FlacArray.read_zarr(zf, mpi_comm=self.comm)
258+
259+
f64_file = os.path.join(tmppath, "data_f64.zarr")
260+
with ZarrGroup(f64_file, mode="w", comm=self.comm) as zf:
261+
flcarr_f64.write_zarr(zf)
262+
if self.comm is not None:
263+
self.comm.barrier()
264+
with ZarrGroup(f64_file, mode="r", comm=self.comm) as zf:
265+
check_f64 = FlacArray.read_zarr(zf, mpi_comm=self.comm)
266+
267+
if self.comm is not None:
268+
self.comm.barrier()
269+
del tmppath
270+
del tmpdir
271+
272+
if check_i32 != flcarr_i32:
273+
print(f"check_i32 = {check_i32}", flush=True)
274+
print(f"flcarr_i32 = {flcarr_i32}", flush=True)
275+
print("FAIL on i32 roundtrip to zarr", flush=True)
276+
self.assertTrue(False)
277+
else:
278+
output_i32 = check_i32.to_array()
279+
if not np.array_equal(output_i32, input32):
280+
print("FAIL on i32 zarr decompressed array check", flush=True)
281+
self.assertTrue(False)
282+
283+
if check_i64 != flcarr_i64:
284+
print("FAIL on i64 roundtrip to zarr", flush=True)
285+
self.assertTrue(False)
286+
else:
287+
output_i64 = check_i64.to_array()
288+
if not np.array_equal(output_i64, input64):
289+
print("FAIL on i64 zarr decompressed array check", flush=True)
290+
self.assertTrue(False)
291+
292+
if check_f32 != flcarr_f32:
293+
print("FAIL on f32 roundtrip to zarr", flush=True)
294+
self.assertTrue(False)
295+
else:
296+
output_f32 = check_f32.to_array()
297+
if not np.allclose(output_f32, inputf32, rtol=1.0e-5, atol=1.0e-5):
298+
print("FAIL on f32 zarr decompressed array check", flush=True)
299+
self.assertTrue(False)
300+
301+
if check_f64 != flcarr_f64:
302+
print("FAIL on f64 roundtrip to zarr", flush=True)
303+
self.assertTrue(False)
304+
else:
305+
output_f64 = check_f64.to_array()
306+
if not np.allclose(output_f64, inputf64, rtol=1.0e-5, atol=1.0e-5):
307+
print("FAIL on f64 zarr decompressed array check", flush=True)
308+
self.assertTrue(False)

0 commit comments

Comments
 (0)