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 functionality for third-party parameter sets #6

Closed
wants to merge 9 commits into from

Conversation

agriyakhetarpal
Copy link
Member

This PR adds: a cookiecutter.json configuration to ask users if they wish to register a third-party parameter set, a basic example of a parameter set, and an entry point in pyproject.toml for using it with PyBaMM

@agriyakhetarpal
Copy link
Member Author

I shall be adding documentation and tests for the same in further pull requests, but I tested this with an example project and it works as intended (the parameter set is defined in src/pybamm_cookiecutter/my_parameters.py).

in pyproject.toml

[project.entry-points.pybamm_parameter_sets]
custom_parameters = "src.pybamm_cookiecutter.my_parameters:get_parameter_values"

and testing it as follows:

>>> pybamm.parameter_sets.get_docstring("custom_parameters")

'\nExample docstring for a third-party parameter set titled `my_parameters`.\n\nReferences\n----------\n\nAdd references to the relevant papers here in this format, to be parsed by\nsphinxcontrib.bibtex in the documentation through a CITATIONS.bib file. You\nmay refer to the documentation for this extension at\nhttps://sphinxcontrib-bibtex.readthedocs.io/en/latest/\n\n:footcite:`van1995python`\n\n'

Copy link
Member

@Saransh-cpp Saransh-cpp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, thanks, @agriyakhetarpal!

import numpy as np

# Extra dependencies may be imported here.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

could you add an example function and scalar parameter?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a sample function with scalar parameters from the OKane2022 parameter set, let me know if that suffices

@agriyakhetarpal agriyakhetarpal marked this pull request as draft August 19, 2023 01:22
@agriyakhetarpal
Copy link
Member Author

I will close this to allow @santacodes to work on this further. He will be looking to start with setting up some testing infrastructure and CI/CD, some additional build backends, and he will then proceed to add some parameter sets and a data file plugin (subject to further discussion on the design for the latter).

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.

None yet

3 participants