quantdata.volume_curves.load_bins#

Load curve bin files from a directory, add ticker column, fill half-day trailing buckets with 0, and verify there are no other nulls in bucket columns.

quantdata.volume_curves.load_bins.load_curve_definition(directory, *, verbose=<cdxcore.verbose.Context object>)[source]#

Load the curve definition file from a directory.

quantdata.volume_curves.load_bins.merge_curve_files(directory, tickers, start, end, bucket_minutes, *, verbose=<cdxcore.verbose.Context object>)[source]#

Load all bin files from directory, add a ticker column, fill half-day trailing buckets with 0, and verify bucket columns have no unexpected nulls.

Assumptions:
  • Each file contains a ‘date’ column (date type) and an ‘is_half_day’ boolean column.

  • Bucket columns are named like ‘{prefix}{i}’ with prefixes in BUCKET_PREFIXES.

  • Full day: 390 minutes; Half day: 210 minutes.

  • With bucket_minutes, compute:

    full_n = 390 / bucket_minutes half_n = 210 / bucket_minutes

    Then indices [half_n, …, full_n-1] are the “trailing buckets” that should be 0 on half days.

Returns:

Polars DataFrame sorted by (date, ticker).

quantdata.volume_curves.load_bins.load_curve_files(directory, *, verbose=<cdxcore.verbose.Context object>)[source]#

Load curve definition and merge all curve bins into a single DataFrame.