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

feat: remove Image.__array__ #964

Merged
merged 1 commit into from
Nov 26, 2024
Merged

Conversation

lars-reimann
Copy link
Member

@lars-reimann lars-reimann commented Nov 26, 2024

Summary of Changes

Remove the Image.__array__ dunder method, which is used if an Image object is passed to the numpy.array function. Reasons:

  1. Integration with specific third-party libraries is out-of-scope so far.
  2. If we ever add this, a method to_numpy_array would be preferable, since it's more visible and clearer. __array__ could mean anything.

Copy link
Contributor

🦙 MegaLinter status: ✅ SUCCESS

Descriptor Linter Files Fixed Errors Elapsed time
✅ PYTHON black 1 0 0 1.04s
✅ PYTHON mypy 1 0 2.75s
✅ PYTHON ruff 1 0 0 0.3s
✅ REPOSITORY git_diff yes no 0.47s

See detailed report in MegaLinter reports
Set VALIDATE_ALL_CODEBASE: true in mega-linter.yml to validate all sources, not only the diff

MegaLinter is graciously provided by OX Security

@lars-reimann lars-reimann merged commit d2f59c9 into main Nov 26, 2024
8 of 9 checks passed
@lars-reimann lars-reimann deleted the remove-array-dunder-method branch November 26, 2024 18:11
lars-reimann pushed a commit that referenced this pull request Nov 26, 2024
## [0.29.0](v0.28.1...v0.29.0) (2024-11-26)

### Features

* remove `Image.__array__` ([#964](#964)) ([d2f59c9](d2f59c9))
* rename `count_row_if` to `count_rows_if` ([#960](#960)) ([f5d6324](f5d6324))
* rename `epoch_size` to `epoch_count` ([#962](#962)) ([fa62e9b](fa62e9b))
* rename `flip_vertically` and `flip_horizontally` methods ([#946](#946)) ([a3607d7](a3607d7)), closes [#945](#945)
* rename `load_pretrained_model` to `from_pretrained_model` ([#957](#957)) ([5b32acc](5b32acc))
* rename `Row.get_value` to `Row.get_cell` ([#947](#947)) ([e77cb6c](e77cb6c))

### Bug Fixes

* avoid performance warning when accessing `column_count` ([#949](#949)) ([c24b6d5](c24b6d5))
* handle deprecations in third-party libraries ([#963](#963)) ([e10e6bb](e10e6bb))
* index tensor on cpu ([#961](#961)) ([afafd43](afafd43))
@lars-reimann
Copy link
Member Author

🎉 This PR is included in version 0.29.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

@lars-reimann lars-reimann added the released Included in a release label Nov 26, 2024
Copy link

codecov bot commented Nov 26, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 94.42%. Comparing base (e10e6bb) to head (c20d7b3).
Report is 2 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #964      +/-   ##
==========================================
+ Coverage   94.39%   94.42%   +0.02%     
==========================================
  Files         121      121              
  Lines        7464     7461       -3     
==========================================
- Hits         7046     7045       -1     
+ Misses        418      416       -2     

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

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

Successfully merging this pull request may close these issues.

1 participant