Rules to determine if `name` should be undocumented.
(name)
| 613 | |
| 614 | |
| 615 | def ignore_undocumented(name): |
| 616 | """Rules to determine if `name` should be undocumented.""" |
| 617 | # NOT DOCUMENTED ON PURPOSE. |
| 618 | # Constants uppercase are not documented. |
| 619 | if name.isupper(): |
| 620 | return True |
| 621 | # ModelMixins / Encoders / Decoders / Layers / Embeddings / Attention are not documented. |
| 622 | if ( |
| 623 | name.endswith("ModelMixin") |
| 624 | or name.endswith("Decoder") |
| 625 | or name.endswith("Encoder") |
| 626 | or name.endswith("Layer") |
| 627 | or name.endswith("Embeddings") |
| 628 | or name.endswith("Attention") |
| 629 | ): |
| 630 | return True |
| 631 | # Submodules are not documented. |
| 632 | if os.path.isdir(os.path.join(PATH_TO_DIFFUSERS, name)) or os.path.isfile( |
| 633 | os.path.join(PATH_TO_DIFFUSERS, f"{name}.py") |
| 634 | ): |
| 635 | return True |
| 636 | # All load functions are not documented. |
| 637 | if name.startswith("load_tf") or name.startswith("load_pytorch"): |
| 638 | return True |
| 639 | # is_xxx_available functions are not documented. |
| 640 | if name.startswith("is_") and name.endswith("_available"): |
| 641 | return True |
| 642 | # Deprecated objects are not documented. |
| 643 | if name in DEPRECATED_OBJECTS or name in UNDOCUMENTED_OBJECTS: |
| 644 | return True |
| 645 | # MMBT model does not really work. |
| 646 | if name.startswith("MMBT"): |
| 647 | return True |
| 648 | if name in SHOULD_HAVE_THEIR_OWN_PAGE: |
| 649 | return True |
| 650 | return False |
| 651 | |
| 652 | |
| 653 | def check_all_objects_are_documented(): |
no outgoing calls
no test coverage detected