Skip to content

Add History as an alias for TimeSeries #297

@stringertheory

Description

@stringertheory

Summary

The name TimeSeries is kind of annoying to type, and often doesn't seem to capture exactly what the intent is when writing the code. The core mental model of this library is "a history of a value over time" — and the class name should reflect that.

History immediately communicates what the object represents:

alice.level = History(default="unknown")
alice.level[date(2015, 3, 1)] = "junior"
alice.level[date(2017, 6, 15)] = "senior"
alice.level[date(2018, 9, 1)]  # "senior"

Proposal

  • Add History as an alias for TimeSeries in traces/__init__.py
  • Make History the primary name in documentation and examples going forward
  • Keep TimeSeries as a working alias indefinitely (possibly deprecate in a future major version)

traces itself is also kind of "meh", but probably the class name matters more than the library name — it's what appears in every line of user code and it's what teaches the mental model.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions