Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[issue-307] add 2 extra (on left and right) dots out of zommed box #308

Open
wants to merge 4 commits into
base: main
Choose a base branch
from

Conversation

lemikhovalex
Copy link

No description provided.

@codecov-commenter
Copy link

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.97%. Comparing base (f58db50) to head (7d9123a).
Report is 1 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #308      +/-   ##
==========================================
- Coverage   96.49%   95.97%   -0.52%     
==========================================
  Files          14       14              
  Lines        1141     1143       +2     
==========================================
- Hits         1101     1097       -4     
- Misses         40       46       +6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@@ -85,6 +85,8 @@ def get_start_end_indices(hf_trace_data, axis_type, start, end) -> Tuple[int, in
# Search the index-positions
start_idx = bisect.bisect_left(hf_trace_data["x"], start)
end_idx = bisect.bisect_right(hf_trace_data["x"], end)
start_idx = max(0, start_idx - 1)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should certainly add some documentation / issue reference to which this is performed.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

added to CHANGELOG.md. Do I need to mention it anywhere else?

@@ -296,7 +296,7 @@ def test_log_axis():
assert len(out) == 2
assert (x1 - x0) < 10
assert len(out[1]["x"]) == 1000
assert out[-1]["x"][0] >= 100
assert out[-1]["x"][0] >= 99
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So here, you increase (i.e. lower) the left boundary, because (when possible) a datapoint to the left is added. Why is there no need to increase the right boundary?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

(maybe because of a small rounding error with log?)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You are right!
-> end_idx = bisect.bisect_right(hf_trace_data["x"], end)
-> end == 49999.99999999999

Nevertheless alter boundary. It would benefit readability

@@ -794,7 +794,7 @@ def test_hf_data_property_reload_data():
assert np.all(fwr.hf_data[0]["y"] == new_y)

fwr.reload_data()
assert (fwr.data[0]["x"][0] >= 10_000) & (fwr.data[0]["x"][-1] <= 20_000)
assert (fwr.data[0]["x"][0] >= 9_999) & (fwr.data[0]["x"][-1] <= 20_001)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would indeed suspsect that, like here, you need to alter both boundaries.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thnx!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants