Skip to content

Commit

Permalink
Updated version number from 0.7.0 to 0.7.1 and made an update to the …
Browse files Browse the repository at this point in the history
…Install section of the readme.
  • Loading branch information
blakeaw committed Jul 24, 2024
1 parent 7d46cc9 commit c1a9d38
Show file tree
Hide file tree
Showing 7 changed files with 63 additions and 64 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,11 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## [0.7.1] - 2024-07-23

### Fixed
- Updated the logic for setting the optimizer backend via the `run_gao` variable; fix for Issue https://github.com/blakeaw/GAlibrate/issues/12

## [0.7.0] - 2023-04-27 to 2024-07-23

### Added
Expand Down
2 changes: 1 addition & 1 deletion CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ authors:
given-names: "Blake"
orcid: "https://orcid.org/0000-0002-8269-2500"
title: "GAlibrate: Model calibration using Genetic Algorithm optimization in Python"
version: 0.7.0
version: 0.7.1
doi: 10.5281/zenodo.3345232
date-released: 2023-11-02
url: "https://github.com/blakeaw/GAlibrate"
19 changes: 12 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

![Python version badge](https://img.shields.io/badge/python-3.10.11-blue.svg)
[![license](https://img.shields.io/github/license/blakeaw/GAlibrate.svg)](LICENSE)
![version](https://img.shields.io/badge/version-0.7.0-orange.svg)
[![release](https://img.shields.io/github/release-pre/blakeaw/GAlibrate.svg)](https://github.com/blakeaw/GAlibrate/releases/tag/v0.7.0)
![version](https://img.shields.io/badge/version-0.7.1-orange.svg)
[![release](https://img.shields.io/github/release-pre/blakeaw/GAlibrate.svg)](https://github.com/blakeaw/GAlibrate/releases/tag/v0.7.1)
[![anaconda cloud](https://anaconda.org/blakeaw/galibrate/badges/version.svg)](https://anaconda.org/blakeaw/galibrate)
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/6cdd91c06b11458384becb85db9adb15)](https://www.codacy.com/gh/blakeaw/GAlibrate/dashboard?utm_source=github.com&utm_medium=referral&utm_content=blakeaw/GAlibrate&utm_campaign=Badge_Grade)
[![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/psf/black)
Expand Down Expand Up @@ -65,22 +65,27 @@ Note that `galibrate` has the following core dependencies:
* [SciPy](https://www.scipy.org/)

### pip install
You can install the latest release of the `galibrate` package using `pip` sourced from the GitHub repo:
You can install the latest release of the `galibrate` package using `pip` sourced from the GitHub repo -

**Fresh install:**
```
pip install -e git+https://github.com/blakeaw/GAlibrate@v0.6.0#egg=galibrate
pip install https://github.com/blakeaw/GAlibrate/archive/refs/tags/v0.7.1.zip
```
However, this will not automatically install the core dependencies. You will have to do that separately:
**Or to upgrade from an older version:**
```
pip install numpy scipy
pip install --upgrade https://github.com/blakeaw/GAlibrate/archive/refs/tags/v0.7.1.zip
```

### PyPI

`galibrate` can also be `pip` installed from PyPI,
```
pip install galibrate
```
but this version currently doesn't include the Cython accelerated version of the core GA algorithm.

### conda install
### conda

You can install the `galibrate` package from the `blakeaw` channel:
```
conda install -c blakeaw galibrate
Expand Down
2 changes: 1 addition & 1 deletion galibrate/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
"""
from .gao import GAO

__version__="0.7.0"
__version__="0.7.1"
93 changes: 41 additions & 52 deletions galibrate/gao.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,72 +9,61 @@


def _set_run_gao_numba():
from . import run_gao_numba

run_gao = run_gao_numba
return

try:
from . import run_gao_numba
warnings.warn("------Running GAO with numba optimization.------", RuntimeWarning)
return run_gao_numba
except:
return None

def _set_run_gao_cython():
import pyximport

# Added the setup_args with include_dirs for numpy so it pyximport can build
# the code on Windows machine.
pyximport.install(language_level=3, setup_args={"include_dirs": np.get_include()})
from . import run_gao_cython

run_gao = run_gao_cython
return


def _set_run_gao_julia():
from . import run_gao_julia

run_gao = run_gao_julia
return


def _set_run_gao_py():
from . import run_gao_py

run_gao = run_gao_py
return


# Try the numba version of run_gao
try:
_set_run_gao_numba()
_run_gao_import = True
warnings.warn("------Running GAO with numba optimization.------", RuntimeWarning)
except:
_run_gao_import = False
# Numba didn't work, so try the Cython version
if not _run_gao_import:
try:
_set_run_gao_cython()
_run_gao_import = True
import pyximport
# Added the setup_args with include_dirs for numpy so it pyximport can build
# the code on Windows machine.
pyximport.install(language_level=3, setup_args={"include_dirs": np.get_include()})
from . import run_gao_cython
warnings.warn(
"------Running GAO with Cython optimization.------", RuntimeWarning
)
except ImportError:
_run_gao_import = False
return run_gao_cython
except:
return None

# Neither Numba nor Cython worked, so try the Julia version
if not _run_gao_import:

def _set_run_gao_julia():
try:
_set_run_gao_julia()
_run_gao_import = True
from . import run_gao_julia
warnings.warn(
"------Running GAO with Julia optimization.------", RuntimeWarning
)
except ImportError:
_run_gao_import = False
return run_gao_julia
except:
return None


def _set_run_gao_py():
try:
from . import run_gao_py
return run_gao_py
except:
return None

print(run_gao, _run_gao_import)
# Try the numba version of run_gao
run_gao = _set_run_gao_numba()

if run_gao is None:
# Numba didn't work, so try the Cython version
run_gao = _set_run_gao_cython()
if run_gao is None:
# Neither Numba nor Cython worked, so try the Julia version
run_gao = _set_run_gao_julia()
if run_gao is None:
# None of Numba, Cython, or Julia worked, so fallback to the pure Python version
if not _run_gao_import:
_set_run_gao_py()
_run_gao_import = True
run_gao = _set_run_gao_py()

print(run_gao, _run_gao_import)

class GAO(object):
"""A continuous Genetic Algorithm-based Optimizer.
Expand Down
4 changes: 2 additions & 2 deletions meta.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
package:
name: galibrate
version: "0.7.0"
version: "0.7.1"

source:
git_url: https://github.com/blakeaw/GAlibrate.git
git_rev: v0.7.0
git_rev: v0.7.1

requirements:
build:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setup(
name="galibrate",
version="0.7.0",
version="0.7.1",
python_requires=">=3.10",
install_requires=["numpy>=1.23.5", "scipy>=1.10.1"],
extras_require={
Expand Down

0 comments on commit c1a9d38

Please sign in to comment.