Skip to content

Commit

Permalink
Merge pull request #584 from sys-bio/develop
Browse files Browse the repository at this point in the history
Update for python 3.12
  • Loading branch information
luciansmith authored Jan 31, 2024
2 parents aa6cbec + fcb119e commit 6a272bc
Show file tree
Hide file tree
Showing 9 changed files with 10 additions and 83 deletions.
4 changes: 2 additions & 2 deletions docs/_notebooks/core/tellurium_examples.rst
Original file line number Diff line number Diff line change
Expand Up @@ -169,12 +169,12 @@ conditions resulting in different steady states reached.
print(r.selections)
initValue = 0.05
m = r.simulate (0, 4, 100, selections=["time", "S1"])
m = r.simulate (0, 4, 100, selections=["time", "[S1]"])
for i in range (0,12):
r.reset()
r['[S1]'] = initValue
res = r.simulate (0, 4, 100, selections=["S1"])
res = r.simulate (0, 4, 100, selections=["[S1]"])
m = np.concatenate([m, res], axis=1)
initValue += 1
Expand Down
2 changes: 1 addition & 1 deletion tellurium/VERSION.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.2.9
2.2.10
7 changes: 0 additions & 7 deletions tellurium/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -136,13 +136,6 @@
executeInlineOmexFromFile,
)

# Package utilities
from tellurium.utils.package import (
searchPackage,
installPackage,
upgradePackage,
uninstallPackage,
)
from tellurium.utils.misc import(
saveToFile,
readFromFile,
Expand Down
1 change: 0 additions & 1 deletion tellurium/teconverters/convert_omex.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@
import getpass


import imp # reloads because numl is overwriting symbols
try:
import libcombine
except ImportError:
Expand Down
4 changes: 2 additions & 2 deletions tellurium/tests/test_examples.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
import unittest

import os
import imp
from tellurium.tests.helpers import filesInDirectory
from importlib.machinery import SourceFileLoader

# ----------------------------------------------------------------
# List of python files to test
Expand Down Expand Up @@ -44,7 +44,7 @@ def test(self=None):
""" Test failes if Exception in execution of f. """
if self is not None:
print(filePath)
imp.load_source(os.path.basename(filePath)[:-3], filePath)
SourceFileLoader(os.path.basename(filePath)[:-3], filePath).load_module()
return test


Expand Down
5 changes: 2 additions & 3 deletions tellurium/utils/misc.py
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def runTool (toolFileName):
root, waste = os.path.split(p)
toolFileName[0] = root + '\\telluriumTools\\' + toolFileName[0] + '\\' + toolFileName[0] + '.exe'
return subprocess.check_output(toolFileName)
except subprocess.CalledProcessError as e:
except subprocess.CalledProcessError:
raise Exception('Tool failed to run correctly or could not be found')

# ---------------------------------------------------------------------
Expand All @@ -98,7 +98,7 @@ def getODEsFromSBMLFile (fileName):
>>> te.getODEsFromSBMLFile ('mymodel.xml')
"""
sbmlStr = te.readFromFile (fileName)
sbmlStr = readFromFile (fileName)
extractor = ODEExtractor (sbmlStr)
return extractor.toString()

Expand Down Expand Up @@ -197,7 +197,6 @@ def __init__(self, sbmlStr):
self.use_species_names = False
self.use_ids = True

from collections import defaultdict
self.accumulators = {}
self.accumulator_list = []

Expand Down
6 changes: 3 additions & 3 deletions tellurium/utils/omex.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,9 +57,9 @@ def __init__(self, location, format=None, formatKey=None, master=False, descript

def __str__(self):
if self.master:
return '<*master* Entry {} | {}>'.format(self.master, self.location, self.format)
return '<*master* Entry {} | {}>'.format(self.location, self.format)
else:
return '<Entry {} | {}>'.format(self.master, self.location, self.format)
return '<Entry {} | {}>'.format(self.location, self.format)


class Creator(object):
Expand Down Expand Up @@ -90,7 +90,7 @@ def combineArchiveFromDirectory(directory, omexPath, creators=None, creators_for

print(manifest_path)
if os.path.exists(manifest_path):
warnings.warn("Manifest file exists in directory, but not used in COMBINE archive creation: %s".format(manifest_path))
warnings.warn("Manifest file exists in directory {}, but not used in COMBINE archive creation: %s".format(manifest_path))

# add the base entry
entries = [
Expand Down
63 changes: 0 additions & 63 deletions tellurium/utils/package.py

This file was deleted.

1 change: 0 additions & 1 deletion tellurium/utils/uncertainty.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
te.setDefaultPlottingEngine("matplotlib")
import numpy as np
import random
import roadrunner
import matplotlib
import matplotlib.pyplot as plt
import matplotlib.gridspec as gs
Expand Down

0 comments on commit 6a272bc

Please sign in to comment.