Skip to content

ENH: Add rotate method for PageObject#913

Merged
MartinThoma merged 2 commits intomainfrom
enh-rotate
May 28, 2022
Merged

ENH: Add rotate method for PageObject#913
MartinThoma merged 2 commits intomainfrom
enh-rotate

Conversation

@MasterOdin
Copy link
Copy Markdown
Member

@MasterOdin MasterOdin commented May 27, 2022

Closes #896

This adds a rotate method to PageObject to be used instead of rotate_clockwise, which is now marked as deprecated. The intent here is that given that there's going to be only one method to rotate the PdfObject in the future, there's not much point in having it be suffixed with the direction as the direction can just be documented, and then save everyone some keystrokes in usage.

As an aside, wasn't really sure what "type" to give this PR, whether it should be DEP, ENH, MAINT or some other one. 🤷

Signed-off-by: Matthew Peveler <matt.peveler@gmail.com>
@codecov
Copy link
Copy Markdown

codecov bot commented May 27, 2022

Codecov Report

Merging #913 (85dd0c0) into main (bb68a4b) will decrease coverage by 0.07%.
The diff coverage is 64.28%.

@@            Coverage Diff             @@
##             main     #913      +/-   ##
==========================================
- Coverage   77.89%   77.81%   -0.08%     
==========================================
  Files          16       16              
  Lines        4324     4327       +3     
  Branches      813      812       -1     
==========================================
- Hits         3368     3367       -1     
- Misses        784      788       +4     
  Partials      172      172              
Impacted Files Coverage Δ
PyPDF2/_utils.py 89.65% <60.00%> (-1.34%) ⬇️
PyPDF2/_page.py 79.37% <66.66%> (-0.58%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update bb68a4b...85dd0c0. Read the comment docs.

@MartinThoma MartinThoma merged commit 07bb859 into main May 28, 2022
@MartinThoma
Copy link
Copy Markdown
Member

Thank you for the PR!

I was first a bit uncertain, because the new name is less clear than the old one. However, the documentation is clear and the name is brief + consistent with the Transformation class.

@MartinThoma
Copy link
Copy Markdown
Member

wasn't really sure what "type" to give this PR, whether it should be DEP, ENH, MAINT or some other one

I'm not going to get religious on that 😄

I try to keep this logic:

  • ENH: Anything that allows the users to do something new
  • MAINT: Third-party package updates, fixing typos, often things that don't quite fit in other categories
  • DEP: Deprecations

If something contains deprecations + other stuff (e.g. fixing typos, adding a new function) I would still go with DEP as it requires users attention. I've set the order like this in the changelog: https://github.com/py-pdf/PyPDF2/blob/main/make_changelog.py#L66

The parts that are most important for users to notice should be on the top in the changelog message

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rename rotate_clockwise to rotate

2 participants