|
1 |
| -"""A script to scrape the Bokeh package and collate dictionaries of |
| 1 | +""" |
| 2 | +A script to scrape the Bokeh package and collate dictionaries of |
2 | 3 | classes and functions.
|
3 | 4 |
|
4 | 5 | The ``_parse_module`` function iterates over a module, and uses the
|
|
34 | 35 | from bokeh import layouts, models, palettes, plotting, transform
|
35 | 36 | from inspect import getmembers, isclass, isfunction
|
36 | 37 |
|
37 |
| -from .surface3d import Surface3d |
38 |
| - |
39 | 38 | bokeh_sequences = {}
|
40 |
| -bokeh_mappings = {"Surface3d": Surface3d} # Note that abstract base classes *are* included |
| 39 | +bokeh_mappings = {} # Note that abstract base classes *are* included |
41 | 40 |
|
42 | 41 |
|
43 | 42 | def _parse_module(module):
|
44 |
| - """Sort the members of a module into dictionaries of functions |
45 |
| - (sequences) and classes (mappings).""" |
46 |
| - |
47 |
| - test = lambda nm, mem: (not nm.startswith("_")) and (module.__name__ in mem.__module__) |
48 |
| - seqs = {nm: mem for nm, mem in getmembers(module, isfunction) if test(nm, mem)} |
49 |
| - maps = {nm: mem for nm, mem in getmembers(module, isclass) if test(nm, mem)} |
| 43 | + """ |
| 44 | + Sort the members of a module into dictionaries of functions (sequences) |
| 45 | + and classes (mappings). |
| 46 | + """ |
| 47 | + |
| 48 | + def accessible_member(name, member): |
| 49 | + return (not name.startswith("_")) and (module.__name__ in member.__module__) |
| 50 | + |
| 51 | + seqs = {nm: mem for nm, mem in getmembers(module, isfunction) if accessible_member(nm, mem)} |
| 52 | + maps = {nm: mem for nm, mem in getmembers(module, isclass) if accessible_member(nm, mem)} |
50 | 53 |
|
51 | 54 | # these need to be mappings
|
52 | 55 | if 'gridplot' in seqs:
|
|
0 commit comments