Overhead Computation#
To customize the overhead computation the user needs to implement a plugin. This plugin can be very simple, i.e., just a single Python script.
Create a directory, e.g.,
my_pluginCreate a setup script
my_plugin/setup.pywith the following content (py_modulesreflects the file file name without the file extension):Minimalsetup.pyfor the fictivecustom_overhead_function-plugin#from setuptools import setup setup( name="custom_overhead_function", version="1.0.0", py_modules=["custom_overhead_function"], )
Create a new script i.e.,
my_plugin/custom_overhead_function.py. This script needs to implement a class namedOverheadFunctionswhich is derived fromAbcOverheadFunctions. This class must implement all methods defined in the abstract base class AbcOverheadFunctions.Install the plugin in the same Python installation/environment
BaSDis installed into and check that it is available:$ # activate the environment basd has been installed into $ cd my_plugin $ python -m pip install . $ # check that the plugin has been correctly installed $ python -c "import custom_overhead_function; print(custom_overhead_function.OverheadFunctions)" <class 'custom_overhead_function.OverheadFunctions'>
Test the custom plugin against a battery cell (adapt paths to requirements and database as needed):
basd design -r Example-Requirements.json -d Example_Cell.json --overhead-plugin custom_overhead_function