Erroneous float calculations.
Nobody has claimed this yet.
- Dominant language
- Python
- Stars
- 48.7k
- Forks
- 7.7k
- PR merge metrics
- No merged PRs in 30d
Description
🐛 Bug Description
When an expression is being evaluated, I think the series is changed into np.float32 and when returning back its being changed back to np.float64. Calculation results are in fact erroneous.
To Reproduce
d = get_quote_data([ticker], fields=['$close', '$volume', 'Mul($close, $volume)'], start_time='2020-10-23', end_time='2020-10-30')


Expected Behavior
The actual value should be 3989893260.0
Screenshot
Environment
Note: One could run python scripts/collect_info.py under the qlib directory to get the following information.
- Qlib version:
- Python version:
- OS (
Windows,Linux,MacOS): - Commit number (optional, please provide it if you are using the dev version):
Additional Notes
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the get_quote_data reproduction using Mul($close, $volume), and run scripts/collect_info.py to record the environment. Trace where expression evaluation changes numeric precision, then verify that the reproduced value is 3989893260.0 without introducing the reported calculation error.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- numpy, python
- Domain
- data, fintech-quant
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100