Questions tagged [bisect]

the "bisect" subcommand of Git or the "bisect" module of Python

105 questions
2
votes
4 answers

Calculate tax liabilities based on a marginal tax rate schedule

income tax calculation python asks how to calculate taxes given a marginal tax rate schedule, and its answer provides a function that works (below). However, it works only for a single value of income. How would I adapt it to work for a list/numpy…
Max Ghenis
  • 14,783
  • 16
  • 84
  • 132
2
votes
1 answer

How to use scipy.optimize.bisect() when function has additional parameters?

According to the documentation, I should be able to bisect a function with multiple parameters as long as I pass said parameters to bisect() using args=(). However, I just can't make it work and I didn't manage to find an example of using this…
fazan
  • 155
  • 1
  • 3
  • 12
2
votes
1 answer

bisect and lists of user defined objects (python 3)

Before python 3, I used bisect to insert user-defined objects into a list. bisect was happy with this because my user-defined object had a def __cmp__ that defined how to compare the objects. I've read the rationale for not supporting cmp in…
Mike
  • 71
  • 3
2
votes
0 answers

Bamboo git bisect plugin

Are there any plugins for bamboo that run 'git bisect' automatically on broken tests? I've tried to search for one but I haven't found any information about such a plugin. If there isn't, can you suggest me where I can start in order to build one,…
Curve25519
  • 654
  • 5
  • 17
2
votes
1 answer

How can I view the remaining changesets left to check in an hg bisect?

When I'm running hg bisect, sometimes I want to "look ahead" at what's remaining, to see if there are any obvious culprits I could check while a fairly slow bisection test runs. So given I've run > hg bisect -g Testing changeset 15802:446defa0e64a…
deworde
  • 2,679
  • 5
  • 32
  • 60
2
votes
0 answers

Mercurial Bisect: abort: inconsistent state, is good and bad

A bug has been introduced in the code base I'm working on and I'm attempting to see which changset introduced it. Here's what I've done so far: Cloned the release branch $ hg clone https://hg.mozilla.org/releases/mozilla-release/ Marked the tip as…
SRG3006
  • 447
  • 8
  • 21
2
votes
3 answers

Can I use bisect to print the content of a line?

I have a file where each line is ordered alphabetically. The file is 12Gb, which means I can't simply read it line by line. The data looks like this: brown 0 1 0 1 2 fox 3 5 0 0 1 jumped 2 0 6 1 0 The…
kormak
  • 495
  • 2
  • 5
  • 15
2
votes
1 answer

Python 3.4 - Cannot import module

I want to use the bisect module but i get this error when i try to import bisect: NameError: global name 'bisect_left' is not defined And this error when i try from bisect import bisect_left: ImportError: cannot import name bisect_left I'm try to…
kaloyan1123
  • 23
  • 1
  • 4
2
votes
2 answers

Can I use git bisect on a portion of my repository?

I have a single repository that contains several sub-projects and no sub-trees or sub-modules. I now have a bug on a new feature that needs fixing in Project C. C depends on projects A and B. For the feature to work, I need the latest version of…
Carl
  • 43,122
  • 10
  • 80
  • 104
2
votes
1 answer

Saving git file history as multiple files

I've been saving some automatically-generated performance data for my code in perf.txt. Every time I improve my code, I run a script that overwrites perf.txt with the new performance data. I'll then commit perf.txt. In retrospect, overwriting…
2
votes
1 answer

How does mercurial's bisect work when the range includes branching?

If the bisect range includes multiple branches, how does hg bisect's search work. Does it effectively bisect each sub-branch (I would think that would be inefficient)? For instance, borrowing, with gratitude, a diagram from an answer to this…
Joshua Goldberg
  • 5,059
  • 2
  • 34
  • 39
1
vote
0 answers

git bisect giving wrong results

I'm trying to update a patch made in tag xilinx-v2017.4 in linux-xlnx to the tag xilinx-v2022.1. In the new version, a function used is no longer available, xilinx_cdma_prep_sg in drivers/dma/xilinx. I wanted to find out why it was removed,…
1
vote
1 answer

Single point Bisection Method - f(x)=e^(-x) -x

I want to find the root of f(x)=e^(-x) -x using the bisection method for a single point. I Was given c = sgn f(a)(b − a) I will use this later on the main program and So first of all I have the following program in MATLAB: function [y] =f(x) …
Steve
  • 21
  • 2
1
vote
1 answer

"git bisect" tries to test an unexpectedly large number of revisions

When I run: git bisect start I get: Bisecting: 9727 revisions left to test after this (roughly 13 steps) But the bad_commit and good_commit I specified are clearly only around 50 commits back in history. I did a "git…
Chuque
  • 587
  • 1
  • 5
  • 22
1
vote
1 answer

Bisection search in the sorted lines of an opened file (not loaded in memory)

I have a text file of multiple gigabytes, and the millions of lines are sorted: aaaaa bcijkjf dfsdf gdfgdfhqiuzhf zzdiszfhj How is it possible, without loading the whole file in memory, to search if a line is existent, with a bisection search?…
Basj
  • 41,386
  • 99
  • 383
  • 673