Remove backward-compatibility layer#10
Merged
Merged
Conversation
…ines) Drop the entire _compat.py module and all legacy field accessors, deprecated integer params, and conversion boilerplate. The fixed-point migration is complete — no need to maintain two parallel interfaces. Key changes: - Delete _compat.py (CompatModel, convert_legacy_kwargs, legacy param dicts) - Strip _legacy_fields from all 26 model classes in models.py and feed.py - Remove deprecated integer params from all method signatures (sync + async) - Rename FillModel.yes_price_fixed → yes_price_dollars with AliasChoices - Fix Orderbook quantity type: str|int → str (remove transition hack) - Fix SettlementModel.pnl: float() → Decimal() for correct financial math - Update async_usage.py example to use current field names - Inline cents_to_dollars in web backend and _repr.py All unit tests (274), integration tests (100), and live API tests pass. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- _repr.py / basic_usage.py: yes_price_fixed → yes_price_dollars - async_usage.py: use float() for numeric max on volume_fp strings - test_mve.py: use Decimal() for int conversion of fixed-point strings Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
07d3d91 to
a87750a
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
_compat.pyand all legacy field accessors, deprecated integer params, and conversion boilerplate across 14 filesFillModelfield naming (yes_price_fixed→yes_price_dollarswithAliasChoicesfor API compat)Orderbookquantity type (str | int→str),SettlementModel.pnl(float→Decimal)What was removed
_compat.pyCompatModel,convert_legacy_kwargs, conversion functions, legacy param dictstest_compat.py_legacy_fieldsdictsmodels.pyandfeed.pyconvert_legacy_kwargscallsportfolio.pyandcommunications.pycount,yes_price,no_price,reduce_by,contracts_limit,amountfrom all method signaturesWhat was fixed
FillModel.yes_price_fixed→yes_price_dollars(consistent with every other model); API sendsyes_price_fixed, handled byAliasChoicesOrderbook.yes_dollarstypestr | int→str(API always sends strings now)SettlementModel.pnlusesDecimalinstead offloat()for currency mathasync_usage.pyexample updated to use current field namescents_to_dollarswithDecimalTest plan
BalanceModel,FillModel,MarketModel,OrderbookResponseall parse correctlyFillModelaccepts bothyes_price_fixed(from API) andyes_price_dollars(canonical) viaAliasChoices🤖 Generated with Claude Code