GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — docs: add Bit reference section for pgvector.Bit by HUIIIM · Pull Request #159 · pgvector/pgvector-python

Conversation

@HUIIIM

@HUIIIM HUIIIM commented Oct 2, 2026

Copy link
Copy Markdown
Contributor

— vertciti AI team (assisting Jiahui Miao)

Summary

The README's Reference section documents Vector, HalfVector, and
SparseVector, but has no entry for Bit — even though Bit is a public
class exported from pgvector (pgvector/__init__.py lists it in __all__)
[实证], and the README's own SQLAlchemy ("Binary Quantization"), Django
(BitField), and Peewee (FixedBitField) sections all rely on the BIT type
[实证]. This PR adds the missing "Bit Vectors" reference subsection, following
the exact pattern of the existing subsections.

Labels: [实证] = verified from the pgvector 0.5.0 package source and the
README at 60739df.

Testing

Docs-only change. Constructor and round-trip behavior were verified by
executing against the released 0.5.0 package [实证]:
Bit([True, False, True]) -> to_list() == [True, False, True];
Bit("101") -> to_text() == "101"; .to_numpy() returns a bool ndarray.
[未确认: not exercised against a live database in this pass.]

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
vertciti AI team
docs: add Bit reference section for pgvector.Bit
2cad55b
chrikrah
chrikrah approved these changes Oct 3, 2026
View reviewed changes

@chrikrah chrikrah left a comment

Copy link
Copy Markdown

There was a problem hiding this comment.

Choose a reason for hiding this comment

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

All four snippets under ### Bit Vectors run at 2cad55b and print what the headings promise, so I would merge this.

$ python -c "
from pgvector import Bit
bit = Bit([True, False, True]); print(repr(bit))
bit = Bit('101');              print(repr(bit))
print(bit.to_list())
print(bit.to_numpy())
"
Bit(101)
Bit(101)
[True, False, True]
[ True False  True]
$ python -m pytest tests/test_bit.py -q
17 passed, 2 warnings in 0.04s
# python 3.12.3, numpy 2.5.3, pgvector imported from the PR tree
# not run: the suites that need a live Postgres

non-blocking: a bool NumPy array works too, Bit(np.array([True, False, True])), at pgvector/bit.py:39-52 and tested at tests/test_bit.py:39. An int array raises expected elements to be boolean, so the snippet is not the one ### Vectors uses.

non-blocking: two blank lines sit before ## History, where the rest of the file uses one.

@HUIIIM, was the NumPy constructor left out on purpose?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

1 more reviewer
@chrikrah chrikrah chrikrah approved these changes
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

2 participants

@HUIIIM @chrikrah
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.