-
Notifications
You must be signed in to change notification settings - Fork 0
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
Add new dunder methods and attributes #27
Conversation
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.
looks great! A few suggestions here: #34
Is there a reason to use the external toml library rather than the builtin Python toml library, tomllib
?
* Bump anyhow from 1.0.87 to 1.0.89 (#33) Bumps [anyhow](https://github.com/dtolnay/anyhow) from 1.0.87 to 1.0.89. - [Release notes](https://github.com/dtolnay/anyhow/releases) - [Commits](dtolnay/anyhow@1.0.87...1.0.89) --- updated-dependencies: - dependency-name: anyhow dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * Bump pyo3 from 0.22.2 to 0.22.3 (#32) Bumps [pyo3](https://github.com/pyo3/pyo3) from 0.22.2 to 0.22.3. - [Release notes](https://github.com/pyo3/pyo3/releases) - [Changelog](https://github.com/PyO3/pyo3/blob/v0.22.3/CHANGELOG.md) - [Commits](PyO3/pyo3@v0.22.2...v0.22.3) --- updated-dependencies: - dependency-name: pyo3 dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> * pass thru errors; remove clone * cargo fmt --------- Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Was using toml library because I didn't know about tomllib. Will look into it. |
@ctb Looks like Do we want 3.11 to be the min version required for this package? or keep the external I'm going to leave it for now and merge this branch. Can update later. |
New dunder methods for more Pythonic interaction:
__setitem__
, Set values using the indexing syntaxobj[key] = value
__getitem__
, Query an object to using the indexing syntaxobj[key]
len()
method, returns number of keys in KmerCountTable.New attributes:
.version
, returns oxli version that object was created with (will use later when serialising objects).consumed
, returns total number of bases consumed using eithercount()
orconsume()
.sum_counts
, returns sum total of all counts in table.Note: Have added "toml" package as a conditional dependency for testing
.version
.It is in
pyproject.toml
under optional dependencies. Will be installed if installing oxli from repo viapip install -e .[test]
Closes #20