Skip to content

Commit ce33ebe

Browse files
committed
Added first basic documentation rst pages
1 parent 30a8f3d commit ce33ebe

File tree

10 files changed

+389
-0
lines changed

10 files changed

+389
-0
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
.spyderproject
22
qwt-6.1.2
33
qwt/tests/demo.png
4+
qwtdoc.chm
45

56
# Created by https://www.gitignore.io/api/python
67

build_chm.bat

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
sphinx-build -b htmlhelp doc doctmp
2+
"C:\Program Files\HTML Help Workshop\hhc.exe" doctmp\qwtdoc.hhp
3+
"C:\Program Files (x86)\HTML Help Workshop\hhc.exe" doctmp\qwtdoc.hhp
4+
copy doctmp\qwtdoc.chm .
5+
rmdir /S /Q doctmp
6+
pause

build_doc_zip.bat

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
sphinx-build -b html doc doctmp
2+
cd doctmp
3+
7z a -r ..\doc.zip *.*
4+
cd ..
5+
rmdir /S /Q doctmp

doc/conf.py

Lines changed: 201 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,201 @@
1+
# -*- coding: utf-8 -*-
2+
#
3+
# This file is execfile()d with the current directory set to its containing dir.
4+
#
5+
# Note that not all possible configuration values are present in this
6+
# autogenerated file.
7+
#
8+
# All configuration values have a default; values that are commented out
9+
# serve to show the default.
10+
11+
from __future__ import print_function, unicode_literals
12+
13+
import sys
14+
15+
# If extensions (or modules to document with autodoc) are in another directory,
16+
# add these directories to sys.path here. If the directory is relative to the
17+
# documentation root, use os.path.abspath to make it absolute, like shown here.
18+
#sys.path.append(os.path.abspath('.'))
19+
20+
# -- General configuration -----------------------------------------------------
21+
22+
# Add any Sphinx extension module names here, as strings. They can be extensions
23+
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
24+
extensions = ['sphinx.ext.autodoc']
25+
try:
26+
import sphinx.ext.viewcode
27+
extensions.append('sphinx.ext.viewcode')
28+
except ImportError:
29+
print("WARNING: the Sphinx viewcode extension was not found", file=sys.stderr)
30+
31+
# Add any paths that contain templates here, relative to this directory.
32+
templates_path = ['_templates']
33+
34+
# The suffix of source filenames.
35+
source_suffix = '.rst'
36+
37+
# The encoding of source files.
38+
#source_encoding = 'utf-8'
39+
40+
# The master toctree document.
41+
master_doc = 'index'
42+
43+
# General information about the project.
44+
project = 'python-qwt'
45+
import time
46+
this_year = time.strftime("%Y", time.localtime())
47+
copyright = "2002 Uwe Rathmann (for the original C++ code/doc), 2015 Pierre Raybaut (for the Python translation/optimization/doc adaptation)"
48+
49+
# The version info for the project you're documenting, acts as replacement for
50+
# |version| and |release|, also used in various other places throughout the
51+
# built documents.
52+
#
53+
# The short X.Y version.
54+
import qwt
55+
version = ".".join(qwt.__version__.split('.')[:2])
56+
# The full version, including alpha/beta/rc tags.
57+
release = qwt.__version__
58+
59+
# The language for content autogenerated by Sphinx. Refer to documentation
60+
# for a list of supported languages.
61+
#language = None
62+
63+
# There are two options for replacing |today|: either, you set today to some
64+
# non-false value, then it is used:
65+
#today = ''
66+
# Else, today_fmt is used as the format for a strftime call.
67+
#today_fmt = '%B %d, %Y'
68+
69+
# List of documents that shouldn't be included in the build.
70+
#unused_docs = []
71+
72+
# List of directories, relative to source directory, that shouldn't be searched
73+
# for source files.
74+
exclude_trees = []
75+
76+
# The reST default role (used for this markup: `text`) to use for all documents.
77+
#default_role = None
78+
79+
# If true, '()' will be appended to :func: etc. cross-reference text.
80+
#add_function_parentheses = True
81+
82+
# If true, the current module name will be prepended to all description
83+
# unit titles (such as .. function::).
84+
#add_module_names = True
85+
86+
# If true, sectionauthor and moduleauthor directives will be shown in the
87+
# output. They are ignored by default.
88+
#show_authors = False
89+
90+
# The name of the Pygments (syntax highlighting) style to use.
91+
pygments_style = 'sphinx'
92+
93+
# A list of ignored prefixes for module index sorting.
94+
modindex_common_prefix = ['qwt.']
95+
96+
97+
# -- Options for HTML output ---------------------------------------------------
98+
99+
# The theme to use for HTML and HTML Help pages. Major themes that come with
100+
# Sphinx are currently 'default' and 'sphinxdoc'.
101+
html_theme = 'sphinxdoc'
102+
103+
# Theme options are theme-specific and customize the look and feel of a theme
104+
# further. For a list of options available for each theme, see the
105+
# documentation.
106+
## html_theme_options = {'sidebarbgcolor': '#227A2B',
107+
## 'sidebarlinkcolor': '#98ff99'}
108+
109+
# Add any paths that contain custom themes here, relative to this directory.
110+
#html_theme_path = []
111+
112+
# The name for this set of Sphinx documents. If None, it defaults to
113+
# "<project> v<release> documentation".
114+
#html_title = None
115+
116+
# A shorter title for the navigation bar. Default is the same as html_title.
117+
#html_short_title = None
118+
119+
# The name of an image file (relative to this directory) to place at the top
120+
# of the sidebar.
121+
#html_logo = 'images/qwt.png'
122+
123+
# The name of an image file (within the static path) to use as favicon of the
124+
# docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32
125+
# pixels large.
126+
#html_favicon = 'favicon.ico'
127+
128+
# Add any paths that contain custom static files (such as style sheets) here,
129+
# relative to this directory. They are copied after the builtin static files,
130+
# so a file named "default.css" will overwrite the builtin "default.css".
131+
html_static_path = ['_static']
132+
133+
# If not '', a 'Last updated on:' timestamp is inserted at every page bottom,
134+
# using the given strftime format.
135+
#html_last_updated_fmt = '%b %d, %Y'
136+
137+
# If true, SmartyPants will be used to convert quotes and dashes to
138+
# typographically correct entities.
139+
#html_use_smartypants = True
140+
141+
# Custom sidebar templates, maps document names to template names.
142+
#html_sidebars = {}
143+
144+
# Additional templates that should be rendered to pages, maps page names to
145+
# template names.
146+
#html_additional_pages = {}
147+
148+
# If false, no module index is generated.
149+
html_use_modindex = True
150+
151+
# If false, no index is generated.
152+
#html_use_index = True
153+
154+
# If true, the index is split into individual pages for each letter.
155+
#html_split_index = False
156+
157+
# If true, links to the reST sources are added to the pages.
158+
#html_show_sourcelink = True
159+
160+
# If true, an OpenSearch description file will be output, and all pages will
161+
# contain a <link> tag referring to it. The value of this option must be the
162+
# base URL from which the finished HTML is served.
163+
#html_use_opensearch = ''
164+
165+
# If nonempty, this is the file name suffix for HTML files (e.g. ".xhtml").
166+
#html_file_suffix = ''
167+
168+
# Output file base name for HTML help builder.
169+
htmlhelp_basename = 'qwtdoc'
170+
171+
172+
# -- Options for LaTeX output --------------------------------------------------
173+
174+
# The paper size ('letter' or 'a4').
175+
#latex_paper_size = 'letter'
176+
177+
# The font size ('10pt', '11pt' or '12pt').
178+
#latex_font_size = '10pt'
179+
180+
# Grouping the document tree into LaTeX files. List of tuples
181+
# (source start file, target name, title, author, documentclass [howto/manual]).
182+
latex_documents = [
183+
('index', 'qwt.tex', 'python-qwt Documentation', 'Pierre Raybaut', 'manual'),
184+
]
185+
186+
# The name of an image file (relative to this directory) to place at the top of
187+
# the title page.
188+
#latex_logo = None
189+
190+
# For "manual" documents, if this is true, then toplevel headings are parts,
191+
# not chapters.
192+
#latex_use_parts = False
193+
194+
# Additional stuff for the LaTeX preamble.
195+
#latex_preamble = ''
196+
197+
# Documents to append as an appendix to all manuals.
198+
#latex_appendices = []
199+
200+
# If false, no module index is generated.
201+
#latex_use_modindex = True

