PyDQED - A Python wrapper for the DQED constrained nonlinear optimization code
PyDQED provides a means for Python code to utilize DQED, a bounded, constrained nonlinear optimization code. DQED is publicly available, and is distributed with PyDQED. PyDQED provides a Python extension type for DQED, which in turn provides a Pythonic means of setting the solver options, providing residual and jacobian functions, and running the solver.
Copyright (c) 2011 by Joshua W. Allen (email@example.com).
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
PyDQED has been tested on Python versions 2.5 and 2.6. It may or may not work for other Python versions.
There are several Python dependencies that you must install before installing PyDQED:
- Python (versions 2.5.x and 2.6.x are known to work)
- NumPy (version 1.3.0 or later is recommended)
- Cython (version 0.12.1 or later is recommended)
In addition, you will also need a Fortran compiler and a C compiler that
produce object files that can interoperate. The
compiles from the GNU Compiler Collection are known to work. On Windows the
MinGW compiler collection provides these compilers.
The code for DQED has been provided with the PyDQED package. The license for DQED is different than that of the PyDQED wrapper code. You are responsible for knowing and abiding by all licenses associated with DQED as well as with PyDQED.
The provided batch script will compile DQED and the PyDQED wrapper code. This script presumes that you have the 32-bit version of the MinGW C and Fortran compilers installed. Once you have run the batch script, you can install PyDQED into your Python packages if you desire by running the following command from the base package directory:
> python setup.py install
A Makefile has been provided that can be used to compile DQED and the PyDQED wrapper code. To use, invoke the following command from the base package directory:
This command will build PyDQED in-place, rather than installing it to your
Python package directory. If you wish to formally install PyDQED, run the
following command from the base package directory after the
(you may need root privileges for this):
$ python setup.py install
Mac OS X
Very much like the linux, but if you have installed gfortran via homebrew , (brew install gcc) then you may need to tell the makefile where to find the libraries:
$ export LIBRARY_PATH=$(dirname $(gfortran -print-file-name=libgfortran.a)) $ make $ make install