release v1: 65 held-out tasks, 78 bootstrap records, r2e_local adapter, manifest ae94c40b (part 4)
622387b verified Download heldout_pool/codereverser__casparser-4ea50eaa50de/solution/patch.diff from Benjamin-eecs/openrsi-commit-runtime-assets: direct link, hf CLI and curl.
- Browser
- Download file 2.38 kB
-
https://huggingface.co/datasets/Benjamin-eecs/openrsi-commit-runtime-assets/resolve/main/heldout_pool/codereverser__casparser-4ea50eaa50de/solution/patch.diff
- Command line
-
hf download hf://datasets/Benjamin-eecs/openrsi-commit-runtime-assets/heldout_pool/codereverser__casparser-4ea50eaa50de/solution/patch.diff
-
curl -L -o patch.diff https://huggingface.co/datasets/Benjamin-eecs/openrsi-commit-runtime-assets/resolve/main/heldout_pool/codereverser__casparser-4ea50eaa50de/solution/patch.diff
2.38 kB
| diff --git a/CHANGELOG.md b/CHANGELOG.md | |
| index 4cd7f66..0d5255e 100644 | |
| --- a/CHANGELOG.md | |
| +++ b/CHANGELOG.md | |
| # Changelog | |
| +## 1.2.1 | |
| + | |
| +### Fixed | |
| + | |
| +- Fix mis-classification of STP (Systematic Transfer Plan) for | |
| + Kfintech-serviced schemes. (discussion #141) | |
| + | |
| ## 1.2.0 | |
| ### New | |
| diff --git a/casparser/__init__.py b/casparser/__init__.py | |
| index b106f27..19ccb3b 100644 | |
| --- a/casparser/__init__.py | |
| +++ b/casparser/__init__.py | |
| __all__ = [ | |
| "CapitalGainsReport", | |
| ] | |
| -__version__ = "1.2.0" | |
| +__version__ = "1.2.1" | |
| diff --git a/casparser/parsers/_classify.py b/casparser/parsers/_classify.py | |
| index f92a055..52baa1f 100644 | |
| --- a/casparser/parsers/_classify.py | |
| +++ b/casparser/parsers/_classify.py | |
| DIVIDEND_RE = re.compile( | |
| ) | |
| REINVEST_RE = re.compile(r"reinvest", re.I) | |
| +# Systematic Transfer Plan. A switch by another name β money is moved | |
| +# between two schemes on a schedule. The two RTAs word it differently: | |
| +# CAMS prints "Systematic Transfer Plan Switch In/Out β¦" (already caught by | |
| +# the "switch" keyword), while KFintech prints it letter-spaced as | |
| +# "S T P In/Out (β¦)", which matches none of the plain substring checks and | |
| +# used to fall through to PURCHASE / REDEMPTION. Detecting it here β spacing | |
| +# tolerated β lets both RTAs classify consistently as SWITCH_IN / SWITCH_OUT. | |
| +STP_RE = re.compile(r"\bs\s*t\s*p\b|systematic\s+transfer", re.I) | |
| + | |
| # Counterparty folio embedded in a gift transfer description. Both RTAs | |
| # name the other folio but punctuate differently β KFin uses a colon | |
| # ("Folio No: 12345678901"), CAMS a dot ("Folio No.87654321") β so accept | |
| def get_transaction_type( | |
| elif units > 0: | |
| if "gift" in description: | |
| txn_type = TransactionType.GIFT_IN | |
| - elif "switch" in description: | |
| + elif "switch" in description or STP_RE.search(description): | |
| txn_type = ( | |
| TransactionType.SWITCH_IN_MERGER | |
| if "merger" in description | |
| def get_transaction_type( | |
| re.I, | |
| ): | |
| txn_type = TransactionType.REVERSAL | |
| - elif "switch" in description: | |
| + elif "switch" in description or STP_RE.search(description): | |
| txn_type = ( | |
| TransactionType.SWITCH_OUT_MERGER | |
| if "merger" in description | |