Skip to content

Commit c913510

Browse files
committed
Added dependency files (issue #28)
`pip install -r requirements.txt` environment.yml for conda dependencies: `conda env create -f=environment.yml` creates an environment *cbmpy* Thanks to @fbergmann
1 parent d001ee3 commit c913510

File tree

3 files changed

+42
-2
lines changed

3 files changed

+42
-2
lines changed

cbmpy/CBCPLEX.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -788,7 +788,7 @@ def cplx_writeLPsolution(fba_sol, objf_name, fname, Dir=None, separator=','):
788788
assert os.path.exists(Dir), '\nPath does not exist'
789789
fname = os.path.join(Dir, fname)
790790
fname += '.csv'
791-
F = file(fname, 'w')
791+
F = open(fname, 'w')
792792
F.write('%s%s%s\n' % ('ObjectiveFunction', separator, objf_name))
793793
for r in fba_sol:
794794
F.write('%s%s%f\n' % (r, separator, fba_sol[r]))
@@ -799,11 +799,14 @@ def cplx_writeLPsolution(fba_sol, objf_name, fname, Dir=None, separator=','):
799799

800800
def cplx_getShadowPrices(c):
801801
"""
802-
Returns a dictionary of shadow prices containing 'Rid' : (lb, rhs, ub)
802+
Returns a dictionary of shadow prices containing 'N_row_id' : (lb, rhs, ub)
803803
804804
- *c* a cplex LP object
805805
806806
"""
807+
print(
808+
'cplx_getShadowPrices: This function returns a RHS sensitivity and may or may not be realted to what is known as a shadow price.'
809+
)
807810
c_names = c.linear_constraints.get_names()
808811
rhs_sense = c.solution.sensitivity.rhs()
809812
rhs_val = c.linear_constraints.get_rhs()

environment.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: cbmpy
2+
channels:
3+
- bgoli
4+
- sbmlteam
5+
- defaults
6+
dependencies:
7+
- biopython>=1.78
8+
- ipython
9+
- nose
10+
- numpy
11+
- matplotlib
12+
- python-libsbml>=5.18.0
13+
- scipy
14+
- jedi==0.17.2
15+
- setuptools
16+
- sympy>=1.7.1
17+
- xlsxwriter>=1.3.7
18+
- xlwt
19+
- cbmpy
20+
- pip
21+
- pip:
22+
- swiglpk==4.65.1
23+
prefix: C:\Anaconda3\envs\cbmpy

requirements.txt

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
biopython
2+
jedi==0.17.2
3+
ipython
4+
nose
5+
numpy
6+
matplotlib
7+
python-libsbml
8+
scipy
9+
swiglpk==4.65.1
10+
sympy
11+
xlrd
12+
XlsxWriter
13+
xlwt
14+
cbmpy>=0.8.0

0 commit comments

Comments
 (0)