Skip to content

Commit 2f944f3

Browse files
committed
add docs
1 parent a6222eb commit 2f944f3

24 files changed

+1620
-28
lines changed

.gitignore

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
# Prerequisites
2+
*.d
3+
4+
# Compiled Object files
5+
*.slo
6+
*.lo
7+
*.o
8+
*.obj
9+
10+
# Precompiled Headers
11+
*.gch
12+
*.pch
13+
14+
# Compiled Dynamic libraries
15+
*.so
16+
*.dylib
17+
*.dll
18+
19+
# Compiled Static libraries
20+
*.lai
21+
*.la
22+
*.a
23+
*.lib
24+
25+
# Executables
26+
*.exe
27+
*.out
28+
*.app
29+
30+
# Vim tmp files
31+
*.swp
32+
33+
# Build directory
34+
build/
35+
36+
# Test build artefacts
37+
test/test_xtensor
38+
test/CMakeCache.txt
39+
test/Makefile
40+
test/CMakeFiles/
41+
test/cmake_install.cmake
42+
43+
# Documentation build artefacts
44+
docs/CMakeCache.txt
45+
docs/xml/
46+
docs/build/
47+
48+
# Jupyter artefacts
49+
.ipynb_checkpoints/
50+
51+
# Generated header
52+
include/xtensor-io/xtensor_io_config.hpp

.readthedocs.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
conda:
2+
file: docs/environment.yml

CMakeLists.txt

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,19 @@ project(xtensor-io)
1111

1212
set(XTENSOR_IO_INCLUDE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/include)
1313

14+
# Configuration
15+
# =============
16+
17+
# TODO: use the library directory of the found LIBS implementation instead of CMAKE_INSTALL_PREFIX
18+
set(XTENSOR_IO_CLING_LIBRARY_DIR_64 "\"${CMAKE_INSTALL_PREFIX}/lib64\"")
19+
set(XTENSOR_IO_CLING_LIBRARY_DIR_32 "\"${CMAKE_INSTALL_PREFIX}/lib32\"")
20+
set(XTENSOR_IO_CLING_LIBRARY_DIR "\"${CMAKE_INSTALL_PREFIX}/lib\"")
21+
22+
configure_file (
23+
"${XTENSOR_IO_INCLUDE_DIR}/xtensor-io/xtensor_io_config.hpp.in"
24+
"${XTENSOR_IO_INCLUDE_DIR}/xtensor-io/xtensor_io_config.hpp"
25+
)
26+
1427
# Versionning
1528
# ===========
1629

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ auto arr_0 = npy_map["arr_0"].cast<double>();
2929
auto arr_1 = npy_map["arr_1"].cast<unsigned long>();
3030

3131
// open a wav file
32-
auto audio = xt::load_wav("files/xtensor.wav");
32+
auto audio = xt::load_audio("files/xtensor.wav");
3333
auto& arr = std::get<1>(audio); // audio contents (like scipy.io.wavfile results)
3434

3535
// save a sine wave sound
@@ -40,7 +40,7 @@ double duration = 1.0;
4040
auto t = xt::arange(0.0, duration, 1.0 / sampling_freq);
4141
auto y = xt::sin(2.0 * numeric_constants<double>::PI * freq * t);
4242

43-
xt::dump_wav("files/sine.wav", y, SF_FORMAT_WAV | SF_FORMAT_PCM_16, sampling_freq);
43+
xt::dump_audio("files/sine.wav", y, SF_FORMAT_WAV | SF_FORMAT_PCM_16, sampling_freq);
4444
```
4545
4646
### Installation

docs/Doxyfile

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
PROJECT_NAME = "xtensor-io"
2+
XML_OUTPUT = xml
3+
INPUT = ../include
4+
GENERATE_LATEX = NO
5+
GENERATE_MAN = NO
6+
GENERATE_RTF = NO
7+
CASE_SENSE_NAMES = NO
8+
GENERATE_HTML = NO
9+
GENERATE_XML = YES
10+
RECURSIVE = YES
11+
QUIET = YES
12+
JAVADOC_AUTOBRIEF = YES

docs/Makefile

Lines changed: 187 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,187 @@
1+
# You can set these variables from the command line.
2+
SPHINXOPTS =
3+
SPHINXBUILD = sphinx-build
4+
PAPER =
5+
BUILDDIR = build
6+
7+
# User-friendly check for sphinx-build
8+
ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1)
9+
$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/)
10+
endif
11+
12+
# Internal variables.
13+
PAPEROPT_a4 = -D latex_paper_size=a4
14+
PAPEROPT_letter = -D latex_paper_size=letter
15+
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source
16+
# the i18n builder cannot share the environment and doctrees with the others
17+
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) source
18+
19+
.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest coverage gettext api
20+
21+
default: html
22+
23+
help:
24+
@echo "Please use \`make <target>' where <target> is one of"
25+
@echo " html to make standalone HTML files"
26+
@echo " dirhtml to make HTML files named index.html in directories"
27+
@echo " singlehtml to make a single large HTML file"
28+
@echo " pickle to make pickle files"
29+
@echo " json to make JSON files"
30+
@echo " htmlhelp to make HTML files and a HTML help project"
31+
@echo " qthelp to make HTML files and a qthelp project"
32+
@echo " applehelp to make an Apple Help Book"
33+
@echo " devhelp to make HTML files and a Devhelp project"
34+
@echo " epub to make an epub"
35+
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
36+
@echo " latexpdf to make LaTeX files and run them through pdflatex"
37+
@echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx"
38+
@echo " text to make text files"
39+
@echo " man to make manual pages"
40+
@echo " texinfo to make Texinfo files"
41+
@echo " info to make Texinfo files and run them through makeinfo"
42+
@echo " gettext to make PO message catalogs"
43+
@echo " changes to make an overview of all changed/added/deprecated items"
44+
@echo " xml to make Docutils-native XML files"
45+
@echo " pseudoxml to make pseudoxml-XML files for display purposes"
46+
@echo " linkcheck to check all external links for integrity"
47+
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
48+
@echo " coverage to run coverage check of the documentation (if enabled)"
49+
50+
clean:
51+
rm -rf $(BUILDDIR)/*
52+
rm -rf xml
53+
54+
html:
55+
doxygen
56+
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
57+
@echo
58+
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
59+
60+
dirhtml:
61+
doxygen
62+
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
63+
@echo
64+
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
65+
66+
singlehtml:
67+
doxygen
68+
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
69+
@echo
70+
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
71+
72+
pickle:
73+
doxygen
74+
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
75+
@echo
76+
@echo "Build finished; now you can process the pickle files."
77+
78+
json:
79+
doxygen
80+
$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
81+
@echo
82+
@echo "Build finished; now you can process the JSON files."
83+
84+
htmlhelp:
85+
doxygen
86+
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
87+
@echo
88+
@echo "Build finished; now you can run HTML Help Workshop with the" \
89+
".hhp project file in $(BUILDDIR)/htmlhelp."
90+
91+
epub:
92+
doxygen
93+
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
94+
@echo
95+
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
96+
97+
latex:
98+
doxygen
99+
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
100+
@echo
101+
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
102+
@echo "Run \`make' in that directory to run these through (pdf)latex" \
103+
"(use \`make latexpdf' here to do that automatically)."
104+
105+
latexpdf:
106+
doxygen
107+
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
108+
@echo "Running LaTeX files through pdflatex..."
109+
$(MAKE) -C $(BUILDDIR)/latex all-pdf
110+
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
111+
112+
latexpdfja:
113+
doxygen
114+
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
115+
@echo "Running LaTeX files through platex and dvipdfmx..."
116+
$(MAKE) -C $(BUILDDIR)/latex all-pdf-ja
117+
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
118+
119+
text:
120+
doxygen
121+
$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
122+
@echo
123+
@echo "Build finished. The text files are in $(BUILDDIR)/text."
124+
125+
man:
126+
doxygen
127+
$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
128+
@echo
129+
@echo "Build finished. The manual pages are in $(BUILDDIR)/man."
130+
131+
texinfo:
132+
doxygen
133+
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
134+
@echo
135+
@echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
136+
@echo "Run \`make' in that directory to run these through makeinfo" \
137+
"(use \`make info' here to do that automatically)."
138+
139+
info:
140+
doxygen
141+
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
142+
@echo "Running Texinfo files through makeinfo..."
143+
make -C $(BUILDDIR)/texinfo info
144+
@echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
145+
146+
gettext:
147+
doxygen
148+
$(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
149+
@echo
150+
@echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
151+
152+
changes:
153+
doxygen
154+
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
155+
@echo
156+
@echo "The overview file is in $(BUILDDIR)/changes."
157+
158+
linkcheck:
159+
doxygen
160+
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
161+
@echo
162+
@echo "Link check complete; look for any errors in the above output " \
163+
"or in $(BUILDDIR)/linkcheck/output.txt."
164+
165+
doctest:
166+
doxygen
167+
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
168+
@echo "Testing of doctests in the sources finished, look at the " \
169+
"results in $(BUILDDIR)/doctest/output.txt."
170+
171+
coverage:
172+
doxygen
173+
$(SPHINXBUILD) -b coverage $(ALLSPHINXOPTS) $(BUILDDIR)/coverage
174+
@echo "Testing of coverage in the sources finished, look at the " \
175+
"results in $(BUILDDIR)/coverage/python.txt."
176+
177+
xml:
178+
doxygen
179+
$(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml
180+
@echo
181+
@echo "Build finished. The XML files are in $(BUILDDIR)/xml."
182+
183+
pseudoxml:
184+
doxygen
185+
$(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml
186+
@echo
187+
@echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml."

docs/environment.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
name: xtensor-io-docs
2+
3+
channels:
4+
- conda-forge
5+
6+
dependencies:
7+
- breathe

0 commit comments

Comments
 (0)