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

Add-custom-module-functions-functionality #70

Draft
wants to merge 15 commits into
base: develop
Choose a base branch
from

Conversation

mleot
Copy link

@mleot mleot commented Nov 21, 2024

Motivation:

I would like to be able to specify custom function in my codebase (which returns a pybamm compatible function) in a BPX json file by passing the called function name and any arguments.

Example:

"OCP [V]": "mypackage.mymodule.myfunction('arg1','arg2')"

In this case, an import should be added to the preamble, for the package name, and then the function should not be treated as a mathmatical expression.

TODO:

  • Find the right way to recognize that the function is this type of function, and not the mathmatical expression string. Currently, I have looked to see if '"' exists in the string (a string argument will not normally appear in the mathmatical expression version of a BPX function).

rtimms and others added 15 commits November 20, 2023 16:43
* Revamp publishing workflow

* Add condition for PyPI push

* attestations are now enabled by default

Co-authored-by: Saransh Chopra <saransh0701@gmail.com>

* Inspect sdist + wheel, pin actions to hashes

---------

Co-authored-by: Saransh Chopra <saransh0701@gmail.com>
* Support Python 3.9+

* drop 3.8 in CI

---------

Co-authored-by: Robert Timms <robertwtimms@gmail.com>
Co-authored-by: Robert Timms <43040151+rtimms@users.noreply.github.com>
* feat: migrate to pydantic v2

* fix: typo in project urls

* fix: type hints compat python >= 3.8

* fix: clean function tempfile

* fix: clean function cache

* Fix pyproject

* Fix type errors

* Revert some changes

* Reorganize code

* Put some files back

* Minor cleanup

* Fix type annotation

---------

Co-authored-by: Chuck Liu <liuchengkun@finalfrontier.cn>
Co-authored-by: Robert Timms <43040151+rtimms@users.noreply.github.com>
* Remove dependency, update version

* A few small fixes

* Fix string parsing issue

* Remove problematic delete

* Another small fix

* Cleanup

* Experiment

* Revert experiment

* Test cleanup

* Experiment

* Attempt to get the new values

* Revert change

* Fix tests

* Update test workflow
* Add dependabot for automatic workflow updates

* Fix typo
* ci: fix coverage + minor touch ups

* install hatch

* run CI on main

* oops, fix syntax

* add conda

* 3.13 in too

* a bit more cleanup
Bumps the actions group with 4 updates: [actions/checkout](https://github.com/actions/checkout), [actions/setup-python](https://github.com/actions/setup-python), [actions/upload-artifact](https://github.com/actions/upload-artifact) and [codecov/codecov-action](https://github.com/codecov/codecov-action).


Updates `actions/checkout` from 3 to 4
- [Release notes](https://github.com/actions/checkout/releases)
- [Commits](actions/checkout@v3...v4)

Updates `actions/setup-python` from 4 to 5
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](actions/setup-python@v4...v5)

Updates `actions/upload-artifact` from 4.4.3 to 4.5.0
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](actions/upload-artifact@b4b15b8...6f51ac0)

Updates `codecov/codecov-action` from 2 to 5
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](codecov/codecov-action@v2...v5)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: actions
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants