Skip to content

[REFACTOR] Clean up chainladder.__init__.py #856

Description

@genedan

Description

Currently working on this, I was trying to clean up some repetitive code:

_DT64_DTYPE = pd.to_datetime(["2000-01-01"]).dtype
_ULT_VAL: str = str(
pd.Timestamp("2262-01-01") - \
pd.Timedelta(1, unit=np.datetime_data(_DT64_DTYPE)[0])
)
class Options:
ARRAY_BACKEND = "numpy"
AUTO_SPARSE = True
ARRAY_PRIORITY = ["dask", "sparse", "cupy", "numpy"]
ULT_VAL: str = _ULT_VAL
DT64_UNIT: str = np.datetime_data(_DT64_DTYPE)[0]
DT64_DTYPE: str = str(_DT64_DTYPE)

but this revealed other tasks that we'll have to address via multiple PRs. These would include but are not limited to:

  • validation or deprecation of Options.get_option
  • deprecation of auto_sparse and auto_backend
  • add Options.reset_... for each option.

Is your feature request aligned with the scope of the package?

  • Yes, absolutely!
  • No, but it's still worth discussing.
  • N/A (this request is not a codebase enhancement).

Describe the solution you'd like, or your current workaround.

I will reorganize Options with an init, and set the attributes to be assigned to the instance rather than class.

Do you have any additional supporting notes?

No response

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

Fields

Priority

Medium

Effort

Low

Scope

Codebase

Projects

Status
Done

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions