Code Monkey home page Code Monkey logo

Comments (6)

jxtx avatar jxtx commented on August 10, 2024

Hmmm, seems like it should be. I got that line from Bob Harris (not on github?) I think -- df7d682

from bx-python.

jeffhsu3 avatar jeffhsu3 commented on August 10, 2024

Changing it to MAX seems to work. I'm also trying to make bx-python python 3 compatible. Not sure how to handle convert 'str(key)' into bytes for the indexes.

from bx-python.

rsharris avatar rsharris commented on August 10, 2024

I'm not sure how much of that module I wrote, but ... based on the comments it should be setting that to MAX (but see the caveat in my next paragraph). MAX has no value until a few lines later though. So I think the definitions of MIN and MAX (lines 121-126) should be moved up, right after VERSION = 2.

As the comment indicates, the max position is a signed integer. The loop that filled BIN_OFFSETS_MAX puts 2^32 into bin 0, so the offending line is intended to correct that to 2^31. I'm not sure whether it ought to be 2^31-1 instead. Even if the intervals being processed are half open (open on the right), if the position values are truly limited to signed integers, there's no possibility of an interval that has 2^31 as an end (assuming the comment is correct about signed integers). I'm not familiar enough with the data structure at this point to know whether this matters.

Also worth noting that lower case min and max are used as argument names in the Index and Indexes classes. Don't know if I wrote that or not -- seems like bad practice if I did.

from bx-python.

nsoranzo avatar nsoranzo commented on August 10, 2024

I also noticed that and changed it to sys.maxsize in PR #7 (sys.maxint has been removed in Python 3.1 since there is no longer a limit to the value of integers).

from bx-python.

nsoranzo avatar nsoranzo commented on August 10, 2024

This has been fixed in #7.

from bx-python.

jxtx avatar jxtx commented on August 10, 2024

Closed per @nsoranzo

from bx-python.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.