diff --git a/badges/docstring_coverage.svg b/badges/docstring_coverage.svg deleted file mode 100644 index ede19575876030e5398abf5f389986501bd6db62..0000000000000000000000000000000000000000 --- a/badges/docstring_coverage.svg +++ /dev/null @@ -1,20 +0,0 @@ -<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="142" height="20"> - <linearGradient id="s" x2="0" y2="100%"> - <stop offset="0" stop-color="#bbb" stop-opacity=".1"/> - <stop offset="1" stop-opacity=".1"/> - </linearGradient> - <clipPath id="r"> - <rect width="142" height="20" rx="3" fill="#fff"/> - </clipPath> - <g clip-path="url(#r)"> - <rect width="99" height="20" fill="#555"/> - <rect x="99" width="43" height="20" fill="#4c1"/> - <rect width="142" height="20" fill="url(#s)"/> - </g> - <g fill="#fff" text-anchor="middle" font-family="Verdana,Geneva,DejaVu Sans,sans-serif" font-size="110"> - <text x="505" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="890">docstr-coverage</text> - <text x="505" y="140" transform="scale(.1)" textLength="890">docstr-coverage</text> - <text x="1195" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)">100%</text> - <text x="1195" y="140" transform="scale(.1)">100%</text> - </g> -</svg> \ No newline at end of file diff --git a/binarycpython/utils/ensemble.py b/binarycpython/utils/ensemble.py index d2414c4f67aa9f90eb8f881694678d6b21daa5e4..4c27268e0d52612a593c33515948525a9ae5549f 100644 --- a/binarycpython/utils/ensemble.py +++ b/binarycpython/utils/ensemble.py @@ -288,8 +288,14 @@ def binaryc_json_serializer(obj: Any) -> Any: if inspect.isfunction(obj) or isinstance(obj, py_rinterpolate.Rinterpolate): return str(obj) - return obj - + else: + try: + string_version = str(obj) + return string_version + except: + raise TypeError( + "Unserializable object {} of type {}. Attempted to convert to string but that failed.".format(obj, type(obj)) + ) class BinarycDecoder(json.JSONDecoder): """ diff --git a/examples/notebook_custom_logging.ipynb b/examples/notebook_custom_logging.ipynb index 8dfb85034dd77e1b0ae790c475a1e52bd70d0227..5151c490f099490b8b6b0f2aee6244676f99fa31 100644 --- a/examples/notebook_custom_logging.ipynb +++ b/examples/notebook_custom_logging.ipynb @@ -465,7 +465,7 @@ ], "metadata": { "kernelspec": { - "display_name": "Python 3", + "display_name": "Python 3 (ipykernel)", "language": "python", "name": "python3" }, @@ -479,7 +479,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.6.4" + "version": "3.9.9" } }, "nbformat": 4,