Commit 14db94d8 authored by Jan Kotanski's avatar Jan Kotanski
Browse files

New upstream version 1.2.3

parent 5c9cfc88
recursive-include src *.hpp *.cpp
recursive-include pni/test *.hpp *.cpp
include doc/examples/*.py
include doc/sphinx/*
include build_tools/*.py
include pkgconfig.py
exclude .gitignore
exclude .settings/.gitignore
exclude doc/.gitignore
exclude doc/examples/.gitignore
exclude doc/sphinx/.gitignore
exclude doc/ug/.gitignore
exclude pninexus.egg-info/.gitignore
exclude src/.gitignore
exclude src/pninexus/.gitignore
exclude src/pninexus.egg-info/.gitignore
exclude test/.gitignore
graft build/sphinx/html
recursive-include doc/c++api/c++api *
Metadata-Version: 1.1
Name: pninexus
Version: 1.2.3
Summary: Python wrapper for the PNI libraries
Home-page: https://github.com/pninexus-libraries/python-pninexus
Author: Eugen Wintersberger
Author-email: eugen.wintersberger@desy.de
License: GPLv2
Description: This package provides wrappers for the PNI C++ libraries libpnicore and libpniio.
Platform: UNKNOWN
Requires: numpy
Install libpninx python bindings
================================
The installation uses the common distutils procedure. For a successful build the
following additional libraries are required
.) hdf5
.) libpniutils
.) libpninx
.) boost-python
If everything is installed in default locations a simple
$>python setup.py install
will install the python package. If your packages are not in default locations a
couple of commandline options is defined letting you specify the directories
where to find headers and libraries
--h5incdir .......... path to HDF5 header files
--h5libdir .......... path where HDF5 library binaries are installed
--utincdir .......... installation path of libpniutils header files
--utlibdir .......... installation path of libpniutils library files
--nxlibdir .......... installation path of libpninx library files
--nxincdir .......... installation path of libpninx header files
--numpyincdir ....... installation path of numpy header files
So if you have installed HDF5 under /opt/hdf5 the above command changes to
$>python setup.py --h5incdir=/opt/hdf5/include --h5libdir=/opt/hdf5/lib install
Be aware that the options defined above options must appear between setup.py and
install. Everything else runs according to the distutils standard. So for more
information on the installation procedure see the distutils documentation.
from __future__ import print_function
import re
class ConanBuildInfo(object):
"""Reader for the conan build
"""
section_re = re.compile(r"^\[(?P<NAME>[A-Za-z_0-9]+)\]$")
def __init__(self,filename):
with open(filename,"r") as f:
current_key = None
for line in f:
line = line.strip()
match = self.section_re.match(line)
if match:
current_key = match.group("NAME")
self.__dict__[current_key] = []
else:
if current_key and line and line!='hello':
self.__dict__[current_key].append(line)
from .build_configuration import BuildConfiguration
from .build_configuration_builder import ConanBuildInfoBuilder
from .cpp_extension_factory import CppExtensionFactory
\ No newline at end of file
def extend_or_append(input_list,value):
if isinstance(value,(list,tuple,)):
input_list.extend(value)
else:
input_list.append(value)
return input_list
class BuildConfiguration(object):
"""Data class storing build configuration
This class stores some basic build configuration for C or C++ extensions,
including
* paths to header files
* paths to the librarys
* libraries to link to an extension
* additional arguments to the linker
* additional arguments to the compiler
"""
def __init__(self):
self._include_directories = []
self._library_directories = []
self._link_libraries = []
self._linker_arguments = []
self._compiler_arguments = []
#
# handling include directories
#
@property
def include_directories(self):
return self._include_directories
@include_directories.setter
def include_directories(self,directories):
self._include_directories = directories
def add_include_directories(self,directories):
self._include_directories.extend(directories)
def add_include_directory(self,directory):
self._include_directories.append(directory)
#
# setting library directories
#
@property
def library_directories(self):
return self._library_directories
@library_directories.setter
def library_directories(self,directories):
self._library_directories = directories
def add_library_directories(self,directories):
self._library_directories.extend(directories)
def add_library_directory(self,directory):
self._library_directories.append(directory)
#
# handling link libraries
#
@property
def link_libraries(self):
return self._link_libraries
@link_libraries.setter
def link_libraries(self,value):
self._link_libraries = extend_or_append(self._link_libraries, value)
def add_link_library(self,library):
"""add a library to the existing ones
"""
self._link_libraries.append(library)
def add_link_libraries(self,libraries):
"""adding a list of libraries to the exsting ones
"""
self._link_libraries.extend(libraries)
#
# handling linker arguments
#
@property
def linker_arguments(self):
return self._linker_arguments
@linker_arguments.setter
def linker_arguments(self,arguments):
self._linker_arguments = arguments
def add_linker_argument(self,argument):
self._linker_arguments.append(argument)
def add_linker_arguments(self,arguments):
self._linker_arguments.extend(arguments)
#
# handling compiler arguments
#
@property
def compiler_arguments(self):
return self._compiler_arguments
@compiler_arguments.setter
def compiler_arguments(self,arguments):
self._compiler_arguments = arguments
def add_compiler_argument(self,argument):
self._compiler_arguments.append(argument)
def add_compiler_arguments(self,arguments):
self._compiler_arguments.extend(arguments)
from .build_configuration import BuildConfiguration
from .ConanConfig import ConanBuildInfo
class ConanBuildInfoBuilder(object):
"""Construct a BuildConfiguration instance from conan build information
"""
def create(self,filename):
conan_config = ConanBuildInfo(filename)
config = BuildConfiguration()
config.include_directories = conan_config.includedirs
config.library_directories = conan_config.libdirs
config.link_libraries = conan_config.libs
for libdir in conan_config.libdirs:
config.add_linker_argument('-Wl,-rpath,'+libdir)
return config
from .build_configuration import BuildConfiguration
from setuptools import Extension
class CppExtensionFactory(object):
"""
:param BuildConfiguration config: build configuration
"""
def __init__(self,config = None):
if not isinstance(config,BuildConfiguration):
raise TypeError("The config argument must be an instance of BuildConfiguration!")
self._config = config
def create(self,module_name,source_files):
return Extension(module_name,source_files,
include_dirs = self._config.include_directories,
library_dirs = self._config.library_directories,
libraries = self._config.link_libraries,
extra_link_args = self._config.linker_arguments,
language="c++",
extra_compile_args = self._config.compiler_arguments)
# Makefile for Sphinx documentation
#
# You can set these variables from the command line.
SPHINXOPTS =
SPHINXBUILD = sphinx-build
PAPER =
BUILDDIR = _build
# Internal variables.
PAPEROPT_a4 = -D latex_paper_size=a4
PAPEROPT_letter = -D latex_paper_size=letter
ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
# the i18n builder cannot share the environment and doctrees with the others
I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) .
.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext
help:
@echo "Please use \`make <target>' where <target> is one of"
@echo " html to make standalone HTML files"
@echo " dirhtml to make HTML files named index.html in directories"
@echo " singlehtml to make a single large HTML file"
@echo " pickle to make pickle files"
@echo " json to make JSON files"
@echo " htmlhelp to make HTML files and a HTML help project"
@echo " qthelp to make HTML files and a qthelp project"
@echo " devhelp to make HTML files and a Devhelp project"
@echo " epub to make an epub"
@echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter"
@echo " latexpdf to make LaTeX files and run them through pdflatex"
@echo " text to make text files"
@echo " man to make manual pages"
@echo " texinfo to make Texinfo files"
@echo " info to make Texinfo files and run them through makeinfo"
@echo " gettext to make PO message catalogs"
@echo " changes to make an overview of all changed/added/deprecated items"
@echo " linkcheck to check all external links for integrity"
@echo " doctest to run all doctests embedded in the documentation (if enabled)"
clean:
-rm -rf $(BUILDDIR)/*
html:
$(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/html."
dirhtml:
$(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml
@echo
@echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml."
singlehtml:
$(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml
@echo
@echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml."
pickle:
$(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle
@echo
@echo "Build finished; now you can process the pickle files."
json:
$(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json
@echo
@echo "Build finished; now you can process the JSON files."
htmlhelp:
$(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp
@echo
@echo "Build finished; now you can run HTML Help Workshop with the" \
".hhp project file in $(BUILDDIR)/htmlhelp."
qthelp:
$(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp
@echo
@echo "Build finished; now you can run "qcollectiongenerator" with the" \
".qhcp project file in $(BUILDDIR)/qthelp, like this:"
@echo "# qcollectiongenerator $(BUILDDIR)/qthelp/libpnicorePythonbindings.qhcp"
@echo "To view the help file:"
@echo "# assistant -collectionFile $(BUILDDIR)/qthelp/libpnicorePythonbindings.qhc"
devhelp:
$(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp
@echo
@echo "Build finished."
@echo "To view the help file:"
@echo "# mkdir -p $$HOME/.local/share/devhelp/libpnicorePythonbindings"
@echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/libpnicorePythonbindings"
@echo "# devhelp"
epub:
$(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub
@echo
@echo "Build finished. The epub file is in $(BUILDDIR)/epub."
latex:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo
@echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex."
@echo "Run \`make' in that directory to run these through (pdf)latex" \
"(use \`make latexpdf' here to do that automatically)."
latexpdf:
$(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex
@echo "Running LaTeX files through pdflatex..."
$(MAKE) -C $(BUILDDIR)/latex all-pdf
@echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex."
text:
$(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text
@echo
@echo "Build finished. The text files are in $(BUILDDIR)/text."
man:
$(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man
@echo
@echo "Build finished. The manual pages are in $(BUILDDIR)/man."
texinfo:
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
@echo
@echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo."
@echo "Run \`make' in that directory to run these through makeinfo" \
"(use \`make info' here to do that automatically)."
info:
$(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo
@echo "Running Texinfo files through makeinfo..."
make -C $(BUILDDIR)/texinfo info
@echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo."
gettext:
$(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale
@echo
@echo "Build finished. The message catalogs are in $(BUILDDIR)/locale."
changes:
$(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes
@echo
@echo "The overview file is in $(BUILDDIR)/changes."
linkcheck:
$(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck
@echo
@echo "Link check complete; look for any errors in the above output " \
"or in $(BUILDDIR)/linkcheck/output.txt."
doctest:
$(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest
@echo "Testing of doctests in the sources finished, look at the " \
"results in $(BUILDDIR)/doctest/output.txt."
=================
API documentation
=================
The package consists of two major subpackages
* the :py:mod:`pninexus.h5cpp` which is a thin wrapper around the *h5cpp* library
* and :py:mod:`pninexus.nexus` which wraps classes and functions from the
:cpp:any:`pni::io::nexus` namespace of *libpniio*.
The ``pninexus.h5cpp`` package
==============================
.. automodule:: pninexus.h5cpp
.. toctree::
:maxdepth: 1
h5cpp/h5cpp
h5cpp/attributes
h5cpp/dataspace
h5cpp/datatype
h5cpp/file
h5cpp/properties
h5cpp/node
The ``pninexus.nexus`` package
==============================
.. automodule:: pninexus.nexus
.. toctree::
:maxdepth: 1
nexus/files
nexus/factories
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!-- Created with Inkscape (http://www.inkscape.org/) -->
<svg
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:cc="http://creativecommons.org/ns#"
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:svg="http://www.w3.org/2000/svg"
xmlns="http://www.w3.org/2000/svg"
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
width="160.73039"
height="160.71835"
id="svg2"
version="1.1"
inkscape:version="0.48.3.1 r9886"
sodipodi:docname="array.svg"
inkscape:export-filename="/home/wintersb/Development/HDRI/pni-libraries/python-pni/doc/sphinx/array.png"
inkscape:export-xdpi="286.69125"
inkscape:export-ydpi="286.69125">
<defs
id="defs4">
<marker
inkscape:stockid="Arrow2Lend"
orient="auto"
refY="0"
refX="0"
id="Arrow2Lend"
style="overflow:visible">
<path
id="path3785"
style="font-size:12px;fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round"
d="M 8.7185878,4.0337352 -2.2072895,0.01601326 8.7185884,-4.0017078 c -1.7454984,2.3720609 -1.7354408,5.6174519 -6e-7,8.035443 z"
transform="matrix(-1.1,0,0,-1.1,-1.1,0)"
inkscape:connector-curvature="0" />
</marker>
<inkscape:path-effect
effect="construct_grid"
id="path-effect2989"
is_visible="true"
nr_x="10"
nr_y="10" />
<marker
inkscape:stockid="Arrow2Lend"
orient="auto"
refY="0"
refX="0"
id="Arrow2Lend-8"
style="overflow:visible">
<path
inkscape:connector-curvature="0"
id="path3785-4"
style="font-size:12px;fill-rule:evenodd;stroke-width:0.625;stroke-linejoin:round"
d="M 8.7185878,4.0337352 -2.2072895,0.01601326 8.7185884,-4.0017078 c -1.7454984,2.3720609 -1.7354408,5.6174519 -6e-7,8.035443 z"
transform="matrix(-1.1,0,0,-1.1,-1.1,0)" />
</marker>
</defs>
<sodipodi:namedview
id="base"
pagecolor="#ffffff"
bordercolor="#666666"
borderopacity="1.0"
inkscape:pageopacity="0.0"
inkscape:pageshadow="2"
inkscape:zoom="2.8"
inkscape:cx="96.768994"
inkscape:cy="69.468438"
inkscape:document-units="px"
inkscape:current-layer="layer1"
showgrid="true"
fit-margin-top="0"
fit-margin-left="0"
fit-margin-right="0"
fit-margin-bottom="0"
inkscape:window-width="1168"
inkscape:window-height="944"
inkscape:window-x="2020"
inkscape:window-y="110"
inkscape:window-maximized="0">
<inkscape:grid
type="xygrid"
id="grid2985"
units="mm"
empspacing="4"
visible="true"
enabled="true"
snapvisiblegridlinesonly="true" />
</sodipodi:namedview>
<metadata
id="metadata7">
<rdf:RDF>
<cc:Work
rdf:about="">
<dc:format>image/svg+xml</dc:format>
<dc:type
rdf:resource="http://purl.org/dc/dcmitype/StillImage" />
<dc:title></dc:title>
</cc:Work>
</rdf:RDF>
</metadata>
<g
inkscape:label="Layer 1"
inkscape:groupmode="layer"
id="layer1"
transform="translate(-9.8633575,-13.406643)">
<path
style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
d="m 28.346457,31.889742 0,141.732278 m 14.173228,-141.732278 0,141.732278 m 14.173228,-141.732278 0,141.732278 m 14.173228,-141.732278 0,141.732278 m 14.173228,-141.732278 0,141.732278 m 14.173228,-141.732278 0,141.732278 m 14.173223,-141.732278 0,141.732278 m 14.17323,-141.732278 0,141.732278 m 14.17323,-141.732278 0,141.732278 m 14.17323,-141.732278 0,141.732278 m 14.17323,-141.732278 0,141.732278 M 28.346457,31.889742 l 141.732283,0 M 28.346457,46.06297 l 141.732283,0 m -141.732283,14.173228 141.732283,0 m -141.732283,14.173228 141.732283,0 m -141.732283,14.173228 141.732283,0 m -141.732283,14.173226 141.732283,0 m -141.732283,14.17323 141.732283,0 m -141.732283,14.17323 141.732283,0 m -141.732283,14.17323 141.732283,0 m -141.732283,14.17322 141.732283,0 m -141.732283,14.17323 141.732283,0"
id="path2987"
inkscape:connector-curvature="0"
inkscape:path-effect="#path-effect2989"
inkscape:original-d="m 28.346457,46.06297 0,-14.173228 14.173228,0" />
<path
style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#Arrow2Lend)"
d="m 21.259843,24.803127 31.889763,0"
id="path2991"
inkscape:connector-curvature="0" />
<path
style="fill:none;stroke:#000000;stroke-width:1px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1;marker-end:url(#Arrow2Lend)"
d="m 21.259843,24.803127 0,31.889763"
id="path2991-3"
inkscape:connector-curvature="0" />
<text
xml:space="preserve"
style="font-size:40px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
x="56.692913"
y="24.803127"
id="text4229"
sodipodi:linespacing="125%"><tspan
sodipodi:role="line"
id="tspan4231"
x="56.692913"
y="24.803127"
style="font-size:15px;font-style:normal;font-variant:normal;font-weight:normal;font-stretch:normal;text-align:start;line-height:125%;writing-mode:lr-tb;text-anchor:start;font-family:Sans;-inkscape-font-specification:Sans">dim=0</tspan></text>
<text
xml:space="preserve"
style="font-size:40px;font-style:normal;font-weight:normal;line-height:125%;letter-spacing:0px;word-spacing:0px;fill:#000000;fill-opacity:1;stroke:none;font-family:Sans"
x="-109.8425"