Detail: IndexHourGO: Accessor Type Clinic

Overview: IndexHourGO: Accessor Type Clinic

IndexHourGO.via_type_clinic.to_hint
IndexHourGO.via_type_clinic
TypeClinic.to_hint()[source]

Return the type hint (the type and/or generic aliases necessary) to represent the object given at initialization.

>>> ix = sf.IndexHourGO(('1517-04-01', '1517-12-31', '1517-06-30'))
>>> ix
<IndexHourGO>
1517-04-01T00
1517-12-31T00
1517-06-30T00
<datetime64[h]>
>>> ix.via_type_clinic.to_hint()
<class 'static_frame.core.index_datetime.IndexHourGO'>
IndexHourGO.via_type_clinic.check(hint, *, fail_fast)
IndexHourGO.via_type_clinic
TypeClinic.check(hint, /, *, fail_fast=False)[source]

Given a hint (a type and/or generic alias), raise a ClinicError exception describing the result of the check if an error is found.

Parameters:

fail_fast – If True, return on first failure. If False, all failures are discovered and reported.

>>> ix = sf.IndexHourGO(('1517-04-01', '1517-12-31', '1517-06-30'))
>>> ix
<IndexHourGO>
1517-04-01T00
1517-12-31T00
1517-06-30T00
<datetime64[h]>
>>> ix.via_type_clinic.check(sf.Index[np.str_])
ClinicError('\nIn Index[str_]\n└── Expected str_, provided datetime64 invalid')
IndexHourGO.via_type_clinic.warn(hint, *, fail_fast, category)
IndexHourGO.via_type_clinic
TypeClinic.warn(hint, /, *, fail_fast=False, category=<class 'UserWarning'>)[source]

Given a hint (a type and/or generic alias), issue a warning describing the result of the check if an error is found.

Parameters:
  • fail_fast – If True, return on first failure. If False, all failures are discovered and reported.

  • category – The Warning subclass to be used for issueing the warning.

IndexHourGO.via_type_clinic.__call__(hint, *, fail_fast)
IndexHourGO.via_type_clinic
TypeClinic.__call__(hint, /, *, fail_fast=False)[source]

Given a hint (a type and/or generic alias), return a ClinicResult object describing the result of the check.

Parameters:

fail_fast – If True, return on first failure. If False, all failures are discovered and reported.

>>> ix = sf.IndexHourGO(('1517-04-01', '1517-12-31', '1517-06-30'))
>>> ix
<IndexHourGO>
1517-04-01T00
1517-12-31T00
1517-06-30T00
<datetime64[h]>
>>> cr = ix.via_type_clinic(sf.Index[np.str_])
>>> cr
<ClinicResult: 1 error>
>>> cr.validated
False
>>> cr.to_str()

In Index[str_]
└── Expected str_, provided datetime64 invalid
IndexHourGO.via_type_clinic.__repr__
IndexHourGO.via_type_clinic
TypeClinic.__repr__()[source]

Return a compact string representation of the type hint (the type and/or generic aliases necessary) to represent the object given at initialization.

>>> ix = sf.IndexHourGO(('1517-04-01', '1517-12-31', '1517-06-30'))
>>> ix
<IndexHourGO>
1517-04-01T00
1517-12-31T00
1517-06-30T00
<datetime64[h]>
>>> ix.via_type_clinic
IndexHourGO

IndexHourGO: Constructor | Exporter | Attribute | Method | Dictionary-Like | Display | Selector | Iterator | Operator Binary | Operator Unary | Accessor Values | Accessor Datetime | Accessor String | Accessor Regular Expression | Accessor Hashlib | Accessor Type Clinic