Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

eliminate-julia #2453

Merged
merged 8 commits into from
Nov 14, 2022
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
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
2 changes: 0 additions & 2 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,7 +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

#
# 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