Skip to content

Commit

Permalink
Add examples of estimator, metrics, and world models to notebook.
Browse files Browse the repository at this point in the history
  • Loading branch information
Mayitzin committed Oct 16, 2024
1 parent 843cb80 commit c89785b
Show file tree
Hide file tree
Showing 2 changed files with 527 additions and 758 deletions.
1,270 changes: 512 additions & 758 deletions notebooks/Showcase.ipynb

Large diffs are not rendered by default.

15 changes: 15 additions & 0 deletions notebooks/tools.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
"""

import copy
from inspect import getmembers, isfunction
import numpy as np
import matplotlib.pyplot as plt

Expand Down Expand Up @@ -45,6 +46,20 @@ def describe_methods(obj):
except Exception as e:
print(class_and_method + f"{method_description} ({e})")

def describe_functions(module):
"""Return the description of the functions of a module."""
for function_name in [item[0] for item in getmembers(module, isfunction) if not item[0].startswith('_')]:
function_description = '<No description found>'
try:
function_docstring = getattr(module, function_name).__doc__
if isinstance(function_docstring, str):
function_description = function_docstring.split('\n')[1].strip()
if len(function_description) < 1:
function_description = [x.strip() for x in function_docstring.split('\n') if len(x) > 0][1]
print(f"{module.__name__}.{function_name+'()': <24}" + f"{function_description.replace(':meth:', '')}")
except Exception as e:
print(f"{module.__name__}.{function_name+'()': <24}" + f"{function_description} ({e})")

def plot(*data, **kw):
"""
Plot time-series data.
Expand Down

0 comments on commit c89785b

Please sign in to comment.