FaradayInstitution / BPX

BPX schema in pydantic and JSON schema format, and parsers
MIT License
25 stars 12 forks source link

Question about loading functions #11

Closed valentinsulzer closed 1 year ago

valentinsulzer commented 1 year ago

Does it have to go via a tempfile? https://github.com/pybamm-team/BPX/blob/70f1637b239489e92e828c46c73655f14c0f4937/bpx/function.py#L54-L66

Can the function not be evaluated directly? Is this for safety reasons?

martinjrobins commented 1 year ago

If you have a syntax error, or bug in your loaded function, you need the source sitting in a file somewhere so python can print out the source line number and text

valentinsulzer commented 1 year ago

Ok makes sense, thanks