Skip to content

inspect routine for ObsSequence object? #92

@hkershaw-brown

Description

@hkershaw-brown

I've been using this routine to print out all the attributes of the ObsSequence object. Worth having as a utility routine?

import inspect

routines = []
non_routines = []

for attr in dir(obs_seq):
    if attr.startswith('__'):
        continue
    value = getattr(obs_seq, attr)
    if inspect.isroutine(value):
        routines.append(attr)
    else:
        non_routines.append(attr)

print("\nNon-routines (data attributes):")
for n in non_routines:
    print("  -", n)
print("Routines (methods/functions):")
for r in routines:
    print("  -", r)

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions