Skip to content

Commit

Permalink
Merge pull request #6 from ReactionMechanismGenerator/fix/overhaul
Browse files Browse the repository at this point in the history
overhaul
  • Loading branch information
JacksonBurns authored Jun 28, 2024
2 parents ae5db71 + c2dbbb9 commit 4a30b2f
Show file tree
Hide file tree
Showing 8 changed files with 139 additions and 328 deletions.
12 changes: 0 additions & 12 deletions .conda/bld.bat

This file was deleted.

6 changes: 6 additions & 0 deletions .conda/conda_build_config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
python:
- 3.8
- 3.9
- 3.10
- 3.11
- 3.12
9 changes: 5 additions & 4 deletions .conda/meta.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,16 @@ build:

requirements:
build:
- {{ compiler('c') }} # [unix]
- {{ compiler('fortran') }} # [unix]
- {{ compiler('c') }}
- {{ compiler('fortran') }}
host:
- python 3.7
- python
- cython
- numpy
- setuptools
run:
- python 3.7
- python
# https://conda-forge.org/docs/maintainer/knowledge_base/#building-against-numpy
- {{ pin_compatible('numpy') }}

test:
Expand Down
55 changes: 55 additions & 0 deletions .github/workflows/build_package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
name: Build Package

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

on:
pull_request:
workflow_dispatch:
push:
branches:
- stable
jobs:
build:
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-13, macos-latest, windows-latest]
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v4
- name: Setup Conda
uses: conda-incubator/setup-miniconda@v3
with:
auto-update-conda: false
conda-solver: libmamba
auto-activate-base: true
activate-environment: ""
- name: Install Build Tools
run: conda install python anaconda-client conda-build
- name: Configure Auto-Upload
if: github.ref == 'refs/heads/stable'
run: |
conda config --set anaconda_upload yes
- name: Build Binary
run: |
# set a default value to the conda_token if needed (like from forks)
: "${CONDA_TOKEN:=${{ secrets.ANACONDA_TOKEN }}}"
: "${CONDA_TOKEN:=default_value}"
echo "CONDA_TOKEN=$CONDA_TOKEN" >> $GITHUB_ENV
conda config --add channels conda-forge
conda config --add channels rmg
conda build --token $CONDA_TOKEN --user rmg .
result:
if: ${{ always() }}
runs-on: ubuntu-latest
name: Final Results
needs: [build]
steps:
- run: exit 1
# see https://github.com/orgs/community/discussions/26822?sort=new#discussioncomment-8285141
if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') || contains(needs.*.result, 'skipped') }}
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2011 by Joshua W. Allen (joshua.w.allen@gmail.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.
52 changes: 52 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# PyDQED
## Python wrapper for the DQED constrained nonlinear optimization code

> [!WARNING]
> PyDQED is currently abandonware. The ReactionMechanismGenerator organization no longer has developers capable of maintaining it.
The usage documentation is still relevant but no new updates will be released and we are unable to fix any bugs.
We will continue to release conda packages for PyDQED as long as possible.

To build PyDQED, clone this repository, install the dependencies (find them with `conda search -c rmg PyDQED`), upgrade whichever are causing problems, then navigate to the `.conda` directory and run `conda build .`.

What follows is the original content of the README, slighly updated to removed erroneous instructions and dead links.

# Introduction

PyDQED provides a means for Python code to utilize DQED, a bounded, constrained nonlinear optimization code.
DQED is [publicly available](http://www.netlib.org/opt/dqed.f) 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.

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.**

# Installation
## Anaconda Binary (Recommended)

Install from the `rmg` conda channel:
```
conda install -c rmg pydqed
```

## Build Locally
### Dependencies

We build PyDQED using GitHub actions to support multiple versions of Python and platforms.

To build locally, you need the following dependencies (which will automatically be installed with conda when not building locally):
- python
- numpy
- Cython
- gfortran
- gcc

### Building
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:
```
make
```

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 `make` command (you may need root privileges for this):
```
python setup.py install
```
142 changes: 0 additions & 142 deletions README.rst

This file was deleted.

Loading

0 comments on commit 4a30b2f

Please sign in to comment.