Skip to content

Commit

Permalink
Merge pull request #2454 from abillscmu/main
Browse files Browse the repository at this point in the history
cherry picking to eliminate Julia
  • Loading branch information
valentinsulzer authored Nov 14, 2022
2 parents 823aab0 + f4b9cf1 commit c544b6d
Show file tree
Hide file tree
Showing 19 changed files with 6 additions and 2,046 deletions.
10 changes: 0 additions & 10 deletions .github/workflows/test_on_push.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,12 +55,6 @@ jobs:
with:
python-version: ${{ matrix.python-version }}

- name: Set up Julia
if: matrix.os != 'windows-latest'
uses: julia-actions/setup-julia@v1
with:
version: 1.7

- name: Install Linux system dependencies
if: matrix.os == 'ubuntu-latest'
run: |
Expand Down Expand Up @@ -92,10 +86,6 @@ jobs:
if: matrix.os == 'ubuntu-latest'
run: tox -e pybamm-requires

- name: Install Julia
if: matrix.os != 'windows-latest'
run: tox -e julia

- name: Run unit tests for GNU/Linux with Python 3.8
if: matrix.os == 'ubuntu-latest' && matrix.python-version != 3.9
run: python -m tox -e unit
Expand Down
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,6 @@ test.json
# tox
.tox/

# julia
Manifest.toml

# vcpkg
vcpkg_installed/

Expand Down
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# [Unreleased](https://github.com/pybamm-team/PyBaMM/)

# [v22.10.post1](https://github.com/pybamm-team/PyBaMM/tree/v22.10.post1) - 2022-10-31

- Removed all julia generation code ([#2453](https://github.com/pybamm-team/PyBaMM/pull/2453)). Julia code will be hosted at [PyBaMM.jl](https://github.com/tinosulzer/PyBaMM.jl) from now on.

# [v22.10](https://github.com/pybamm-team/PyBaMM/tree/v22.10) - 2022-10-31

## Features
Expand Down
2 changes: 0 additions & 2 deletions docs/source/util.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ Utility functions

.. autofunction:: pybamm.get_parameters_filepath

.. autofunction:: pybamm.have_julia

.. autofunction:: pybamm.have_jax

.. autofunction:: pybamm.is_jax_compatible
5 changes: 0 additions & 5 deletions pybamm/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,6 @@
have_jax,
install_jax,
is_jax_compatible,
have_julia,
get_git_commit_info,
)
from .logger import logger, set_logging_level
Expand Down Expand Up @@ -96,10 +95,6 @@
from .expression_tree.operations.jacobian import Jacobian
from .expression_tree.operations.convert_to_casadi import CasadiConverter
from .expression_tree.operations.unpack_symbols import SymbolUnpacker
from .expression_tree.operations.evaluate_julia import (
get_julia_function,
get_julia_mtk_model,
)

#
# Model classes
Expand Down
35 changes: 0 additions & 35 deletions pybamm/expression_tree/functions.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,13 +201,6 @@ def _sympy_operator(self, child):
"""Apply appropriate SymPy operators."""
return child

@property
def julia_name(self):
"Return the name of the equivalent Julia function, for generating Julia code"
raise NotImplementedError(
"No julia name defined for function {}".format(self.function)
)

def to_equation(self):
"""Convert the node and its subtree into a SymPy equation."""
if self.print_name is not None:
Expand Down Expand Up @@ -256,14 +249,6 @@ def _function_new_copy(self, children):
"""See :meth:`pybamm.Function._function_new_copy()`"""
return pybamm.simplify_if_constant(self.__class__(*children))

@property
def julia_name(self):
"""See :meth:`pybamm.Function.julia_name`"""
# By default, the julia name for a specific function is the class name
# in lowercase
# Some functions may overwrite this
return self.__class__.__name__.lower()

def _sympy_operator(self, child):
"""Apply appropriate SymPy operators."""
class_name = self.__class__.__name__.lower()
Expand All @@ -281,11 +266,6 @@ def _function_diff(self, children, idx):
"""See :meth:`pybamm.Symbol._function_diff()`."""
return 1 / sqrt(children[0] ** 2 + 1)

@property
def julia_name(self):
"""See :meth:`pybamm.Function.julia_name`"""
return "asinh"

def _sympy_operator(self, child):
"""Override :meth:`pybamm.Function._sympy_operator`"""
return sympy.asinh(child)
Expand All @@ -306,11 +286,6 @@ def _function_diff(self, children, idx):
"""See :meth:`pybamm.Function._function_diff()`."""
return 1 / (children[0] ** 2 + 1)

@property
def julia_name(self):
"""See :meth:`pybamm.Function.julia_name`"""
return "atan"

def _sympy_operator(self, child):
"""Override :meth:`pybamm.Function._sympy_operator`"""
return sympy.atan(child)
Expand Down Expand Up @@ -426,11 +401,6 @@ class Max(SpecificFunction):
def __init__(self, child):
super().__init__(np.max, child)

@property
def julia_name(self):
"""See :meth:`pybamm.Function.julia_name`"""
return "maximum"

def _evaluate_for_shape(self):
"""See :meth:`pybamm.Symbol.evaluate_for_shape_using_domain()`"""
# Max will always return a scalar
Expand All @@ -451,11 +421,6 @@ class Min(SpecificFunction):
def __init__(self, child):
super().__init__(np.min, child)

@property
def julia_name(self):
"""See :meth:`pybamm.Function.julia_name`"""
return "minimum"

def _evaluate_for_shape(self):
"""See :meth:`pybamm.Symbol.evaluate_for_shape_using_domain()`"""
# Min will always return a scalar
Expand Down
Loading

0 comments on commit c544b6d

Please sign in to comment.