Skip to content

Commit

Permalink
Include version number in package.
Browse files Browse the repository at this point in the history
  • Loading branch information
mossblaser committed Jan 20, 2016
1 parent 9f6f7f6 commit d9acd99
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 5 deletions.
6 changes: 4 additions & 2 deletions rig_c_sa/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
from _sa import ffi
from _sa.lib import *
from rig_c_sa.version import __version__

from _rig_c_sa import ffi
from _rig_c_sa.lib import *
2 changes: 1 addition & 1 deletion rig_c_sa/cffi_compile.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
source_dir = os.path.dirname(__file__)

ffi.set_source(
"_sa",
"_rig_c_sa",
"""
#include <stdlib.h>
#include "sa.h"
Expand Down
3 changes: 2 additions & 1 deletion rig_c_sa/sa.c
Original file line number Diff line number Diff line change
Expand Up @@ -619,6 +619,7 @@ sa_bool_t sa_step(sa_state_t *state, int distance_limit, double temperature, dou
va->vertex_resources,
&vb)) {
*cost = 0.0;
printf("cant fit a in b\n");

This comment has been minimized.

Copy link
@mossblaser

mossblaser Jan 20, 2016

Author Member

Whoops...

return sa_false;
}

Expand All @@ -632,7 +633,7 @@ sa_bool_t sa_step(sa_state_t *state, int distance_limit, double temperature, dou
// is and how high the temperature is.
*cost = sa_get_swap_cost(state, ax, ay, va, bx, by, vb);
swap_accepted = ((*cost) <= 0.0)
|| ((double)rand() / RAND_MAX) < exp(-(*cost) / temperature);
|| ((double)rand() / RAND_MAX) < exp(-(*cost) / temperature);

// Attempt to fit the vertices removed from chip B into the space left behind
// after removing va from chip A. If not enough space (or if the swap was not
Expand Down
1 change: 1 addition & 0 deletions rig_c_sa/version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__ = "0.3.1"
5 changes: 4 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,12 @@
import re
from setuptools import setup, find_packages

with open("rig_c_sa/version.py", "r") as f:
exec(f.read())

setup(
name="rig_c_sa",
version="0.3.0",
version=__version__,
packages=find_packages(),

# Files required by CFFI wrapper
Expand Down

0 comments on commit d9acd99

Please sign in to comment.