Skip to content

Commit

Permalink
release version 0.2.0-dev
Browse files Browse the repository at this point in the history
  • Loading branch information
Mukesh Mithrakumar committed Jul 8, 2019
1 parent ecb6f87 commit 75188ec
Show file tree
Hide file tree
Showing 9 changed files with 23 additions and 26 deletions.
1 change: 1 addition & 0 deletions .coveralls.yml
@@ -0,0 +1 @@
repo_token: DZRGgrLojw7WNCe7PR8b6OgGLCiC7sZUD
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -50,3 +50,4 @@ check.py
.coverage
.benchmarks
.tox
.pypirc
5 changes: 3 additions & 2 deletions .travis.yml
Expand Up @@ -12,13 +12,14 @@ install:

script:
- echo "Running Tests ..."
- pytest
- pytest -v --cov
- flake8
- coverage run --source=tensorflow_scientific -m pytest
- coverage run --source=tensorflow_scientific setup.py test

after_success:
- coveralls
# - python setup.py sdist bdist_wheel
# - twine upload dist/*

notifications:
email:
Expand Down
2 changes: 2 additions & 0 deletions MANIFEST.in
@@ -0,0 +1,2 @@
recursive-exclude tensorflow_scientific/quantum *
recursive-exclude tensorflow_scientific/solvers *
14 changes: 6 additions & 8 deletions setup.py
Expand Up @@ -25,16 +25,14 @@
from setuptools import find_packages
from setuptools import setup
import os
import sys

# To enable importing version.py directly, we add its path to sys.path.
version_path = os.path.join(os.path.dirname(__file__), 'tensorflow_scientific')
sys.path.append(version_path)
from version import __version__ # noqa: E402
version = {}
base_dir = os.path.dirname(os.path.abspath(__file__))
with open(os.path.join(base_dir, "tensorflow_scientific", "version.py")) as fp:
exec(fp.read(), version)


project_name = 'tensorflow-scientific'
project_version = '0.1.0-dev'

REQUIRED_PACKAGES = [
'six >= 1.10.0',
Expand All @@ -46,14 +44,14 @@

setup(
name=project_name,
version=__version__,
version=version['__version__'],
description='Scientific modeling in TensorFlow',
long_description=long_description,
long_description_content_type='text/markdown',
author='Mukesh Mithrakumar',
author_email='mukesh@mukeshmithrakumar.com',
url='https://github.com/mukeshmithrakumar/scientific',
packages=find_packages(exclude=['tests']),
packages=find_packages(),
install_requires=REQUIRED_PACKAGES,
include_package_data=True,
zip_safe=False,
Expand Down
6 changes: 3 additions & 3 deletions tensorflow_scientific/integrate/odes.py
Expand Up @@ -554,13 +554,13 @@ def odeint_fixed(func, y0, t, dt=None, method='rk4', name=None):
dt = intervals
dt = ops.convert_to_tensor(dt, preferred_dtype=dtypes.float64, name='dt')

_check_input_types(y0, t, dt)
_check_input_sizes(t, dt)

steps_on_intervals = math_ops.ceil(intervals / dt)
dt = intervals / steps_on_intervals
steps_on_intervals = math_ops.cast(steps_on_intervals, dtype=dtypes.int32)

_check_input_types(y0, t, dt)
_check_input_sizes(t, dt)

with _assert_increasing(t):
if method == 'midpoint':
return _MidpointFixedGridIntegrator().integrate(func, y0, t, dt, steps_on_intervals)
Expand Down
15 changes: 4 additions & 11 deletions tensorflow_scientific/integrate/tests/odes_test.py
Expand Up @@ -227,12 +227,9 @@ def _test_everything(self, method):
self._test_integrate_sine_all(method)
self._test_integrate_gaussian_all(method)

# TODO: Skipping the next two functions because of the following error
@pytest.mark.skip(reason="np assert_allclose with ufunc isfinite not supported for the input types")
def test_midpoint(self):
self._test_everything('midpoint')

@pytest.mark.skip(reason="np assert_allclose with ufunc isfinite not supported for the input types")
def test_rk4(self):
self._test_everything('rk4')

Expand All @@ -243,19 +240,15 @@ def test_size_exceptions(self):
dt_wrong_dim = np.expand_dims(np.linspace(0., 2., 99), axis=0)
times_wrong_dim = np.expand_dims(np.linspace(0., 2., 100), axis=0)

with self.assertRaises(ValueError):
self._test_integrate_gaussian('midpoint', times_wrong_dim, dt)
with self.assertRaises(errors_impl.InvalidArgumentError):
self._test_integrate_gaussian('midpoint', times, dt_wrong_length)

with self.assertRaises(ValueError):
self._test_integrate_gaussian('midpoint', times, dt_wrong_dim)

with self.assertRaises(ValueError):
self._test_integrate_gaussian('midpoint', times, dt_wrong_length)
with self.assertRaises(errors_impl.InvalidArgumentError):
self._test_integrate_gaussian('midpoint', times_wrong_dim, dt)


if __name__ == '__main__':
# python -m tensorflow_scientific.integrate.tests.odes_test
# Use pytest benchmark to benchmark the functions to see the speeds
# use pytest -v --cov to check the code coverage
# pytest -v
test.main()
4 changes: 2 additions & 2 deletions tensorflow_scientific/version.py
Expand Up @@ -16,7 +16,7 @@

# We follow Semantic Versioning (https://semver.org/)
_MAJOR_VERSION = '0'
_MINOR_VERSION = '1'
_MINOR_VERSION = '2'
_PATCH_VERSION = '0'

# When building releases, we can update this value on the release branch to
Expand All @@ -26,7 +26,7 @@
# 'development' version, labeled 'dev'.
_VERSION_SUFFIX = 'dev'

# Example, '0.1.0-dev'
# Example, '0.2.0-dev'
__version__ = '.'.join([
_MAJOR_VERSION,
_MINOR_VERSION,
Expand Down
1 change: 1 addition & 0 deletions test-requirements.txt
Expand Up @@ -2,3 +2,4 @@ pytest
flake8
pytest-cov
twine
coveralls

0 comments on commit 75188ec

Please sign in to comment.