doc/index.rst

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
.. automodule:: qwt
2+
3+
4+
Contents:
5+
6+
.. toctree::
7+
:maxdepth: 2
8+
9+
overview
10+
installation
11+
reference
12+
13+
14+
Indices and tables:
15+
16+
* :ref:`genindex`
17+
* :ref:`search`

doc/installation.rst

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
Installation
2+
============
3+
4+
Dependencies
5+
------------
6+
7+
Requirements:
8+
* Python 2.x (x>=6)
9+
* PyQt4 4.x (x>=4) or PyQt5 5.x (x>=5)
10+
* NumPy 1.x (x>=5)
11+
12+
Installation
13+
------------
14+
15+
From the source package:
16+
17+
`python setup.py install`
18+
19+
Help and support
20+
----------------
21+
22+
External resources:
23+
24+
* Bug reports and feature requests: `GitHub`_
25+
26+
.. _GitHub: https://github.com/PierreRaybaut/python-qwt

doc/overview.rst

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
Purpose and Motivation
2+
======================
3+
4+
The ``python-qwt`` project was initiated to solve -at least temporarily-
5+
the obsolescence issue of `PyQwt` (the Python-Qwt C++ bindings library)
6+
which is no longer maintained. The idea was to translate the original
7+
Qwt C++ code to Python and then to optimize some parts of the code by
8+
writing new modules based on NumPy and other libraries.
9+
10+
The ``python-qwt`` package consists of a single Python package named
11+
`qwt` and of a few other files (examples, doc, ...).
12+
13+
Overview
14+
========
15+
16+
The `qwt` package is a pure Python implementation of `Qwt` C++ library
17+
with the following limitations.
18+
19+
The following `Qwt` classes won't be reimplemented in `qwt` because more
20+
powerful features already exist in `guiqwt`: `QwtPlotZoomer`,
21+
`QwtCounter`, `QwtEventPattern`, `QwtPicker`, `QwtPlotPicker`.
22+
23+
Only the following plot items are currently implemented in `qwt` (the
24+
only plot items needed by `guiqwt`): `QwtPlotItem` (base class),
25+
`QwtPlotItem`, `QwtPlotMarker`, `QwtPlotSeriesItem`, `QwtPlotHistogram`,
26+
`QwtPlotCurve`.
27+
28+
The `QwtClipper` class is not implemented yet (and it will probably be
29+
very difficult or even impossible to implement it in pure Python without
30+
performance issues). As a consequence, when zooming in a plot curve, the
31+
entire curve is still painted (in other words, when working with large
32+
amount of data, there is no performance gain when zooming in).
33+
34+
Other API compatibility issues with `Qwt`:
35+
- `QwtPlot.MinimizeMemory` option was removed as this option has no sense
36+
in python-qwt (the polyline plotting is not taking more memory than the
37+
array data that is already there).

doc/reference.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
python-qwt reference
2+
====================
3+
4+
.. automodule:: qwt.color_map
5+
:members:
6+
:inherited-members:

qwt/clipper.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55
# Copyright (c) 2015 Pierre Raybaut, for the Python translation/optimization
66
# (see LICENSE file for more details)
77

8+
#XXX: Unfinished (and not imported elsewhere) translation of QwtClipper class
9+
810
from qwt.qt.QtGui import QPolygon, QPolygonF
911
from qwt.qt.QtCore import QRect, QRectF
1012

0 commit comments

Comments
 (0)