gL iddlZddlZddlmZddlmZmZejdZejdZ ejdZ ejdZ ejdd g d Z ejd Z ejd ZejdZejdZejdZejdZejddg dZejddddggddZejddg dZejddg dZejddg dZejdd g d!Zejddg d"Zejd#Zejd$efd%Zy)&N) _get_option)Seriesoptionsct)z3A fixture providing the ExtensionDtype to validate.NotImplementedErrore/mnt/ssd/data/python-lab/Trading/venv/lib/python3.12/site-packages/pandas/tests/extension/conftest.pydtyper  r ct)z Length-100 array for this type. * data[0] and data[1] should both be non missing * data[0] and data[1] should not be equal rr r r datar  r ct|js'|jdk(stj|dt)z Length-100 array in which all the elements are two. Call pytest.skip in your fixture if the dtype does not support divmod. mz is not a numeric dtype) _is_numerickindpytestskiprr s r data_for_twosrs4   s!2  ug456 r ct)zLength-2 array with [NA, Valid]rr r r data_missingr-r r rr)paramscH|jdk(r|S|jdk(r|Sy)z5Parametrized fixture giving 'data' and 'data_missing'rrNparam)requestrrs r all_datar 3s,}} . ( )r cfd}|S)a  Generate many datasets. Parameters ---------- data : fixture implementing `data` Returns ------- Callable[[int], Generator]: A callable that takes a `count` argument and returns a generator yielding `count` datasets. c36Kt|D]}ywN)range)count_rs r genzdata_repeated..genLsu AJ sr )rr's` r data_repeatedr(<s  Jr ct)z Length-3 array with a known sort order. This should be three items [B, C, A] with A < B < C For boolean dtypes (for which there are only 2 values available), set B=C=True rr r r data_for_sortingr*Ss  r ct)z{ Length-3 array with a known sort order. This should be three items [B, NA, A] with A < B and NA missing. rr r r data_missing_for_sortingr,arr c"tjS)z Binary operator for comparing NA values. Should return a function of two arguments that returns True if both arguments are (scalar) NA for your type. By default, uses ``operator.is_`` )operatoris_r r r na_cmpr0ls <<r c|jS)z The scalar missing value for this type. Default dtype.na_value. TODO: can be removed in 3.x (see https://github.com/pandas-dev/pandas/pull/54930) )na_valuers r r2r2ys >>r ct)z Data for factorization, grouping, and unique tests. Expected to be like [B, B, NA, NA, A, A, B, C] Where A < B < C and NA is missing. If a dtype has _is_boolean = True, i.e. only 2 unique non-NA entries, then set C=B. rr r r data_for_groupingr4s  r TFc|jS)z#Whether to box the data in a Seriesrrs r box_in_seriesr7s ==r cyNr xs r r=sr c dgt|zSr9)lenr;s r r=r=s1#A,r c2tdgt|zSr9)rr?r;s r r=r=s&!s1v&r c|Sr#r r;s r r=r=s!r )scalarlistseriesobject)ridsc|jS)z, Functions to test groupby.apply(). rr6s r groupby_apply_oprHs ==r c|jS)zU Boolean fixture to support Series and Series.to_frame() comparison testing. rr6s r as_framerJ ==r c|jS)zL Boolean fixture to support arr and Series(arr) comparison testing. rr6s r as_seriesrMrKr c|jS)zd Boolean fixture to support comparison testing of ExtensionDtype array and numpy array. rr6s r use_numpyrO ==r ffillbfillc|jS)z{ Parametrized fixture giving method parameters 'ffill' and 'bfill' for Series.fillna(method=) testing. rr6s r fillna_methodrTrPr c|jS)zR Boolean fixture to support ExtensionDtype _from_sequence method testing. rr6s r as_arrayrVrKr c4tjtS)z A scalar that *cannot* be held by this ExtensionArray. The default should work for most subclasses, but is not guaranteed. If the array can hold any item (i.e. object dtype), then use pytest.skip. )rE__new__)rs r invalid_scalarrYs >>& !!r returnc^tjjduxrtdddk(S)z7 Fixture to check if Copy-on-Write is enabled. Tzmode.data_manager)silentblock)rmode copy_on_writerr r r using_copy_on_writer`s1  ""d* E +D 9W Dr )r.rpandas._config.configrpandasrrfixturer rrrr r(r*r,r0r2r4r7rHrJrMrOrTrVrYboolr`r r r resf -     /01,      e}%& &   /e}%&e}%&e}%&)*+e}%&""Tr