quantitative 0.4.1 → 0.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: e3d3c818bd142e017de0c61523ac0dfb14ec104fab94e073336892829128d87a
4
- data.tar.gz: 642e8f7c285556847597a4a046443144d9a2fc394448af6ed95fc6d34f90dfd6
3
+ metadata.gz: 8d68c387b70e811a933f804ccc410a9a7eb5382b40c01f806cd446d8d3f893ec
4
+ data.tar.gz: 4d19edc74c74e80ff5cd14bfe0906efad8ee7518ef15e17e7365faf9067b83cf
5
5
  SHA512:
6
- metadata.gz: db5a09bfe7dab83b4697726e1ea52a487231c02b3d57498c5a7a6e8cc152b3baf80c701cc7c01cd5a20732746f5be6d17dfe9d5425a1396f2a08adaba3e091a4
7
- data.tar.gz: 566493343ff4c6986573072b5c6309c4ad3088b13b2c1b518d9cd6cae60d81c4c081bb60dfde54f684e245c347586c1a5ed1efa2b6f5c30708c39d61a278e8bc
6
+ metadata.gz: '08c361a6745b972d50d47b6f73a4e455ae56e5a8a770b1c62ef2ca21e2893c4831e655be702c25c02f0af2edffb561b6db75a7ecc15b080c780442f0eeede8a7'
7
+ data.tar.gz: e29e29bd0bdaf461bbb9581dda8aac99c8dab99c947e31a133710aa62c2ee4a7aa078297cf2f1868a795d7384a834e3dd4a69d124f4017cdf8854b936349415f
data/CHANGELOG.md ADDED
@@ -0,0 +1,50 @@
1
+ # Changelog
2
+
3
+ All notable changes to `quantitative` will be documented in this file.
4
+
5
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
+
8
+ ---
9
+
10
+ ## [0.5.0] — 2026-05-22
11
+
12
+ ### Changed (breaking)
13
+
14
+ - **`Quant::AssetClass::CLASSES` renamed `:treasury_note` → `:treasury`.** The single `:treasury` symbol now covers the full US-government-debt family (bills, notes, bonds, TIPS). Maturity becomes listing metadata, not an AssetClass distinction. Breaking for consumers that exhaustively switch on the `CLASSES` set or pattern-match on `:treasury_note`.
15
+
16
+ Migration: `s/:treasury_note/:treasury/g` across consumer code. Where maturity-aware behavior is needed (e.g., yield-curve segmentation), consult the listing's metadata rather than the AssetClass label.
17
+
18
+ ### Added
19
+
20
+ - `Quant::AssetClass::CLASSES` gains six new entries: `:adr, :cash, :etn, :forward, :swap, :warrant`. Final catalog is 19 entries: `adr, bond, cash, commodity, cryptocurrency, etf, etn, forex, forward, future, mbs, mutual_fund, option, preferred_stock, reit, stock, swap, treasury, warrant`.
21
+ - Per-class spec coverage in `spec/lib/quant/asset_class_spec.rb` — each catalog entry is `valid?`, the 19-count invariant is asserted, and `:treasury_note` rejection is a regression guard against re-introducing the retired symbol.
22
+
23
+ ---
24
+
25
+ ## [0.4.1] — 2026-05
26
+
27
+ ### Fixed
28
+
29
+ - **`Quant::Ticks::OHLC#initialize` and `Quant::Ticks::Spot#initialize` now preserve fractional volumes as `Float`.** A prior regression in both classes coerced `@base_volume` and `@target_volume` via `.to_i`, silently truncating fractional values to integers — a serious correctness issue for crypto markets (and any other domain where fractional base/target volumes are normal, such as fractional-share trading and many futures markets). For example, a kline with `base_volume: 0.12345` was previously stored as `0`. Existing spec assertions used `eq(2.0)` which masked the regression because Ruby's `==` coerces `2 == 2.0 → true`; the values *appeared* correct in tests while being silently truncated in production. Both initializers now coerce via `.to_f`. Trade count (`@trades`) continues to use `.to_i` as it is genuinely an integer.
30
+
31
+ Affected files:
32
+ - `lib/quant/ticks/ohlc.rb` (lines 51–52)
33
+ - `lib/quant/ticks/spot.rb` (lines 46–47)
34
+
35
+ Backwards compatibility: this is a behavior change for callers reading `tick.base_volume` / `tick.target_volume`. Code that did `volume == 2` continues to work (Ruby coerces). Code that did `volume.is_a?(Integer)` will see `false` where it previously saw `true`; such code was implicitly relying on the bug and should be updated to `is_a?(Numeric)` or `is_a?(Float)`. Code that did `volume + 0.5` continues to work, but the result is now precise instead of truncating to integer-then-promoting.
36
+
37
+ ### Added
38
+
39
+ - Regression-guard specs in `spec/lib/quant/ticks/ohlc_spec.rb` and `spec/lib/quant/ticks/spot_spec.rb` that explicitly assert `Float` class membership and use fractional values (`0.12345`, `5_678.901_234`) so a future `.to_i` regression would fail loudly rather than silently coerce.
40
+ - This CHANGELOG.
41
+
42
+ ---
43
+
44
+ ## [0.4.0] — prior baseline
45
+
46
+ Prior baseline before this CHANGELOG was introduced. Subsequent entries above will track changes from 0.4.1 forward.
47
+
48
+ [0.5.0]: https://github.com/mwlang/quantitative/compare/v0.4.1...v0.5.0
49
+ [0.4.1]: https://github.com/mwlang/quantitative/compare/v0.4.0...v0.4.1
50
+ [0.4.0]: https://github.com/mwlang/quantitative/releases/tag/v0.4.0
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- quantitative (0.4.1)
4
+ quantitative (0.5.0)
5
5
  csv
6
6
  oj (~> 3.10)
7
7
  zeitwerk (~> 2.6)
@@ -42,11 +42,15 @@ module Quant
42
42
  # profit from changes in exchange rates.
43
43
  class AssetClass
44
44
  CLASSES = %i(
45
+ adr
45
46
  bond
47
+ cash
46
48
  commodity
47
49
  cryptocurrency
48
50
  etf
51
+ etn
49
52
  forex
53
+ forward
50
54
  future
51
55
  mbs
52
56
  mutual_fund
@@ -54,7 +58,9 @@ module Quant
54
58
  preferred_stock
55
59
  reit
56
60
  stock
57
- treasury_note
61
+ swap
62
+ treasury
63
+ warrant
58
64
  ).freeze
59
65
 
60
66
  attr_reader :asset_class
data/lib/quant/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Quant
4
- VERSION = "0.4.1"
4
+ VERSION = "0.5.0"
5
5
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: quantitative
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.1
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Michael Lang
@@ -62,6 +62,7 @@ files:
62
62
  - ".rubocop.yml"
63
63
  - ".ruby-version"
64
64
  - ".yardopts"
65
+ - CHANGELOG.md
65
66
  - CODE_OF_CONDUCT.md
66
67
  - DISCLAIMER.md
67
68
  - Gemfile