arffread.py 1.3 KB

123456789101112131415161718192021222324252627282930313233343536
  1. # This file is not meant for public use and will be removed in SciPy v2.0.0.
  2. # Use the `scipy.io.arff` namespace for importing the functions
  3. # included below.
  4. import warnings
  5. from . import _arffread
  6. __all__ = [ # noqa: F822
  7. 'MetaData', 'loadarff', 'ArffError', 'ParseArffError',
  8. 'r_meta', 'r_comment', 'r_empty', 'r_headerline',
  9. 'r_datameta', 'r_relation', 'r_attribute', 'r_nominal',
  10. 'r_date', 'r_comattrval', 'r_wcomattrval', 'Attribute',
  11. 'NominalAttribute', 'NumericAttribute', 'StringAttribute',
  12. 'DateAttribute', 'RelationalAttribute', 'to_attribute',
  13. 'csv_sniffer_has_bug_last_field', 'workaround_csv_sniffer_bug_last_field',
  14. 'split_data_line', 'tokenize_attribute', 'tokenize_single_comma',
  15. 'tokenize_single_wcomma', 'read_relational_attribute', 'read_header',
  16. 'basic_stats', 'print_attribute', 'test_weka'
  17. ]
  18. def __dir__():
  19. return __all__
  20. def __getattr__(name):
  21. if name not in __all__:
  22. raise AttributeError(
  23. "scipy.io.arff.arffread is deprecated and has no attribute "
  24. f"{name}. Try looking in scipy.io.arff instead.")
  25. warnings.warn(f"Please use `{name}` from the `scipy.io.arff` namespace, "
  26. "the `scipy.io.arff.arffread` namespace is deprecated.",
  27. category=DeprecationWarning, stacklevel=2)
  28. return getattr(_arffread, name)