Improve number reporting in `add_categorical_bound_constraint`

Open Beginner friendly
#153 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
62/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
python
Domain
data

Research direction

Start at the add_categorical_bound_constraint entry point and inspect how it formats percentage and count values in constraint failure messages. Done means percentages avoid scientific notation with fewer decimals and counts use Python-style underscore separators, including the examples described in the issue.

Written by the indexing model from the issue text.

Description

I'm getting constraint failure messages like

6.288887928086567e-05% (20 out of 31802125)

and

1.0073226238812658% (320350 out of 31802125)

In both cases, using fewer decimal places would be nice I think. At the very least we shouldn't be showing scientific notation + % IMO.

For the counts, I think it would be nice to display them like Python does, ie. 320_350 out of 31_802_125.

Dominant language
Python
Stars
46
Forks
3
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from Quantco/datajudge

All issues in Quantco/datajudge

Similar issues

More Python issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.