Detail: IndexNanosecondGO: Accessor Type Clinic

Overview: IndexNanosecondGO: Accessor Type Clinic

IndexNanosecondGO.via_type_clinic.to_hint
IndexNanosecondGO.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.IndexNanosecondGO(('1789-05-05', '1789-12-31', '1799-11-09'))
>>> ix
<IndexNanosecondGO>
1789-05-05T00:00:00.000000000
1789-12-31T00:00:00.000000000
1799-11-09T00:00:00.000000000
<datetime64[ns]>
>>> ix.via_type_clinic.to_hint()
<class 'static_frame.core.index_datetime.IndexNanosecondGO'>
IndexNanosecondGO.via_type_clinic.check(hint, *, fail_fast)
IndexNanosecondGO.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.IndexNanosecondGO(('1789-05-05', '1789-12-31', '1799-11-09'))
>>> ix
<IndexNanosecondGO>
1789-05-05T00:00:00.000000000
1789-12-31T00:00:00.000000000
1799-11-09T00:00:00.000000000
<datetime64[ns]>
>>> ix.via_type_clinic.check(sf.Index[np.str_])
ClinicError('\nIn Index[str_]\n└── Expected str_, provided datetime64 invalid')
IndexNanosecondGO.via_type_clinic.warn(hint, *, fail_fast, category)
IndexNanosecondGO.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.

IndexNanosecondGO.via_type_clinic.__call__(hint, *, fail_fast)
IndexNanosecondGO.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.IndexNanosecondGO(('1789-05-05', '1789-12-31', '1799-11-09'))
>>> ix
<IndexNanosecondGO>
1789-05-05T00:00:00.000000000
1789-12-31T00:00:00.000000000
1799-11-09T00:00:00.000000000
<datetime64[ns]>
>>> 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
IndexNanosecondGO.via_type_clinic.__repr__
IndexNanosecondGO.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.IndexNanosecondGO(('1789-05-05', '1789-12-31', '1799-11-09'))
>>> ix
<IndexNanosecondGO>
1789-05-05T00:00:00.000000000
1789-12-31T00:00:00.000000000
1799-11-09T00:00:00.000000000
<datetime64[ns]>
>>> ix.via_type_clinic
IndexNanosecondGO

IndexNanosecondGO: 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